- Timestamp:
- Feb 22, 2007, 9:20:30 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/identification.php
r1744 r1851 29 29 define('PHPWG_ROOT_PATH','./'); 30 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 32 // +-----------------------------------------------------------------------+ 33 // | Check Access and exit when user status is not ok | 34 // +-----------------------------------------------------------------------+ 35 check_status(ACCESS_NONE); 31 36 32 37 //-------------------------------------------------------------- identification -
trunk/include/category_cats.inc.php
r1840 r1851 215 215 $category['nb_images'], 216 216 $category['count_images'], 217 $category['count_categories'] 217 $category['count_categories'], 218 true, 219 '<BR>' 218 220 ), 219 221 'DESCRIPTION' => @$comment, … … 250 252 $category['nb_images'], 251 253 $category['count_images'], 252 $category['count_categories'] 254 $category['count_categories'], 255 true, 256 '<BR>' 253 257 ), 254 258 -
trunk/include/functions_category.inc.php
r1840 r1851 387 387 * @return string 388 388 */ 389 function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_categories, $short_message = true )389 function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_categories, $short_message = true, $Separator = '\n') 390 390 { 391 391 $display_text = ''; 392 392 393 if ($cat_count_images>0) 394 {//at least one image direct or indirect 393 if ($cat_count_images > 0) 394 { 395 if ($cat_nb_images > 0 and $cat_nb_images < $cat_count_images) 396 { 397 $display_text.= get_display_images_count($cat_nb_images, $cat_nb_images, 0, $short_message, $Separator).$Separator; 398 $cat_count_images-= $cat_nb_images; 399 $cat_nb_images = 0; 400 } 401 402 //at least one image direct or indirect 395 403 $display_text.= l10n_dec('image_available', 'images_available', $cat_count_images); 396 404 397 if ($cat_count_categories==0 or $cat_nb_images>=$cat_count_images) 398 {//no descendant categories or descendants do not contain images 405 if ($cat_count_categories == 0 or $cat_nb_images == $cat_count_images) 406 { 407 //no descendant categories or descendants do not contain images 399 408 if (! $short_message) 400 409 { -
trunk/include/functions_html.inc.php
r1840 r1851 471 471 $category['count_images'], 472 472 $category['count_categories'], 473 false 473 false, 474 ' / ' 474 475 ).'">'; 475 476 // show total number of images -
trunk/include/functions_user.inc.php
r1850 r1851 436 436 437 437 // if user is not an admin, locked categories are forbidden 438 if ( $user_status!='administrator' and $user_status!='webmaster')438 if (!is_admin($user_status)) 439 439 { 440 440 $query = ' … … 982 982 function get_access_type_status($user_status='') 983 983 { 984 global $user ;984 global $user, $conf; 985 985 986 986 if ($user_status == '' and isset($user['status']) ) … … 993 993 { 994 994 case 'guest': 995 { 996 if 997 ( 998 !isset($user) or 999 ($user['id']==$conf['guest_id'] and !$conf['guest_access']) 1000 ) 1001 { 1002 $access_type_status = ACCESS_NONE; 1003 } 1004 else 1005 { 1006 $access_type_status = ACCESS_GUEST; 1007 } 1008 break; 1009 } 995 1010 case 'generic': 996 1011 { … … 1023 1038 * @return bool 1024 1039 */ 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); 1040 function is_autorize_status($access_type, $user_status = '') 1041 { 1042 return (get_access_type_status($user_status) >= $access_type); 1037 1043 } 1038 1044 … … 1043 1049 * @return none 1044 1050 */ 1045 function check_status( $access_type)1046 { 1047 if (!is_autorize_status($access_type ))1051 function check_status($access_type, $user_status = '') 1052 { 1053 if (!is_autorize_status($access_type, $user_status)) 1048 1054 { 1049 1055 access_denied(); … … 1055 1061 * @return bool 1056 1062 */ 1057 function is_admin()1058 { 1059 return is_autorize_status(ACCESS_ADMINISTRATOR );1063 function is_admin($user_status = '') 1064 { 1065 return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status); 1060 1066 } 1061 1067 -
trunk/nbm.php
r1806 r1851 28 28 29 29 30 //--------------------------------------------------------------------- include 30 31 define('PHPWG_ROOT_PATH','./'); 31 32 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 33 check_status(ACCESS_NONE); 32 34 include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); 33 35 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); -
trunk/password.php
r1809 r1851 33 33 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 34 34 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 35 36 // +-----------------------------------------------------------------------+ 37 // | Check Access and exit when user status is not ok | 38 // +-----------------------------------------------------------------------+ 39 check_status(ACCESS_NONE); 35 40 36 41 // +-----------------------------------------------------------------------+ -
trunk/register.php
r1818 r1851 29 29 define('PHPWG_ROOT_PATH','./'); 30 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 32 // +-----------------------------------------------------------------------+ 33 // | Check Access and exit when user status is not ok | 34 // +-----------------------------------------------------------------------+ 35 check_status(ACCESS_NONE); 36 31 37 //----------------------------------------------------------- user registration 32 38 -
trunk/search_rules.php
r1537 r1851 44 44 define('PHPWG_ROOT_PATH','./'); 45 45 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 46 check_status(ACCESS_NONE); 46 47 include_once( PHPWG_ROOT_PATH.'include/functions_search.inc.php' ); 47 48 -
trunk/ws.php
r1849 r1851 27 27 28 28 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 29 check_status(ACCESS_NONE); 29 30 include_once(PHPWG_ROOT_PATH.'include/ws_core.inc.php'); 30 31
Note: See TracChangeset
for help on using the changeset viewer.