diff options
author | rub <rub@piwigo.org> | 2006-03-16 22:58:16 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2006-03-16 22:58:16 +0000 |
commit | 9b521760af7639310742d7817c4fb91b88471c5c (patch) | |
tree | 9260a834a927131ba184de330d4f8ecdfaafdcef /admin | |
parent | 5980db248ab4cc05e8596e07d7efc31048bcb8e8 (diff) |
Step 7 improvement issue 0000301:
o can attribute status <= current user
o define mode adviser
=> buttons disabled (gray on IE, not on FF)
=> truncated actions
=> display info mode adviser
git-svn-id: http://piwigo.org/svn/trunk@1085 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/maintenance.php | 36 | ||||
-rw-r--r-- | admin/picture_modify.php | 2 | ||||
-rw-r--r-- | admin/user_list.php | 47 |
3 files changed, 56 insertions, 29 deletions
diff --git a/admin/maintenance.php b/admin/maintenance.php index 0a5c3cd22..c7caf8e50 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -98,16 +98,32 @@ $template->set_filenames(array('maintenance'=>'admin/maintenance.tpl')); $start_url = PHPWG_ROOT_PATH.'admin.php?page=maintenance&action='; -$template->assign_vars( - array( - 'U_MAINT_CATEGORIES' => $start_url.'categories', - 'U_MAINT_IMAGES' => $start_url.'images', - 'U_MAINT_HISTORY' => $start_url.'history', - 'U_MAINT_SESSIONS' => $start_url.'sessions', - 'U_MAINT_FEEDS' => $start_url.'feeds', - 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', - ) - ); +if (!is_adviser()) +{ + $template->assign_vars( + array( + 'U_MAINT_CATEGORIES' => $start_url.'categories', + 'U_MAINT_IMAGES' => $start_url.'images', + 'U_MAINT_HISTORY' => $start_url.'history', + 'U_MAINT_SESSIONS' => $start_url.'sessions', + 'U_MAINT_FEEDS' => $start_url.'feeds', + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', + ) + ); +} +else +{ + $template->assign_vars( + array( + 'U_MAINT_CATEGORIES' => $start_url, + 'U_MAINT_IMAGES' => $start_url, + 'U_MAINT_HISTORY' => $start_url, + 'U_MAINT_SESSIONS' => $start_url, + 'U_MAINT_FEEDS' => $start_url, + 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', + ) + ); +} // +-----------------------------------------------------------------------+ // | sending html code | diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 0e20f9290..05412492c 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -41,7 +41,7 @@ check_status(ACCESS_ADMINISTRATOR); // | synchronize metadata | // +-----------------------------------------------------------------------+ -if (isset($_GET['sync_metadata'])) +if (isset($_GET['sync_metadata']) and !is_adviser()) { $query = ' SELECT path diff --git a/admin/user_list.php b/admin/user_list.php index 6f1b11938..ed2fc77d2 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -97,6 +97,7 @@ SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id, u.'.$conf['user_fields']['username'].' AS username, u.'.$conf['user_fields']['email'].' AS email, ui.status, + ui.adviser, ui.enabled_high FROM '.USERS_TABLE.' AS u INNER JOIN '.USER_INFOS_TABLE.' AS ui @@ -337,9 +338,9 @@ DELETE FROM '.USER_GROUP_TABLE.' $formfields = array('nb_image_line', 'nb_line_page', 'template', 'language', 'recent_period', 'maxwidth', 'expand', 'show_nb_comments', - 'maxheight', 'status', 'enabled_high'); + 'maxheight', 'status', 'adviser', 'enabled_high'); - $true_false_fields = array('expand', 'show_nb_comments', 'enabled_high'); + $true_false_fields = array('expand', 'show_nb_comments', 'adviser', 'enabled_high'); foreach ($formfields as $formfield) { @@ -380,20 +381,22 @@ DELETE FROM '.USER_GROUP_TABLE.' $data[$dbfield] = $_POST[$dbfield]; } } - + // Webmaster status must not be changed if ($conf['webmaster_id'] == $user_id and isset($data['status'])) { $data['status'] = 'webmaster'; } - + + // Webmaster and guest adviser must not be changed + if ((($conf['webmaster_id'] == $user_id) or ($conf['guest_id'] == $user_id)) and isset($data['adviser'])) + { + $data['adviser'] = 'false'; + } + array_push($datas, $data); } -// echo '<pre>'; -// print_r($datas); -// echo '</pre>'; - mass_updates(USER_INFOS_TABLE, $dbfields, $datas); } @@ -572,6 +575,8 @@ if (isset($_POST['pref_submit'])) // echo '<pre>'; print_r($_POST); echo '</pre>'; $template->assign_vars( array( + 'ADVISER_YES' => 'true' == $_POST['adviser'] ? 'checked="checked"' : '', + 'ADVISER_NO' => 'false' == $_POST['adviser'] ? 'checked="checked"' : '', 'NB_IMAGE_LINE' => $_POST['nb_image_line'], 'NB_LINE_PAGE' => $_POST['nb_line_page'], 'MAXWIDTH' => $_POST['maxwidth'], @@ -582,7 +587,9 @@ if (isset($_POST['pref_submit'])) 'SHOW_NB_COMMENTS_YES' => 'true' == $_POST['show_nb_comments'] ? 'checked="checked"' : '', 'SHOW_NB_COMMENTS_NO' => - 'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '' + 'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '', + 'ENABLED_HIGH_YES' => 'true' == $_POST['enabled_high'] ? 'checked="checked"' : '', + 'ENABLED_HIGH_NO' => 'false' == $_POST['enabled_high'] ? 'checked="checked"' : '', )); } else @@ -665,14 +672,18 @@ foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) { $selected = ''; } - - $template->assign_block_vars( - $blockname, - array( - 'VALUE' => $status, - 'CONTENT' => $lang['user_status_'.$status], - 'SELECTED' => $selected - )); + + // Only status <= can be assign + if (is_autorize_status(get_access_type_status($status))) + { + $template->assign_block_vars( + $blockname, + array( + 'VALUE' => $status, + 'CONTENT' => $lang['user_status_'.$status], + 'SELECTED' => $selected + )); + } } // associate @@ -800,7 +811,7 @@ foreach ($page['filtered_users'] as $num => $local_user) 'U_MOD' => $profile_url.$local_user['id'], 'U_PERM' => $perm_url.$local_user['id'], 'USERNAME' => $local_user['username'], - 'STATUS' => $lang['user_status_'.$local_user['status']], + 'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''), 'EMAIL' => isset($local_user['email']) ? $local_user['email'] : '', 'GROUPS' => $groups_string, 'PROPERTIES' => (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) ? $lang['is_high_enabled'] : $lang['is_high_disabled'] |