UCP problem (cripted password)
#1

Hi guys, i have a problem with my User Control Panel (UCP).

My GameMode is using md5 to crypt passwords, and a password in my database looks like this: 81DC9BDB52D04DC20036DBD8313ED055

Now, when i enter in the UCP a wrong password, it tells me that I entered it wrong. When i enter the correct one, it redirects me on index.php but it doesn't connected me on...

Here's my login.php:
Код:
<?php
include 'includes/config.php';
if(isset($_POST['username']) && isset($_POST['password'])){
	$username = sec($_POST['username']);
	$password = sec(strtoupper(hash("md5",$_POST['password'])));
	$check = get_row("SELECT id FROM players WHERE Name='$username' && Password='$password'");
	if(isset($check['id'])){
		$banned = get_row("SELECT * FROM bans WHERE Name='$username'");
		if(isset($banned['id'])){
			if($banned['BanaP'] == 0){
				$err = 'Eşti banat permanent.';
			}else{
				$err = 'Eşti banat pвnă la data de '.$banned['BanzP'].'.'.$banned['BanlP'].'.'.$banned['BanaP'].' '.$banned['BanoP'].':'.$banned['BanmP'];
			}
		}else{
			$_SESSION['username'] = $_POST['username'];
			$_SESSION['password'] = $password;
			mysql_query("UPDATE players SET rpgon=2 WHERE Name='$username'");
			header('location: index.php');
		}
	}else{
		$err = 'Numele de utilizator ori parola incorecte.';
	}
}

include 'includes/header.php';

?>

<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
						try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
					</script>
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="index">Acasă</a>
</li>
<li class="active"><i class="icon-angle-right"></i>
Conectare
</li>
</ul>

<div class="nav-search" id="nav-search">
<form method="POST" action="searchplayer">
<span class="input-icon">
<input type="text" placeholder="Caută jucător ..." name="username" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
<i class="icon-search nav-search-icon"></i>
</span>
</form>
</div> 

</div>
<div class="page-content">
<div class="row-fluid">
<div class="span12">
<center>
<form method="POST" action="login.php">
		<?php if(isset($err)): ?>
				<center><div class="alert alert-danger"><?=$err?></div></center>
		<?php endif; ?>		
	<h2>Panou Utilizator RPG Hard-Play</h2>
		
			Nume de utilizator:<br />
			<input type="text" id="username" name="username" /><br />
			Parola:<br /> 
			<input  id="password" type="password" name="password" /><br />
			<br />
			<input class="btn btn-inverse btn-large" type="submit" value="Conectare"><br /><br />
			<br>	
			<br>
			<div class="hr hr8 hr"></div>
			<br>
			(&copy;) Hard-Play Community
</form>
</center>
</div><!-- this div closes span12-->
</div><!-- this div close row fluid -->
</div><!-- this div close page content-->
</div><!-- this div close main content-->
Reply


Messages In This Thread
UCP problem (cripted password) - by vldutz1 - 28.12.2015, 19:41
Re: UCP problem (cripted password) - by Boar - 28.12.2015, 22:41
Re: UCP problem (cripted password) - by vldutz1 - 29.12.2015, 08:06
Re: UCP problem (cripted password) - by SaltySandy - 29.12.2015, 10:04
Re: UCP problem (cripted password) - by vldutz1 - 29.12.2015, 10:28
Re: UCP problem (cripted password) - by Boar - 29.12.2015, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)