Changeset 8126
- Timestamp:
- Dec 14, 2010, 2:47:24 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r6993 r8126 104 104 // +-----------------------------------------------------------------------+ 105 105 // request to delete a virtual category / not for an adviser 106 if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())106 if (isset($_GET['delete']) and is_numeric($_GET['delete'])) 107 107 { 108 108 delete_categories(array($_GET['delete'])); -
trunk/admin/comments.php
r6363 r8126 38 38 // +-----------------------------------------------------------------------+ 39 39 40 if (!empty($_POST) and !is_adviser())40 if (!empty($_POST)) 41 41 { 42 42 if (empty($_POST['comments'])) -
trunk/admin/configuration.php
r6411 r8126 107 107 108 108 //------------------------------ verification and registration of modifications 109 if (isset($_POST['submit']) and !is_adviser())109 if (isset($_POST['submit'])) 110 110 { 111 111 $int_pattern = '/^\d+$/'; … … 324 324 325 325 $errors = array(); 326 if ( !is_adviser() ) 327 { 328 if (save_profile_from_post($edit_user, $errors)) 329 { 330 // Reload user 331 $edit_user = build_user($conf['guest_id'], false); 332 array_push($page['infos'], l10n('Information data registered in database')); 333 } 326 if (save_profile_from_post($edit_user, $errors)) 327 { 328 // Reload user 329 $edit_user = build_user($conf['guest_id'], false); 330 array_push($page['infos'], l10n('Information data registered in database')); 334 331 } 335 332 $page['errors'] = array_merge($page['errors'], $errors); -
trunk/admin/extend_for_templates.php
r6550 r8126 118 118 // +-----------------------------------------------------------------------+ 119 119 120 if (isset($_POST['submit']) and !is_adviser())120 if (isset($_POST['submit'])) 121 121 { 122 122 $replacements = array(); -
trunk/admin/group_list.php
r6363 r8126 43 43 // +-----------------------------------------------------------------------+ 44 44 45 if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())45 if (isset($_GET['delete']) and is_numeric($_GET['delete'])) 46 46 { 47 47 // destruction of the access linked to the group … … 86 86 // +-----------------------------------------------------------------------+ 87 87 88 if (isset($_POST['submit_add']) and !is_adviser())88 if (isset($_POST['submit_add'])) 89 89 { 90 90 if (empty($_POST['groupname'])) … … 128 128 // +-----------------------------------------------------------------------+ 129 129 130 if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']) and !is_adviser())130 if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default'])) 131 131 { 132 132 $query = ' -
trunk/admin/include/check_integrity.class.php
r5287 r8126 78 78 79 79 // Treatments 80 if (!is_adviser()) 81 { 82 if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection'])) 83 { 84 $corrected_count = 0; 85 $not_corrected_count = 0; 80 if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection'])) 81 { 82 $corrected_count = 0; 83 $not_corrected_count = 0; 84 85 foreach ($this->retrieve_list as $i => $c13y) 86 { 87 if (!empty($c13y['correction_fct']) and 88 $c13y['is_callable'] and 89 in_array($c13y['id'], $_POST['c13y_selection'])) 90 { 91 if (is_array($c13y['correction_fct_args'])) 92 { 93 $args = $c13y['correction_fct_args']; 94 } 95 else 96 if (!is_null($c13y['correction_fct_args'])) 97 { 98 $args = array($c13y['correction_fct_args']); 99 } 100 else 101 { 102 $args = array(); 103 } 104 $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args); 105 106 if ($this->retrieve_list[$i]['corrected']) 107 { 108 $corrected_count += 1; 109 } 110 else 111 { 112 $not_corrected_count += 1; 113 } 114 } 115 } 116 117 if ($corrected_count > 0) 118 { 119 $page['infos'][] = 120 l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.', 121 $corrected_count); 122 } 123 if ($not_corrected_count > 0) 124 { 125 $page['errors'][] = 126 l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.', 127 $not_corrected_count); 128 } 129 } 130 else 131 { 132 if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection'])) 133 { 134 $ignored_count = 0; 86 135 87 136 foreach ($this->retrieve_list as $i => $c13y) 88 137 { 89 if (!empty($c13y['correction_fct']) and 90 $c13y['is_callable'] and 91 in_array($c13y['id'], $_POST['c13y_selection'])) 92 { 93 if (is_array($c13y['correction_fct_args'])) 94 { 95 $args = $c13y['correction_fct_args']; 96 } 97 else 98 if (!is_null($c13y['correction_fct_args'])) 99 { 100 $args = array($c13y['correction_fct_args']); 101 } 102 else 103 { 104 $args = array(); 105 } 106 $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args); 107 108 if ($this->retrieve_list[$i]['corrected']) 109 { 110 $corrected_count += 1; 111 } 112 else 113 { 114 $not_corrected_count += 1; 115 } 116 } 117 } 118 119 if ($corrected_count > 0) 138 if (in_array($c13y['id'], $_POST['c13y_selection'])) 139 { 140 $this->build_ignore_list[] = $c13y['id']; 141 $this->retrieve_list[$i]['ignored'] = true; 142 $ignored_count += 1; 143 } 144 } 145 146 if ($ignored_count > 0) 120 147 { 121 148 $page['infos'][] = 122 l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.', 123 $corrected_count); 124 } 125 if ($not_corrected_count > 0) 126 { 127 $page['errors'][] = 128 l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.', 129 $not_corrected_count); 130 } 131 } 132 else 133 { 134 if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection'])) 135 { 136 $ignored_count = 0; 137 138 foreach ($this->retrieve_list as $i => $c13y) 139 { 140 if (in_array($c13y['id'], $_POST['c13y_selection'])) 141 { 142 $this->build_ignore_list[] = $c13y['id']; 143 $this->retrieve_list[$i]['ignored'] = true; 144 $ignored_count += 1; 145 } 146 } 147 148 if ($ignored_count > 0) 149 { 150 $page['infos'][] = 151 l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.', 152 $ignored_count); 153 } 149 l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.', 150 $ignored_count); 154 151 } 155 152 } -
trunk/admin/languages_installed.php
r6550 r8126 38 38 39 39 //--------------------------------------------------perform requested actions 40 if (isset($_GET['action']) and isset($_GET['language']) and !is_adviser())40 if (isset($_GET['action']) and isset($_GET['language'])) 41 41 { 42 42 $page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']); -
trunk/admin/languages_new.php
r6363 r8126 57 57 // +-----------------------------------------------------------------------+ 58 58 59 if (isset($_GET['revision']) and !is_adviser())59 if (isset($_GET['revision'])) 60 60 { 61 61 if (!is_webmaster()) -
trunk/admin/maintenance.php
r6993 r8126 38 38 // +-----------------------------------------------------------------------+ 39 39 40 $action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';40 $action = isset($_GET['action']) ? $_GET['action'] : ''; 41 41 42 42 switch ($action) -
trunk/admin/menubar.php
r6363 r8126 65 65 } 66 66 67 if ( isset($_POST['reset']) and !is_adviser())67 if ( isset($_POST['reset'])) 68 68 { 69 69 $mb_conf = array(); … … 86 86 87 87 88 if ( isset($_POST['submit']) and !is_adviser())88 if ( isset($_POST['submit']) ) 89 89 { 90 90 foreach ( $mb_conf as $id => $pos ) -
trunk/admin/notification_by_mail.php
r6411 r8126 507 507 case 'param' : 508 508 { 509 if (isset($_POST['param_submit']) and !is_adviser())509 if (isset($_POST['param_submit'])) 510 510 { 511 511 $updated_param_count = 0; … … 540 540 case 'subscribe' : 541 541 { 542 if (!is_adviser()) 543 { 544 if (isset($_POST['falsify']) and isset($_POST['cat_true'])) 545 { 546 $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']); 547 do_timeout_treatment('cat_true', $check_key_treated); 548 } 549 else 550 if (isset($_POST['trueify']) and isset($_POST['cat_false'])) 551 { 552 $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']); 553 do_timeout_treatment('cat_false', $check_key_treated); 554 } 542 if (isset($_POST['falsify']) and isset($_POST['cat_true'])) 543 { 544 $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']); 545 do_timeout_treatment('cat_true', $check_key_treated); 546 } 547 else 548 if (isset($_POST['trueify']) and isset($_POST['cat_false'])) 549 { 550 $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']); 551 do_timeout_treatment('cat_false', $check_key_treated); 555 552 } 556 553 break; … … 559 556 case 'send' : 560 557 { 561 if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']) and !is_adviser())558 if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content'])) 562 559 { 563 560 $check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content'])); -
trunk/admin/permalinks.php
r6550 r8126 84 84 85 85 $selected_cat = array(); 86 if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 and !is_adviser())86 if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 ) 87 87 { 88 88 $permalink = $_POST['permalink']; … … 93 93 $selected_cat = array( $_POST['cat_id'] ); 94 94 } 95 elseif ( isset($_GET['delete_permanent']) and !is_adviser())95 elseif ( isset($_GET['delete_permanent']) ) 96 96 { 97 97 $query = ' -
trunk/admin/picture_modify.php
r6714 r8126 41 41 // +-----------------------------------------------------------------------+ 42 42 43 if (isset($_GET['sync_metadata']) and !is_adviser())43 if (isset($_GET['sync_metadata'])) 44 44 { 45 45 $query = ' … … 71 71 } 72 72 73 if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())73 if (isset($_POST['submit']) and count($page['errors']) == 0) 74 74 { 75 75 $data = array(); … … 125 125 and isset($_POST['cat_dissociated']) 126 126 and count($_POST['cat_dissociated']) > 0 127 and !is_adviser()128 127 ) 129 128 { … … 137 136 and isset($_POST['cat_associated']) 138 137 and count($_POST['cat_associated']) > 0 139 and !is_adviser()140 138 ) 141 139 { … … 153 151 and isset($_POST['cat_dismissed']) 154 152 and count($_POST['cat_dismissed']) > 0 155 and !is_adviser()156 153 ) 157 154 { … … 171 168 and isset($_POST['cat_elected']) 172 169 and count($_POST['cat_elected']) > 0 173 and !is_adviser()174 170 ) 175 171 { -
trunk/admin/plugins_list.php
r6363 r8126 37 37 38 38 //--------------------------------------------------perform requested actions 39 if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser())39 if (isset($_GET['action']) and isset($_GET['plugin'])) 40 40 { 41 41 check_pwg_token(); -
trunk/admin/plugins_update.php
r6363 r8126 36 36 37 37 //-----------------------------------------------------------automatic upgrade 38 if (isset($_GET['plugin']) and isset($_GET['revision']) and !is_adviser())38 if (isset($_GET['plugin']) and isset($_GET['revision'])) 39 39 { 40 40 if (!is_webmaster()) -
trunk/admin/profile.php
r6897 r8126 34 34 35 35 $errors = array(); 36 if ( !is_adviser() ) 37 { 38 save_profile_from_post($edit_user, $errors); 39 } 36 save_profile_from_post($edit_user, $errors); 40 37 41 38 load_profile_in_template( -
trunk/admin/rating.php
r6607 r8126 71 71 } 72 72 73 if (isset($_GET['del']) and !is_adviser())73 if (isset($_GET['del'])) 74 74 { 75 75 $del_params = urldecode( $_GET['del'] ); -
trunk/admin/site_manager.php
r8083 r8126 84 84 // | new site creation form | 85 85 // +-----------------------------------------------------------------------+ 86 if (isset($_POST['submit']) and !empty($_POST['galleries_url']) 87 and !is_adviser() ) 86 if (isset($_POST['submit']) and !empty($_POST['galleries_url'])) 88 87 { 89 88 $is_remote = url_is_remote( $_POST['galleries_url'] ); … … 168 167 $page['site'] = $_GET['site']; 169 168 } 170 if (isset($_GET['action']) and isset($page['site']) and !is_adviser())169 if (isset($_GET['action']) and isset($page['site'])) 171 170 { 172 171 $query = ' -
trunk/admin/site_update.php
r7024 r8126 109 109 110 110 // shall we simulate only 111 if ( (isset($_POST['simulate']) and $_POST['simulate'] == 1) or is_adviser())111 if (isset($_POST['simulate']) and $_POST['simulate'] == 1) 112 112 { 113 113 $simulate = true; -
trunk/admin/tags.php
r6363 r8126 39 39 // +-----------------------------------------------------------------------+ 40 40 41 if (isset($_POST['submit']) and !is_adviser())41 if (isset($_POST['submit'])) 42 42 { 43 43 $query = ' … … 105 105 // +-----------------------------------------------------------------------+ 106 106 107 if (isset($_POST['delete']) and isset($_POST['tags']) and !is_adviser())107 if (isset($_POST['delete']) and isset($_POST['tags'])) 108 108 { 109 109 $query = ' … … 142 142 // +-----------------------------------------------------------------------+ 143 143 144 if (isset($_POST['add']) and !empty($_POST['add_tag']) and !is_adviser())144 if (isset($_POST['add']) and !empty($_POST['add_tag'])) 145 145 { 146 146 $tag_name = $_POST['add_tag']; -
trunk/admin/themes_installed.php
r6363 r8126 37 37 // +-----------------------------------------------------------------------+ 38 38 39 if (isset($_GET['action']) and isset($_GET['theme']) and !is_adviser())39 if (isset($_GET['action']) and isset($_GET['theme'])) 40 40 { 41 41 $page['errors'] = $themes->perform_action($_GET['action'], $_GET['theme']); -
trunk/include/common.inc.php
r7501 r8126 208 208 } 209 209 210 if (is_adviser())211 {212 $header_msgs[] = l10n('Adviser mode enabled');213 }214 215 210 if (count($header_msgs) > 0) 216 211 { -
trunk/include/functions_user.inc.php
r6660 r8126 1320 1320 1321 1321 /* 1322 * Return if current user is an adviser1323 * @return bool1322 * Adviser status is depreciated from piwigo 2.2 1323 * @return false 1324 1324 */ 1325 1325 function is_adviser() 1326 1326 { 1327 global $user; 1328 1329 return ($user['adviser'] == 'true'); 1327 return false; 1330 1328 } 1331 1329 … … 1385 1383 else 1386 1384 { 1387 if (defined('IN_ADMIN') and is_adviser()) 1388 { 1389 return 'adviser.mode@'.$_SERVER['SERVER_NAME']; 1390 } 1391 else 1392 { 1393 return $email_address; 1394 } 1385 return $email_address; 1395 1386 } 1396 1387 } -
trunk/include/template.class.php
r8075 r8126 354 354 355 355 $this->smarty->assign( 'ROOT_URL', get_root_url() ); 356 $this->smarty->assign( 'TAG_INPUT_ENABLED', 357 ((is_adviser()) ? 'disabled="disabled" onclick="return false;"' : '')); 356 $this->smarty->assign( 'TAG_INPUT_ENABLED', ''); 358 357 359 358 $save_compile_id = $this->smarty->compile_id; -
trunk/include/ws_functions.inc.php
r7782 r8126 893 893 function ws_images_setPrivacyLevel($params, &$service) 894 894 { 895 if (!is_admin() || is_adviser())895 if (!is_admin()) 896 896 { 897 897 return new PwgError(401, 'Access denied'); … … 936 936 // position 937 937 938 if (!is_admin() || is_adviser())938 if (!is_admin()) 939 939 { 940 940 return new PwgError(401, 'Access denied'); … … 1140 1140 1141 1141 global $conf; 1142 if (!is_admin() || is_adviser())1142 if (!is_admin()) 1143 1143 { 1144 1144 return new PwgError(401, 'Access denied'); … … 1209 1209 { 1210 1210 global $conf; 1211 if (!is_admin() || is_adviser())1211 if (!is_admin()) 1212 1212 { 1213 1213 return new PwgError(401, 'Access denied'); … … 1585 1585 function ws_categories_add($params, &$service) 1586 1586 { 1587 if (!is_admin() or is_adviser())1587 if (!is_admin()) 1588 1588 { 1589 1589 return new PwgError(401, 'Access denied'); … … 1609 1609 function ws_tags_add($params, &$service) 1610 1610 { 1611 if (!is_admin() or is_adviser())1611 if (!is_admin()) 1612 1612 { 1613 1613 return new PwgError(401, 'Access denied'); … … 1630 1630 global $conf; 1631 1631 1632 if (!is_admin() or is_adviser())1632 if (!is_admin()) 1633 1633 { 1634 1634 return new PwgError(401, 'Access denied'); … … 1706 1706 function ws_images_checkFiles($params, &$service) 1707 1707 { 1708 if (!is_admin() or is_adviser())1708 if (!is_admin()) 1709 1709 { 1710 1710 return new PwgError(401, 'Access denied'); … … 1791 1791 { 1792 1792 global $conf; 1793 if (!is_admin() || is_adviser())1793 if (!is_admin()) 1794 1794 { 1795 1795 return new PwgError(401, 'Access denied'); … … 2074 2074 { 2075 2075 global $conf; 2076 if (!is_admin() || is_adviser())2076 if (!is_admin()) 2077 2077 { 2078 2078 return new PwgError(401, 'Access denied'); … … 2148 2148 global $conf; 2149 2149 2150 if (!is_admin() or is_adviser())2150 if (!is_admin()) 2151 2151 { 2152 2152 return new PwgError(401, 'Access denied'); -
trunk/picture.php
r6712 r8126 277 277 case 'set_as_representative' : 278 278 { 279 if (is_admin() and !is_adviser() andisset($page['category']))279 if (is_admin() and isset($page['category'])) 280 280 { 281 281 $query = ' -
trunk/plugins/LocalFilesEditor/admin.php
r5272 r8126 165 165 case 'tpl': 166 166 // New file form creation 167 if ($newfile_page and !is_adviser())167 if ($newfile_page) 168 168 { 169 169 $filename = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : ''; … … 281 281 // | Load backup file 282 282 // +-----------------------------------------------------------------------+ 283 if (isset($_POST['restore']) and !is_adviser())283 if (isset($_POST['restore'])) 284 284 { 285 285 $edited_file = $_POST['edited_file']; … … 293 293 // | Save file 294 294 // +-----------------------------------------------------------------------+ 295 if (isset($_POST['submit']) and !is_adviser())295 if (isset($_POST['submit'])) 296 296 { 297 297 if (!is_webmaster()) -
trunk/plugins/admin_multi_view/controller.php
r8012 r8126 31 31 if ( isset($_GET['view_as']) ) 32 32 { 33 if ( is_adviser() and $user['id']!=$_GET['view_as'] and $conf['guest_id']!=$_GET['view_as'])34 die('security error');35 33 if ($user['id']===$_GET['view_as']) 36 34 pwg_unset_session_var( 'multiview_as' ); … … 112 110 $query = ' 113 111 SELECT '.$conf['user_fields']['id'].' AS id,'.$conf['user_fields']['username'].' AS username 114 FROM '.USERS_TABLE; 115 if (is_adviser()) 116 { 117 $query .=' 118 WHERE '.$conf['user_fields']['id']. ' IN ('.$user['id'].','.$conf['guest_id'].') 119 '; 120 } 121 $query .=' 112 FROM '.USERS_TABLE.' 122 113 ORDER BY CONVERT('.$conf['user_fields']['username'].',CHAR) 123 114 ;';
Note: See TracChangeset
for help on using the changeset viewer.