Changeset 2029
- Timestamp:
- Jun 6, 2007, 12:01:15 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/feed.php
r1900 r2029 92 92 { 93 93 $image_only = true; 94 if (! $user['is_the_guest'])94 if (!is_a_guest()) 95 95 {// auto session was created - so switch to guest 96 96 $user = build_user( $conf['guest_id'], true ); -
trunk/identification.php
r2014 r2029 41 41 { 42 42 $redirect_to = urldecode($_GET['redirect']); 43 if ( $user['is_the_guest'])43 if ( is_a_guest() ) 44 44 { 45 45 array_push($errors, l10n('access_forbiden')); -
trunk/include/common.inc.php
r1903 r2029 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far)8 7 // | file : $Id$ 9 8 // | last update : $Date$ … … 166 165 // only now we can set the localized username of the guest user (and not in 167 166 // include/user.inc.php) 168 if ( $user['is_the_guest'])167 if (is_a_guest()) 169 168 { 170 169 $user['username'] = $lang['guest']; -
trunk/include/config_default.inc.php
r1970 r2029 174 174 // 'http://phpwebgallery.net' => array('label' => 'PWG website', 'new_window' => false, 'eval_visible' => 'return true;'), 175 175 // 'http://forum.phpwebgallery.net' => array('label' => 'For ADMIN', 'new_window' => true, 'eval_visible' => 'return is_admin();'), 176 // 'http://phpwebgallery.net/doc' => array('label' => 'For Guest', 'new_window' => true, 'eval_visible' => 'return $user[\'is_the_guest\'];'),176 // 'http://phpwebgallery.net/doc' => array('label' => 'For Guest', 'new_window' => true, 'eval_visible' => 'return is_a_guest();'), 177 177 // 'http://download.gna.org/phpwebgallery/' => 178 178 // array('label' => 'PopUp', 'new_window' => true, … … 214 214 // $conf['random_index_redirect'] = array( 215 215 // PHPWG_ROOT_PATH.'index.php?/best_rated' => 'return true;', 216 // PHPWG_ROOT_PATH.'index.php?/recent_pics' => 'return $user[\'is_the_guest\'];',216 // PHPWG_ROOT_PATH.'index.php?/recent_pics' => 'return is_a_guest();', 217 217 // PHPWG_ROOT_PATH.'random.php' => '', 218 218 // PHPWG_ROOT_PATH.'index.php?/categories' => '', -
trunk/include/functions.inc.php
r2026 r2029 424 424 $do_log = false; 425 425 } 426 if ( $user['is_the_guest']and !$conf['history_guest'])426 if (is_a_guest() and !$conf['history_guest']) 427 427 { 428 428 $do_log = false; -
trunk/include/functions_comment.inc.php
r2027 r2029 59 59 60 60 // we do here only BASIC spam check (plugins can do more) 61 if ( ! $user['is_the_guest'])61 if ( !is_a_guest() ) 62 62 return $action; 63 63 … … 119 119 } 120 120 121 if ( $user['is_the_guest'] ) 121 // display author field if the user status is guest or generic 122 if (!is_classic_user()) 122 123 { 123 124 if ( empty($comm['author']) ) -
trunk/include/functions_html.inc.php
r1900 r2029 575 575 .urlencode(urlencode($_SERVER['REQUEST_URI'])); 576 576 577 if ( isset($user ['is_the_guest']) and !$user['is_the_guest'])577 if ( isset($user) and !is_a_guest() ) 578 578 { 579 579 echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; -
trunk/include/functions_user.inc.php
r1985 r2029 147 147 $user['id'] = $user_id; 148 148 $user = array_merge( $user, getuserdata($user_id, $use_cache) ); 149 $user['is_the_guest'] = ($user['id'] == $conf['guest_id']);150 $user['is_the_default'] = ($user['id'] == $conf['default_user_id']);151 149 152 150 // calculation of the number of picture to display per page … … 1016 1014 $cookie = array('id' => (int)$user_id, 'key' => $key); 1017 1015 setcookie($conf['remember_me_name'], 1018 1019 1020 1021 1022 1016 serialize($cookie), 1017 time()+$conf['remember_me_length'], 1018 cookie_path() 1019 ); 1020 } 1023 1021 } 1024 1022 else … … 1091 1089 1092 1090 /* 1091 * Return user status used in this library 1092 * @return string 1093 */ 1094 function get_user_status($user_status) 1095 { 1096 global $user; 1097 1098 if (empty($user_status)) 1099 { 1100 if (isset($user['status'])) 1101 { 1102 $user_status = $user['status']; 1103 } 1104 else 1105 { 1106 // swicth to default value 1107 $user_status = ''; 1108 } 1109 } 1110 return $user_status; 1111 } 1112 1113 /* 1093 1114 * Return access_type definition of uuser 1094 1115 * Test does with user status … … 1097 1118 function get_access_type_status($user_status='') 1098 1119 { 1099 global $user, $conf; 1100 1101 if (empty($user_status)) 1102 { 1103 if (isset($user['status'])) 1104 { 1105 $user_status = $user['status']; 1106 } 1107 else 1108 { 1109 // swicth to default value 1110 $user_status = ''; 1111 } 1112 } 1113 1114 switch ($user_status) 1120 global $conf; 1121 1122 switch (get_user_status($user_status)) 1115 1123 { 1116 1124 case 'guest': … … 1174 1182 1175 1183 /* 1176 * Return if user is an administrator 1184 * Return if user is only a guest 1185 * @return bool 1186 */ 1187 function is_a_guest($user_status = '') 1188 { 1189 return get_user_status($user_status) == 'guest'; 1190 } 1191 1192 /* 1193 * Return if user is, at least, a classic user 1194 * @return bool 1195 */ 1196 function is_classic_user($user_status = '') 1197 { 1198 return is_autorize_status(ACCESS_CLASSIC, $user_status); 1199 } 1200 1201 /* 1202 * Return if user is, at least, an administrator 1177 1203 * @return bool 1178 1204 */ -
trunk/include/menubar.inc.php
r1932 r2029 164 164 //---------------------------------------------------------- special categories 165 165 // favorites categories 166 if ( ! $user['is_the_guest'])166 if ( !is_a_guest() ) 167 167 { 168 168 $template->assign_block_vars('username', array()); … … 243 243 //--------------------------------------------------------------------- summary 244 244 245 if ( $user['is_the_guest'])245 if (is_a_guest()) 246 246 { 247 247 $template->assign_block_vars('login', array()); -
trunk/include/page_tail.php
r1900 r2029 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 39 38 //--------------------------------------------------------------------- contact 40 39 41 if (! $user['is_the_guest'])40 if (!is_a_guest()) 42 41 { 43 42 $template->assign_block_vars( -
trunk/include/picture_comment.inc.php
r1900 r2029 44 44 if ( $page['show_comments'] and isset( $_POST['content'] ) ) 45 45 { 46 if ( $user['is_the_guest']and !$conf['comments_forall'] )46 if ( is_a_guest() and !$conf['comments_forall'] ) 47 47 { 48 48 die ('Session expired'); … … 62 62 { 63 63 case 'moderate': 64 array_push( $infos, $lang['comment_to_validate']);64 array_push( $infos, l10n('comment_to_validate') ); 65 65 case 'validate': 66 array_push( $infos, $lang['comment_added']);66 array_push( $infos, l10n('comment_added')); 67 67 break; 68 68 case 'reject': … … 138 138 array( 139 139 'COMMENT_AUTHOR' => empty($row['author']) 140 ? $lang['guest']140 ? l10n('guest') 141 141 : $row['author'], 142 142 … … 169 169 } 170 170 171 if (! $user['is_the_guest']172 or ( $user['is_the_guest']and $conf['comments_forall']))171 if (!is_a_guest() 172 or (is_a_guest() and $conf['comments_forall'])) 173 173 { 174 174 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); … … 184 184 'CONTENT' => $content 185 185 )); 186 // display author field if the user is not logged in 187 if ($user['is_the_guest']) 186 187 // display author field if the user status is guest or generic 188 if (!is_classic_user()) 188 189 { 189 190 $template->assign_block_vars( -
trunk/include/ws_functions.inc.php
r1912 r2029 703 703 $comment_post_data = null; 704 704 if ($is_commentable and 705 (! $user['is_the_guest']706 or ( $user['is_the_guest']and $conf['comments_forall'] )705 (!is_a_guest() 706 or (is_a_guest() and $conf['comments_forall'] ) 707 707 ) 708 708 ) … … 885 885 { 886 886 global $user, $conf; 887 if (! $user['is_the_guest'])887 if (!is_a_guest()) 888 888 { 889 889 $_SESSION = array(); … … 903 903 global $user, $lang_info; 904 904 $res = array(); 905 $res['username'] = $user['is_the_guest']? 'guest' : $user['username'];905 $res['username'] = is_a_guest() ? 'guest' : $user['username']; 906 906 foreach ( array('status', 'template', 'theme', 'language') as $k ) 907 907 { -
trunk/notification.php
r1900 r2029 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far)8 7 // | file : $Id$ 9 8 // | last update : $Date$ … … 54 53 55 54 $feed_url=PHPWG_ROOT_PATH.'feed.php'; 56 if ( $user['is_the_guest'])55 if (is_a_guest()) 57 56 { 58 57 $feed_image_only_url=$feed_url; -
trunk/picture.php
r2014 r2029 579 579 580 580 // favorite manipulation 581 if (! $user['is_the_guest'])581 if (!is_a_guest()) 582 582 { 583 583 // verify if the picture is already in the favorite of the user -
trunk/profile.php
r2014 r2029 207 207 function load_profile_in_template($url_action, $url_redirect, $userdata) 208 208 { 209 global $template ;209 global $template, $conf; 210 210 211 211 $template->set_filename('profile_content', 'profile_content.tpl'); … … 294 294 } 295 295 296 if (!( $userdata['is_the_guest'] or $userdata['is_the_default']))296 if (!(in_array($userdata['id'], array($conf['guest_id'], $conf['default_user_id'])))) 297 297 { 298 298 $template->assign_block_vars('not_special_user', array()); -
trunk/ws.php
r1900 r2029 81 81 array( 82 82 'image_id' => array(), 83 'author' => array( 'default' => $user['is_the_guest']? 'guest':$user['username']),83 'author' => array( 'default' => is_a_guest()? 'guest':$user['username']), 84 84 'content' => array(), 85 85 'key' => array(),
Note: See TracChangeset
for help on using the changeset viewer.