Changeset 1858 in ExiteCMS for trunk/login.php
- Timestamp:
- 10/17/08 16:40:38 (4 years ago)
- File:
-
- 1 edited
-
trunk/login.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/login.php
r1765 r1858 1 1 <?php 2 2 /*---------------------------------------------------+ 3 | PHP-Fusion 6 Content Management System3 | ExiteCMS Content Management System | 4 4 +----------------------------------------------------+ 5 | Copyright © 2002 - 2006 Nick Jones6 | http://www.php-fusion.co.uk/5 | Copyright 2007 Harro "WanWizard" Verton, Exite BV | 6 | for support, please visit http://exitecms.exite.eu | 7 7 +----------------------------------------------------+ 8 | Released under the terms & conditions of v2 of the 9 | GNU General Public License. For details refer to 10 | the included gpl.txt file or visit http://gnu.org 8 | Some portions copyright 2002 - 2006 Nick Jones | 9 | http://www.php-fusion.co.uk/ | 10 +----------------------------------------------------+ 11 | Released under the terms & conditions of v2 of the | 12 | GNU General Public License. For details refer to | 13 | the included gpl.txt file or visit http://gnu.org | 11 14 +----------------------------------------------------*/ 12 15 require_once dirname(__FILE__)."/includes/core_functions.php"; 13 require_once dirname(__FILE__)."/includes/theme_functions.php";16 require_once PATH_INCLUDES."theme_functions.php"; 14 17 15 18 // redirect back to the homepage if already logged in 16 19 if (iMEMBER) { 17 20 header("Location:".BASEDIR."index.php"); 21 exit; 22 } 23 24 // check if HTTPS if required, and if so, present. 25 if ($settings['auth_ssl'] && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")) { 26 header("Location:".BASEDIR."setuser.php?error=5"); 27 exit; 18 28 } 19 29 … … 21 31 $variables = array(); 22 32 33 $variables['loginerror'] = isset($loginerror) ? $loginerror : ""; 34 $variables['remember_me'] = isset($_SESSION['remember_me']) ? $_SESSION['remember_me'] : "no"; 35 $variables['login_expiry'] = (iADMIN && isset($_SESSION['login_expire'])) ? time_system2local($_SESSION['login_expire']) : ""; 36 37 // get which authentication to show 38 $variables['auth_methods'] = explode(",",$settings['auth_type']); 39 $variables['method_count'] = count($variables['auth_methods']); 40 $variables['auth_state'] = array(); 41 foreach($variables['auth_methods'] as $key => $method) { 42 if (isset($_SESSION['box_login'.$key])) { 43 $variables['auth_state'][] = $_SESSION['box_login'.$key] == 0 ? 1 : 0; 44 } else { 45 $variables['auth_state'][] = 1; 46 } 47 } 48 49 // check if we need to display a registration link 50 if ($settings['enable_registration']) { 51 $variables['show_reglink'] = true; 52 // get all menu items for this user 53 $linkinfo = array(); 54 require_once PATH_INCLUDES."menu_include.php"; 55 menu_generate_tree("", array(1,2,3), false); 56 foreach ($linkinfo as $link) { 57 if ($link['link_url'] == "/register.php") { 58 $variables['show_reglink'] = false; 59 break; 60 } 61 } 62 } else { 63 $variables['show_reglink'] = false; 64 } 65 66 // check if we need to display links 67 $variables['show_passlink'] = 1; 68 23 69 // define the first body panel variables 24 70 $template_panels[] = array('type' => 'body', 'name' => 'login', 'template' => 'main.login.tpl'); 25 71 $template_variables['login'] = $variables; 26 72 73 // make sure updates to session variables are written 74 session_write_close(); 75 27 76 load_templates('body', ''); 28 77 29 // close the database connection 30 mysql_close(); 31 32 // and flush any output remaining 33 ob_end_flush(); 78 // and clean up 79 theme_cleanup(); 34 80 ?>
Note: See TracChangeset
for help on using the changeset viewer.
