/[scire]/scire/login.php
Gentoo

Diff of /scire/login.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 98 Revision 99
35 exit(0); 35 exit(0);
36} 36}
37 37
38if ($_GET['logout']) { 38if ($_GET['logout']) {
39 unset($_SESSION['userid']); 39 unset($_SESSION['userid']);
40 unset($_SESSION['username']);
40} 41}
41if ($_POST['username']) { 42if ($_POST['username']) {
42 $user = $db->select(array('username','password'), "users", "username='".$_POST['username']."'"); 43 $user = $db->select(array('username','password'), "users", "username='".$_POST['username']."'");
43 if($user[0]['username']) { 44 if($user[0]['username']) {
44 if ($_POST['passwd'] and (crypt($_POST['passwd'],447470567) == $user[0]['password'])) { 45 if ($_POST['passwd'] and (crypt($_POST['passwd'],447470567) == $user[0]['password'])) {
46 $_SESSION['userid'] = $user[0]['userid'];
45 $_SESSION['userid'] = $user[0]['username']; 47 $_SESSION['username'] = $user[0]['username'];
46 header("Location: " . ($_GET['afterlogin'] ? $_GET['afterlogin'] : "index.php")); 48 header("Location: " . ($_GET['afterlogin'] ? $_GET['afterlogin'] : "index.php"));
47 exit; 49 exit;
48 } else { 50 } else {
49 print "<h1>Invalid password supplied!</h1>"; 51 print "<h1>Invalid password supplied!</h1>";
50 } 52 }

Legend:
Removed from v.98  
changed lines
  Added in v.99

  ViewVC Help
Powered by ViewVC 1.1.20