Jump to content

SMF Password Encryption


Johnny Mercy
 Share

Recommended Posts

Boas colegas, eu tenho um problema.

Criei um site e no login queria usar as contas do meu Fórum (é SMF), o problema é que não sei como comparar as passwords visto que não sei o método que eles usam para as encriptar. Já procurei na internet mas não consegui resolver o meu problema.

O meu código é o seguinte:

(...)


				$pass = sha1($_POST['mypassword']);
				$username = strtolower($_POST['myusername']);


                    $sql = "SELECT * FROM umbl2forum_members WHERE member_name='" . $username . "' AND passwd='" . $pass . "'"; 

				$res = mysql_query($sql); 
                    if(mysql_numrows($res) == 0) { 
                        $pwError = 'Dados incorrectos!'; 
					echo $pwError;

                    } else { 

					$_SESSION['username']=mysql_result($res,0,'username');
					$_SESSION['password']=mysql_result($res,0,'password');
  				
  						$_SESSION['ip_address']	=$_SERVER['REMOTE_ADDR'];
  						$_SESSION['user_agent']	=$_SERVER['HTTP_USER_AGENT'];
  						$_SESSION['last_access']=time();
                        $_SESSION['id']= mysql_result($res,0,'id');
					$_SESSION['sessao']=session_id();
					$last_ip_result = $_SERVER['REMOTE_ADDR'];
					$time = date('Y/m/d  -  H:i:s');

					//mysql_query("UPDATE contas SET last_ip = '$last_ip_result', last_acess = '$time' WHERE username='" . $_POST['myusername'] . "'");
					echo"aa";

				} 

(...)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.