Jump to content

Problema - Panel Password.


DarkWind
 Share

Recommended Posts

  • Username: DarkWind
  • Problema: logare parola
  • Imagini/Videoclipuri cu problema -:
  • Cod sursă: 
    <title>Login - <?php echo Config::$_SITE_NAME; ?></title>
    </div>
    	<div class="main-content">
    		<div class="main-content-inner">
    					<div class="breadcrumbs" id="breadcrumbs">
    						<script type="text/javascript">
    							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    						</script>
    
    						<ul class="breadcrumb">
    							<li>
    								<i class="ace-icon fa fa-home home-icon"></i>
    								<a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
    							</li>
    							<li class="active">Login page</li>
    						</ul><!-- /.breadcrumb -->
    
    						<div class="nav-search" id="nav-search">
    							<form method="POST" action="<?php echo Config::$_PAGE_URL; ?>search">
    								<span class="input-icon">
    									<input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
    									<i class="ace-icon fa fa-search nav-search-icon"></i>
    								</span>
    							</form>
    						</div> <!-- /.nav-search -->
    					</div>	
    
    <div class="page-content">
    	<div class="row-fluid">
    		<div class="span12">
    <?php
    if(!defined('panel'))
    	die('Nope.');
    if(isset($_SESSION['user'])) echo '<script> location.replace("'.Config::$_PAGE_URL.'"); </script>';
    if(isset($_POST['submit'])) {
    	if(!$_POST['username_'] || !$_POST['password_']) {
    		echo '<div class="alert alert-block alert-danger"><button type="button" class="close" data-dismiss="alert"><i class="ace-icon fa fa-times"></i></button>Complete all fields.</div>';
    	} else {
    		$q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
    		$q->execute(array($_POST['username_'],$_POST['password_']));
    		if($q->rowCount()) {
    			$d = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ?');
    			$d->execute(array($_POST['username_']));
    			$row1 = $d->fetch(PDO::FETCH_OBJ);
    			if($d->rowCount() && date("Y-m-d H:i:s") <= gmdate("Y-m-d H:i:s", $row1->Time)) {
    
    						if($row1->Permanent == 1)	{
    							$expira = "<b>permanent</b>";
    							} else {
    							$expira = "pana la data de <b>". gmdate("Y-m-d H:i:s", $row1->Time) ."</b>";
    						}
    				echo '<div class="alert alert-block alert-danger">
    				Contul tau este suspendat '.$expira.'.<br />
    				Motiv: <b>'.$row1->Reason.'</b><br />
    				Banat pe data de <b>'.$row1->BanTimeDate.'</b></div>';
    			} else {
    				
    				$dele = Config::$g_con->prepare("DELETE FROM panel_restrict WHERE PlayerName = ?");
    				$dele->execute(array($_POST['username_']));				
    				
    				$row = $q->fetch(PDO::FETCH_OBJ);
    				$_SESSION['user'] = $row->id;
    
    				echo '<script> location.replace("'.Config::$_PAGE_URL.'"); </script>';
    				//setcookie ("user",$_POST['username_'],time()+3600*24*60);
    				//setcookie ("password",$_POST['password_'],time()+3600*24*60);
    				//header ('Location: ' . $_PAGE_URL);								
    			}
    			
    		}
    		else echo '<div class="alert alert-block alert-danger"><button type="button" class="close" data-dismiss="alert"><i class="ace-icon fa fa-times"></i></button>Invalid username or password.</div>';
    	}
    }
    ?>
    
    <center>
    <h3>UltraWhite RPG : Login</h2>
    <form method="post" action="">
    <br />
    Username:<br>
    <input type="text" name="username_"/><br/>
    <br>Password:<br>
    <input type="password" name="password_"/><br/>
    <br>
    <input type="submit" name="submit" value="login" class="btn btn-inverse">
    </form>
    <br/>
    Forgot your password? Click <a href="<?php echo Config::$_PAGE_URL; ?>recover">here</a>!
    </center>
    <br/><br/>

     

  • Alte detalii: Salut, cum pot face cand ma loghez in panel sa ma pot loga cu parola md5 ca in baza de date asa se insereaza parolele in md5 si in panel trb sa ma loghez cum e in baza de date de ex "B008708SWWTWTT" ..

Ko62bp8.png

Link to comment
Share on other sites

Inlocuieste asta: 

$q->execute(array($_POST['username_'],$_POST['password_']))

cu asta

 

$q->execute(array($_POST['username_'],md5($_POST['password_'])))

                                                                                                                              

Link to comment
Share on other sites

T/C - problema rezolvata.

                                                                                                                              

Link to comment
Share on other sites

  • s0nyx locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...