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. $sql_entity SQL;
  18. $sql_object new $sql_entity;
  19. $sql_object->DBInitialise();
  20. $sql_object->DBConnexion();
  21.  
  22. include_once(SQL ".inc.php");
  23.  
  24. // if page var is not empty we pass the reference to the form
  25. if(isset($_REQUEST['page'])) $page $_REQUEST['page'];
  26. else $page '';
  27.  
  28. // ////////////////////////////////////
  29. // TENTATIVE D'AUTHENTIFICATION
  30. // ////////////////////////////////////
  31. if (isset($_POST['valid'])) {
  32.   include_once("../lib/functions_auth.php");
  33.  
  34.   $auth_res AuthenthificationProcess($_POST['login']$_POST['password']'ADMIN');
  35.  
  36.   if ($auth_res === true{
  37.     // if page var is not empty we reconnect to the given page
  38.     if(!empty($_POST['page'])) {
  39.       $goto $_POST['page'];
  40.       header("Location: ".$goto);
  41.       exit();
  42.     }
  43.  
  44.     // else we reconnect to the last page (stored in cookie)
  45.     if(isset($_COOKIE['linea21_lastactivity']&& isset($_COOKIE['linea21_lastuser']&& $_POST['login'== $_COOKIE['linea21_lastuser']{
  46.       $goto $_COOKIE['linea21_lastpage'];
  47.       // up to 3 hours of inactivity, we send the user to the latest consulted page
  48.       $lastcon_date = (integer) date("YmdGi"$_COOKIE['linea21_lastactivity']);
  49.       $buffer_date $lastcon_date (60);
  50.  
  51.       $current_date = (integer) date('YmdGi'time());
  52.       if($current_date $buffer_date && isset($_COOKIE['linea21_lastpage'])) {
  53.         header("Location: ".$goto);
  54.         exit();
  55.       else {
  56.         header("Location: index.php");
  57.         exit();
  58.       }
  59.     }
  60.     else {
  61.       header("Location: index.php");
  62.       exit();
  63.     }
  64.   }
  65.  
  66. }
  67.  
  68. include_once(THEME_ADMIN_PATH."login.php");
  69.  
  70. $sql_object -> DBClose();
  71. if(isset($Dbg)) $Dbg->display();
  72. ?>

Documentation generated on Thu, 03 May 2012 15:06:05 +0200 by phpDocumentor 1.4.1