install/upgrade.php
changeset 484 340c81fdd350
parent 436 242353360e37
child 486 600a92aa34c7
equal deleted inserted replaced
483:2cb1c8a6d3db 484:340c81fdd350
    99   if ( isset($_POST['do_login']) )
    99   if ( isset($_POST['do_login']) )
   100   {
   100   {
   101     if ( !$session->user_logged_in )
   101     if ( !$session->user_logged_in )
   102     {
   102     {
   103       $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_MEMBER);
   103       $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_MEMBER);
       
   104       echo '<b>Session manager returned error:</b>' . '<pre>' . print_r($result, true) . '</pre>';
       
   105       exit();
   104     }
   106     }
   105     $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN);
   107     $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN);
   106     if ( $result['success'] )
   108     if ( $result['success'] )
   107     {
   109     {
   108       header('HTTP/1.1 302 Some kind of redirect with implied no content');
   110       header('HTTP/1.1 302 Some kind of redirect with implied no content');
   119   
   121   
   120   echo '<form action="upgrade.php" method="post">';
   122   echo '<form action="upgrade.php" method="post">';
   121   
   123   
   122   if ( isset($result) )
   124   if ( isset($result) )
   123   {
   125   {
   124     echo '<b>Session manager returned error: ' . $result['error'] . '</b>';
   126     echo '<b>Session manager returned error:</b>' . '<pre>' . print_r($result, true) . '</pre>';
   125   }
   127   }
   126   
   128   
   127   ?>
   129   ?>
   128   <p>You need an active admin session to continue.</p>
   130   <p>You need <?php if ( !$session->user_logged_in ) echo 'to be logged in and have '; ?>an active admin session to continue.</p>
   129   <p>
   131   <p>
   130     Username:&nbsp;&nbsp;&nbsp;<input type="text" name="username" /><br />
   132     Username:&nbsp;&nbsp;&nbsp;<input type="text" name="username" /><br />
   131     Password:&nbsp;&nbsp;&nbsp;<input type="password" name="password" /><br />
   133     Password:&nbsp;&nbsp;&nbsp;<input type="password" name="password" /><br />
   132     <input type="submit" name="do_login" value="Log in" />
   134     <input type="submit" name="do_login" value="Log in" />
   133   </p>
   135   </p>