Changeset 1070
- Timestamp:
- Mar 9, 2006, 12:14:53 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1068 r1070 1231 1231 $insert = array(); 1232 1232 $insert['user_id'] = $user_id; 1233 $insert['status'] = ' guest';1233 $insert['status'] = 'normal'; 1234 1234 $insert['template'] = $conf['default_template']; 1235 1235 $insert['nb_image_line'] = $conf['nb_image_line']; -
trunk/admin/include/isadmin.inc.php
r675 r1070 28 28 include( PHPWG_ROOT_PATH.'admin/include/functions.php' ); 29 29 30 if ( $user['status'] != 'admin')30 if (!is_admin()) 31 31 { 32 32 echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; -
trunk/admin/mailtousers.php
r1049 r1070 78 78 function update_data_user_mail_notification() 79 79 { 80 /* $query = '81 insert into '.USER_MAIL_NOTIFICATION_TABLE.'82 (user_id, enabled)83 (select id, \'false\' from '.USERS_TABLE.'84 where mail_address is not null and id not in (select user_id from '.USER_MAIL_NOTIFICATION_TABLE.'))85 ;';86 pwg_query($query);*/87 88 80 global $conf, $page; 81 82 // Set null mail_address empty 83 $query = ' 84 update 85 '.USERS_TABLE.' 86 set 87 mail_address = null 88 where 89 trim(mail_address) = \'\';'; 90 pwg_query($query); 89 91 90 92 $query = ' -
trunk/admin/user_list.php
r1048 r1070 378 378 if ($conf['webmaster_id'] == $user_id and isset($data['status'])) 379 379 { 380 $data['status'] = ' admin';380 $data['status'] = 'webmaster'; 381 381 } 382 382 … … 650 650 $selected = $_POST['status'] == $status ? 'selected="selected"' : ''; 651 651 } 652 else if (' guest' == $status)652 else if ('normal' == $status) 653 653 { 654 654 $selected = 'selected="selected"'; -
trunk/category.php
r1059 r1070 369 369 } 370 370 371 if ( 'admin' == $user['status'])371 if (is_admin()) 372 372 { 373 373 $template->assign_block_vars('admin', array()); … … 409 409 if (isset($page['cat']) 410 410 and is_numeric($page['cat']) 411 and 'admin' == $user['status'])411 and is_admin()) 412 412 { 413 413 $template->assign_block_vars( -
trunk/include/common.inc.php
r1052 r1070 209 209 210 210 if ( basename($_SERVER["PHP_SELF"]) != 'identification.php' 211 and $user['status'] != 'admin')211 and !is_admin() ) 212 212 { 213 213 exit(); -
trunk/include/functions.inc.php
r1048 r1070 356 356 if ($conf['log']) 357 357 { 358 if ( ($conf['history_admin'] ) or ( (! $conf['history_admin']) and ( $user['status'] != 'admin') ) )358 if ( ($conf['history_admin'] ) or ( (! $conf['history_admin']) and (!is_admin()) ) ) 359 359 { 360 360 $login = ($user['id'] == $conf['guest_id']) -
trunk/include/functions_notification.inc.php
r1021 r1070 193 193 } 194 194 195 if ( 'admin' == $user['status'])195 if (is_admin()) 196 196 { 197 197 $nb_unvalidated_comments = count(unvalidated_comments($end)); -
trunk/include/functions_user.inc.php
r1068 r1070 293 293 294 294 // if user is not an admin, locked categories can be considered as private$ 295 if ( $user_status != 'admin')295 if (!is_admin()) 296 296 { 297 297 $query = ' … … 440 440 array( 441 441 'user_id' => $user_id, 442 'status' => $user_id == $conf['webmaster_id'] ? 'admin' : ' guest',442 'status' => $user_id == $conf['webmaster_id'] ? 'admin' : 'normal', 443 443 'template' => $conf['default_template'], 444 444 'nb_image_line' => $conf['nb_image_line'], … … 537 537 } 538 538 539 /* 540 * Return if current is an administrator 541 * @return bool 542 */ 543 function is_admin() 544 { 545 global $user; 546 547 return ($user['status'] == 'webmaster' or $user['status'] == 'admin') ? true : false; 548 } 549 539 550 ?> -
trunk/install/phpwebgallery_structure.sql
r1064 r1070 1 -- MySQL dump 9.11 1 2 -- MySQL dump 9.11 2 3 -- … … 295 296 `nb_image_line` tinyint(1) unsigned NOT NULL default '5', 296 297 `nb_line_page` tinyint(3) unsigned NOT NULL default '3', 297 `status` enum(' admin','guest') NOT NULL default 'guest',298 `status` enum('webmaster', 'admin', 'normal', 'generic', 'guest') NOT NULL default 'guest', 298 299 `language` varchar(50) NOT NULL default 'english', 299 300 `maxwidth` smallint(6) default NULL, -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1066 r1070 393 393 $lang['user_id URL parameter is missing'] = 'user_id URL parameter is missing'; 394 394 $lang['user_status'] = 'User status'; 395 $lang['user_status_webmaster'] = 'Webmaster'; 395 396 $lang['user_status_admin'] = 'Administrator'; 396 $lang['user_status_guest'] = 'User'; 397 $lang['user_status_normal'] = 'User'; 398 $lang['user_status_generic'] = 'Generic'; 399 $lang['user_status_guest'] = 'Guest'; 397 400 $lang['username'] = 'username'; 398 401 $lang['users'] = 'Users'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1066 r1070 393 393 $lang['user_id URL parameter is missing'] = 'le paramètre d\'URL "user_id" manque'; 394 394 $lang['user_status'] = 'Statut de l\'utilisateur'; 395 $lang['user_status_webmaster'] = 'Webmestre'; 395 396 $lang['user_status_admin'] = 'Administrateur'; 396 $lang['user_status_guest'] = 'Visiteur'; 397 $lang['user_status_normal'] = 'Visiteur'; 398 $lang['user_status_generic'] = 'Générique'; 399 $lang['user_status_guest'] = 'Invité'; 397 400 $lang['username'] = 'nom utilisateur'; 398 401 $lang['users'] = 'Utilisateurs'; -
trunk/password.php
r1018 r1070 70 70 , '.$conf['user_fields']['username'].' AS username 71 71 , '.$conf['user_fields']['email'].' AS email 72 FROM '.USERS_TABLE.' 73 WHERE '.$conf['user_fields']['email'].' = \''.$mail_address.'\' 72 FROM '.USERS_TABLE.' as u 73 INNER JOIN '.USER_INFOS_TABLE.' AS ui 74 ON u.'.$conf['user_fields']['id'].' = ui.user_id 75 WHERE ' 76 .$conf['user_fields']['email'].' = \''.$mail_address.'\' AND 77 ui.status not in (\'guest\', \'generic\', \'webmaster\') 74 78 ;'; 75 79 $result = pwg_query($query); -
trunk/picture.php
r1059 r1070 115 115 116 116 //-------------------------------------------------------------- representative 117 if ( 'admin' == $user['status']and isset($_GET['representative']))117 if (is_admin() and isset($_GET['representative'])) 118 118 { 119 119 $query = ' … … 481 481 $data{'content'} = htmlspecialchars( $_POST['content'], ENT_QUOTES); 482 482 483 if (!$conf['comments_validation'] or $user['status'] == 'admin')483 if (!$conf['comments_validation'] or is_admin()) 484 484 { 485 485 $data{'validated'} = 'true'; … … 499 499 $message = $lang['comment_added']; 500 500 501 if (!$conf['comments_validation'] or $user['status'] == 'admin')502 503 if ( $conf['comments_validation'] and $user['status'] != 'admin')501 if (!$conf['comments_validation'] or is_admin()) 502 503 if ( $conf['comments_validation'] and !is_admin() ) 504 504 { 505 505 $message.= '<br />'.$lang['comment_to_validate']; … … 520 520 if ( isset( $_GET['del'] ) 521 521 and is_numeric( $_GET['del'] ) 522 and $user['status'] == 'admin')522 and is_admin() ) 523 523 { 524 524 $query = 'DELETE FROM '.COMMENTS_TABLE; … … 687 687 } 688 688 // button to set the current picture as representative 689 if ( 'admin' == $user['status']and689 if (is_admin() and 690 690 isset($page['cat']) and is_numeric($page['cat'])) 691 691 { … … 701 701 } 702 702 703 if ( 'admin' == $user['status'])703 if (is_admin()) 704 704 { 705 705 $template->assign_block_vars( … … 753 753 } 754 754 //------------------------------------ admin link for information modifications 755 if ( $user['status'] == 'admin')755 if ( is_admin() ) 756 756 { 757 757 $template->assign_block_vars('admin', array()); … … 1153 1153 )); 1154 1154 1155 if ( $user['status'] == 'admin')1155 if ( is_admin() ) 1156 1156 { 1157 1157 $template->assign_block_vars(
Note: See TracChangeset
for help on using the changeset viewer.