Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Change the DO_LOGIN Module in your modules.php to:
- <!-- DO_LOGIN-->
- <div id="do_login">
- <?php
- if(isset($_POST['login_submit'])) {
- if(isset($_POST["user"]) && isset($_POST["pw"])) {
- $user = $_POST["user"];
- $pw = $_POST["pw"];
- $connection = mysql_connect($mysqlhost, $mysqluser, $mysqlpw) or die ($db_error);
- mysql_select_db($mysqldb, $connection) or die($db_error);
- $a=mysql_query("SELECT password FROM authme where username = '$user'");
- if(mysql_num_rows($a) == 1 ) {
- $password_info=mysql_fetch_array($a);
- $sha_info = explode("$",$password_info[0]);
- } else {
- echo '<div class="alert alert-error"><center>Du bist nicht registriert<meta http-equiv="refresh" content="2; URL=index.php"></center></div>';
- }
- if( $sha_info[1] === "SHA" ) {
- $salt = $sha_info[2];
- $sha256_password = hash('sha256', $pw);
- $sha256_password .= $sha_info[2];;
- if(strcasecmp(trim($sha_info[3]),hash('sha256', $sha256_password) ) == 0 ) {
- $_SESSION['User'] = $user;
- ini_set("session.cookie_lifetime","7200"); //set session timeout to 2h
- if($_SESSION['User']) {
- echo '<div class="alert alert-success"><center>'.$login_success.'<meta http-equiv="refresh" content="2; URL=index.php"></center></div>';
- }else{
- echo '<div class="alert alert-error"><center>'.$unknown_error.'<meta http-equiv="refresh" content="2; URL=index.php"> ';
- }
- } else {
- echo '<div class="alert alert-error"><center>'.$login_wrong.'<meta http-equiv="refresh" content="2; URL=index.php"></center></div>';
- }
- }
- }
- mysql_close($connection);
- }
- ?>
- </div>
- <!-- DO_LOGIN -->
Advertisement
Add Comment
Please, Sign In to add comment