Changeset 1850
- Timestamp:
- Feb 22, 2007, 6:31:08 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_notification_by_mail.inc.php
r1809 r1850 262 262 global $user, $lang, $lang_info, $env_nbm; 263 263 264 $user = array(); 265 $user['id'] = $nbm_user['user_id']; 266 $user = array_merge($user, getuserdata($user['id'], true)); 267 268 list($user['template'], $user['theme']) = explode('/', $user['template']); 264 $user = build_user( $nbm_user['user_id'], true ); 269 265 270 266 if ($env_nbm['last_language'] != $user['language']) -
trunk/feed.php
r1784 r1850 87 87 if ($feed_row['user_id']!=$user['id']) 88 88 { // new user 89 $user = array();90 89 $user = build_user( $feed_row['user_id'], true ); 91 90 } … … 96 95 if (!$user['is_the_guest']) 97 96 {// auto session was created - so switch to guest 98 $user = array();99 97 $user = build_user( $conf['guest_id'], true ); 100 98 } 101 99 } 100 101 // Check the status now after the user has been loaded 102 check_status(ACCESS_GUEST); 102 103 103 104 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); -
trunk/include/common.inc.php
r1849 r1850 186 186 } 187 187 188 if ($user['is_the_guest'] and !$conf['guest_access']189 and !in_array( script_basename(),190 // Array of basename without file extention191 array('identification',192 'password',193 'register'194 )195 )196 )197 {198 redirect (get_absolute_root_url(false).'identification.php');199 }200 201 188 if ($conf['check_upgrade_feed'] 202 189 and defined('PHPWG_IN_UPGRADE') -
trunk/include/functions_user.inc.php
r1817 r1850 393 393 function calculate_permissions($user_id, $user_status) 394 394 { 395 global $user;396 397 395 $private_array = array(); 398 396 $authorized_array = array(); … … 438 436 439 437 // if user is not an admin, locked categories are forbidden 440 if ( !is_admin($user_status))438 if ( $user_status!='administrator' and $user_status!='webmaster' ) 441 439 { 442 440 $query = ' … … 982 980 * @return bool 983 981 */ 984 function get_access_type_status($user_status ='')982 function get_access_type_status($user_status='') 985 983 { 986 984 global $user; 987 985 988 if ( ($user_status == '') and isset($user['status']))986 if ($user_status == '' and isset($user['status']) ) 989 987 { 990 988 $user_status = $user['status']; … … 1025 1023 * @return bool 1026 1024 */ 1027 function is_autorize_status($access_type, $user_status = '') 1028 { 1029 return (get_access_type_status($user_status) >= $access_type); 1025 function is_autorize_status($access_type) 1026 { 1027 global $user, $conf; 1028 if ( 1029 !isset($user) or 1030 ($user['id']==$conf['guest_id'] and $conf['guest_access']==false) 1031 ) 1032 { 1033 return ACCESS_NONE>=$access_type; 1034 } 1035 1036 return (get_access_type_status() >= $access_type); 1030 1037 } 1031 1038 … … 1036 1043 * @return none 1037 1044 */ 1038 function check_status( $access_type, $user_status = '')1039 { 1040 if (!is_autorize_status($access_type , $user_status))1045 function check_status( $access_type ) 1046 { 1047 if (!is_autorize_status($access_type) ) 1041 1048 { 1042 1049 access_denied(); … … 1048 1055 * @return bool 1049 1056 */ 1050 function is_admin( $user_status = '')1051 { 1052 return is_autorize_status(ACCESS_ADMINISTRATOR , $user_status);1057 function is_admin() 1058 { 1059 return is_autorize_status(ACCESS_ADMINISTRATOR); 1053 1060 } 1054 1061 -
trunk/qsearch.php
r1816 r1850 2 2 // +-----------------------------------------------------------------------+ 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |4 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 5 5 // +-----------------------------------------------------------------------+ 6 // | branch : BSF (Best So Far)7 6 // | file : $Id$ 8 7 // | last update : $Date$ … … 27 26 define('PHPWG_ROOT_PATH','./'); 28 27 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 28 29 // +-----------------------------------------------------------------------+ 30 // | Check Access and exit when user status is not ok | 31 // +-----------------------------------------------------------------------+ 32 check_status(ACCESS_GUEST); 29 33 30 34 if (empty($_GET['q'])) -
trunk/upload.php
r1843 r1850 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |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$ … … 27 26 define('PHPWG_ROOT_PATH','./'); 28 27 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 28 29 check_status(ACCESS_GUEST); 29 30 30 31 $username = !empty($_POST['username'])?$_POST['username']:$user['username'];
Note: See TracChangeset
for help on using the changeset viewer.