Changeset 1568 for trunk/include/user.inc.php
- Timestamp:
- Oct 20, 2006, 4:17:53 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/user.inc.php
r1524 r1568 26 26 // +-----------------------------------------------------------------------+ 27 27 28 // by default we start with guest 29 $user['id'] = $conf['guest_id']; 30 28 31 if (isset($_COOKIE[session_name()])) 29 32 { 30 33 session_start(); 31 34 if (isset($_GET['act']) and $_GET['act'] == 'logout') 32 { 33 // logout 35 { // logout 34 36 $_SESSION = array(); 35 37 session_unset(); 36 38 session_destroy(); 37 39 setcookie(session_name(),'',0, 38 ini_get('session.cookie_path'), 39 ini_get('session.cookie_domain') 40 40 ini_get('session.cookie_path'), 41 ini_get('session.cookie_domain') 42 ); 41 43 setcookie($conf['remember_me_name'], '', 0, cookie_path()); 42 44 redirect(make_index_url()); 43 } 44 elseif (empty($_SESSION['pwg_uid'])) 45 { 46 // timeout 45 } 46 elseif (empty($_SESSION['pwg_uid'])) 47 { // timeout 47 48 setcookie(session_name(),'',0, 48 ini_get('session.cookie_path'), 49 ini_get('session.cookie_domain') 50 49 ini_get('session.cookie_path'), 50 ini_get('session.cookie_domain') 51 ); 51 52 } 52 53 else 53 54 { 54 55 $user['id'] = $_SESSION['pwg_uid']; 55 $user['is_the_guest'] = false;56 56 } 57 57 } 58 elseif (!empty($_COOKIE[$conf['remember_me_name']])) 58 59 60 // Now check the auto-login 61 if ( $user['id']==$conf['guest_id'] ) 59 62 { 60 63 auto_login(); 61 }62 else63 {64 $user['id'] = $conf['guest_id'];65 $user['is_the_guest'] = true;66 64 } 67 65 68 if ($user['is_the_guest'] and !$conf['guest_access']69 and (basename($_SERVER['PHP_SELF'])!='identification.php')70 and (basename($_SERVER['PHP_SELF'])!='password.php')71 and (basename($_SERVER['PHP_SELF'])!='register.php'))72 {73 redirect (get_root_url().'identification.php');74 }75 66 76 67 // using Apache authentication override the above user search … … 82 73 $user['id'] = get_userid($_SERVER['REMOTE_USER']); 83 74 } 75 } 76 $user = build_user( $user['id'], 77 ( defined('IN_ADMIN') and IN_ADMIN ) ? false : true // use cache ? 78 ); 84 79 85 $user['is_the_guest'] = false;86 }87 88 $user = array_merge(89 $user,90 getuserdata(91 $user['id'],92 ( defined('IN_ADMIN') and IN_ADMIN ) ? false : true // use cache ?93 )94 );95 96 // properties of user guest are found in the configuration97 if ($user['is_the_guest'])98 {99 $user['template'] = $conf['default_template'];100 $user['nb_image_line'] = $conf['nb_image_line'];101 $user['nb_line_page'] = $conf['nb_line_page'];102 $user['language'] = $conf['default_language'];103 $user['maxwidth'] = $conf['default_maxwidth'];104 $user['maxheight'] = $conf['default_maxheight'];105 $user['recent_period'] = $conf['recent_period'];106 $user['expand'] = $conf['auto_expand'];107 $user['show_nb_comments'] = $conf['show_nb_comments'];108 $user['enabled_high'] = $conf['newuser_default_enabled_high'];109 }110 111 // calculation of the number of picture to display per page112 $user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];113 80 ?>
Note: See TracChangeset
for help on using the changeset viewer.