- Timestamp:
- Mar 10, 2006, 9:17:18 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r1070 r1075 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 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 133 133 or die ( "Could not connect to database" ); 134 134 135 if ($conf['check_upgrade_feed']) 135 // 136 // Setup gallery wide options, if this fails then we output a CRITICAL_ERROR 137 // since basic gallery information is not available 138 // 139 $query = ' 140 SELECT param,value 141 FROM '.CONFIG_TABLE.' 142 ;'; 143 if (!($result = pwg_query($query))) 144 { 145 die("Could not query config information"); 146 } 147 148 while ( $row =mysql_fetch_array( $result ) ) 149 { 150 if ( isset( $row['value'] ) ) 151 { 152 $conf[$row['param']] = $row['value']; 153 } 154 else 155 { 156 $conf[$row['param']] = ''; 157 } 158 // If the field is true or false, the variable is transformed into a 159 // boolean value. 160 if ( $conf[$row['param']] == 'true' or $conf[$row['param']] == 'false' ) 161 { 162 $conf[$row['param']] = get_boolean( $conf[$row['param']] ); 163 } 164 } 165 166 include(PHPWG_ROOT_PATH.'include/user.inc.php'); 167 168 if (is_admin() and $conf['check_upgrade_feed']) 136 169 { 137 170 // retrieve already applied upgrades … … 158 191 } 159 192 160 //161 // Setup gallery wide options, if this fails then we output a CRITICAL_ERROR162 // since basic gallery information is not available163 //164 $query = '165 SELECT param,value166 FROM '.CONFIG_TABLE.'167 ;';168 if (!($result = pwg_query($query)))169 {170 die("Could not query config information");171 }172 173 while ( $row =mysql_fetch_array( $result ) )174 {175 if ( isset( $row['value'] ) )176 {177 $conf[$row['param']] = $row['value'];178 }179 else180 {181 $conf[$row['param']] = '';182 }183 // If the field is true or false, the variable is transformed into a184 // boolean value.185 if ( $conf[$row['param']] == 'true' or $conf[$row['param']] == 'false' )186 {187 $conf[$row['param']] = get_boolean( $conf[$row['param']] );188 }189 }190 191 include(PHPWG_ROOT_PATH.'include/user.inc.php');192 193 193 // language files 194 194 include_once(get_language_filepath('common.lang.php')); -
trunk/include/functions_user.inc.php
r1072 r1075 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 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 278 278 function calculate_permissions($user_id, $user_status) 279 279 { 280 global $user; 281 280 282 $private_array = array(); 281 283 $authorized_array = array(); … … 293 295 294 296 // if user is not an admin, locked categories can be considered as private$ 295 if (!is_admin( ))297 if (!is_admin($user_status)) 296 298 { 297 299 $query = ' … … 542 544 * @return bool 543 545 */ 544 function is_autorize_status($access_type )546 function is_autorize_status($access_type, $user_status = '') 545 547 { 546 548 global $user; 547 549 550 if (($user_status == '') and isset($user['status'])) 551 { 552 $user_status = $user['status']; 553 } 554 548 555 $access_type_status = ACCESS_NONE; 549 if (isset($user['status'])) 550 { 551 switch ($user['status']) 552 { 553 case 'guest': 554 case 'generic': 555 { 556 $access_type_status = ACCESS_GUEST; 557 break; 558 } 559 case 'normal': 560 { 561 $access_type_status = ACCESS_CLASSIC; 562 break; 563 } 564 case 'admin': 565 { 566 $access_type_status = ACCESS_ADMINISTRATOR; 567 break; 568 } 569 case 'webmaster': 570 { 571 $access_type_status = ACCESS_WEBMASTER; 572 break; 573 } 556 switch ($user_status) 557 { 558 case 'guest': 559 case 'generic': 560 { 561 $access_type_status = ACCESS_GUEST; 562 break; 563 } 564 case 'normal': 565 { 566 $access_type_status = ACCESS_CLASSIC; 567 break; 568 } 569 case 'admin': 570 { 571 $access_type_status = ACCESS_ADMINISTRATOR; 572 break; 573 } 574 case 'webmaster': 575 { 576 $access_type_status = ACCESS_WEBMASTER; 577 break; 574 578 } 575 579 } … … 584 588 * @return none 585 589 */ 586 function check_status($access_type )590 function check_status($access_type, $user_status = '') 587 591 { 588 592 global $lang; 589 593 590 if (!is_autorize_status($access_type ))594 if (!is_autorize_status($access_type, $user_status)) 591 595 { 592 596 echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; … … 600 604 * @return bool 601 605 */ 602 function is_admin( )603 { 604 return is_autorize_status(ACCESS_ADMINISTRATOR );606 function is_admin($user_status = '') 607 { 608 return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status); 605 609 } 606 610 -
trunk/upgrade.php
r971 r1075 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 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 33 33 34 34 include(PHPWG_ROOT_PATH.'include/mysql.inc.php'); 35 // Is PhpWebGallery already installed ? 36 if (!defined('PHPWG_IN_UPGRADE') or !PHPWG_IN_UPGRADE) 37 { 38 $message = 'PhpWebGallery is not in upgrade mode. In include/mysql.inc.php, 39 insert line 40 <pre style="background-color:lightgray"> 41 define(\'PHPWG_IN_UPGRADE\', true); 42 </pre> 43 if you want to upgrade'; 44 die($message); 45 } 35 36 // +-----------------------------------------------------------------------+ 37 // | Check Access and exit when it is not ok | 38 // +-----------------------------------------------------------------------+ 39 check_upgrade(); 46 40 47 41 // concerning upgrade, we use the default users table -
trunk/upgrade_feed.php
r1027 r1075 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 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 30 30 include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); 31 31 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 32 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); 32 33 include(PHPWG_ROOT_PATH.'include/template.php'); 33 34 include(PHPWG_ROOT_PATH.'include/mysql.inc.php'); 35 36 // +-----------------------------------------------------------------------+ 37 // | Check Access and exit when it is not ok | 38 // +-----------------------------------------------------------------------+ 39 check_upgrade(); 34 40 35 41 define('PREFIX_TABLE', $prefixeTable);
Note: See TracChangeset
for help on using the changeset viewer.