linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file login.php

Documentation is available at login.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage admin
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once("../config/define.php");
  12. include_once("../lib/no_cache.php");
  13. include_once('../languages/' U_L '/lang_common.'CHARSET .'.php');
  14. include_once("../class/system/class." SQL ".php");
  15.  
  16.  
  17. include_once(SQL ".inc.php");
  18.  
  19. // if page var is not empty we pass the reference to the form
  20. if(isset($_REQUEST['page'])) $page $_REQUEST['page'];
  21. else $page '';
  22.  
  23. // ////////////////////////////////////
  24. // TENTATIVE D'AUTHENTIFICATION
  25. // ////////////////////////////////////
  26. if (isset($_POST['valid'])) {
  27.  
  28.   $auth_res $l21auth->logIn($_POST['login']$_POST['password']'ADMIN');
  29.  
  30.   if ($auth_res === true{
  31.     // if page var is not empty we reconnect to the given page
  32.     if(!empty($_POST['page'])) {
  33.       $goto $_POST['page'];
  34.       header("Location: ".$goto);
  35.       exit();
  36.     }
  37.  
  38.     // else we reconnect to the last page (stored in cookie)
  39.     if(isset($_COOKIE['linea21_lastactivity']&& $_POST['login'== $_COOKIE['linea21_lastuser']{
  40.       $goto $_COOKIE['linea21_lastpage'];
  41.       // up to 3 hours of inactivity, we send the user to the latest consulted page
  42.       $lastcon_date = (integer) date("YmdGi"$_COOKIE['linea21_lastactivity']);
  43.       $buffer_date $lastcon_date (60);
  44.  
  45.       $current_date = (integer) date('YmdGi'time());
  46.       if($current_date $buffer_date && isset($_COOKIE['linea21_lastpage'])) {
  47.         header("Location: ".$goto);
  48.         exit();
  49.       else {
  50.         header("Location: index.php");
  51.         exit();
  52.       }
  53.     }
  54.     else {
  55.       header("Location: index.php");
  56.       exit();
  57.     }
  58.   }
  59.  
  60. }
  61.  
  62. include_once(THEME_ADMIN_PATH."login.php");
  63.  
  64. $sql_object -> DBClose();
  65. if(isset($Dbg)) $Dbg->display();
  66. ?>

Documentation generated on Mon, 08 Apr 2013 18:15:28 +0200 by phpDocumentor 1.4.1