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. // TENTATIVE D'AUTHENTIFICATION
  25. // ////////////////////////////////////
  26. if (isset($_POST['valid'])) {
  27.   include_once("../lib/functions_auth.php");
  28.  
  29.   $auth_res AuthenthificationProcess($_POST['login']$_POST['password']'ADMIN');
  30.   if ($auth_res === true{
  31.     // if same user is reconnecting
  32.     if(isset($_COOKIE['linea21_lastactivity']&& isset($_COOKIE['linea21_lastuser']&& $_POST['login'== $_COOKIE['linea21_lastuser']{
  33.  
  34.       // up to 3 hours of inactivity, we send the user to the latest consulted page
  35.       $lastcon_date = (integer) date("YmdGi"$_COOKIE['linea21_lastactivity']);
  36.       $buffer_date $lastcon_date (60);
  37.  
  38.       $current_date = (integer) date('YmdGi'time());
  39.       if($current_date $buffer_date && isset($_COOKIE['linea21_lastpage'])) {
  40.         header("Location: ".$_COOKIE['linea21_lastpage']);
  41.       else {
  42.         header("Location: index.php");
  43.       }
  44.     }
  45.     else header("Location: index.php");
  46.   }
  47.  
  48. }
  49.  
  50. include_once(THEME_ADMIN_PATH."login.php");
  51.  
  52. $sql_object -> DBClose();
  53. $Dbg->display();
  54. ?>

Documentation generated on Fri, 01 Apr 2011 09:32:40 +0200 by phpDocumentor 1.4.1