From b06c6d6f157513e2fc5d6eaa1e6c02d1e1046567 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 13 Sep 2010 15:31:24 +0000 Subject: Refs #2450: Updated docs for core admin actions. git-svn-id: http://code.elgg.org/elgg/trunk@6929 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/disable.php | 17 +++++++++-------- actions/admin/plugins/disableall.php | 14 +++++++------- actions/admin/plugins/enable.php | 16 +++++++++------- actions/admin/plugins/enableall.php | 15 +++++++-------- actions/admin/plugins/reorder.php | 20 ++++++++++++-------- actions/admin/plugins/simple_update_states.php | 22 ++++++++++++++++------ actions/admin/site/update_advanced.php | 16 +++++++--------- actions/admin/site/update_basic.php | 18 ++++++++---------- actions/admin/user/ban.php | 18 +++++++----------- actions/admin/user/delete.php | 13 +++++++------ actions/admin/user/makeadmin.php | 17 ++++++++--------- actions/admin/user/removeadmin.php | 12 +++--------- actions/admin/user/resetpassword.php | 26 ++++++++++++++------------ actions/admin/user/unban.php | 13 +++---------- 14 files changed, 117 insertions(+), 120 deletions(-) diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php index ac80d46e3..3207e6800 100644 --- a/actions/admin/plugins/disable.php +++ b/actions/admin/plugins/disable.php @@ -1,24 +1,24 @@ $data) { - // Disable if (disable_plugin($p)) { elgg_delete_admin_notice('first_installation_plugin_reminder'); system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p)); @@ -23,6 +22,7 @@ foreach ($plugins as $p => $data) { } } +// need to reset caches for new view locations and cached view output. elgg_view_regenerate_simplecache(); elgg_filepath_cache_reset(); diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php index 053fbc556..0510fafa8 100644 --- a/actions/admin/plugins/enable.php +++ b/actions/admin/plugins/enable.php @@ -1,14 +1,16 @@ $data) { - // Enable if (enable_plugin($p)) { elgg_delete_admin_notice('first_installation_plugin_reminder'); system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p)); @@ -23,7 +22,7 @@ foreach ($plugins as $p => $data) { } } -// Regen view cache +// need to reset caches for new view locations and cached view output. elgg_view_regenerate_simplecache(); elgg_filepath_cache_reset(); diff --git a/actions/admin/plugins/reorder.php b/actions/admin/plugins/reorder.php index 6423dc14c..e3f5c4a0a 100644 --- a/actions/admin/plugins/reorder.php +++ b/actions/admin/plugins/reorder.php @@ -1,17 +1,21 @@ = 1.8) plugins + * LOWER on the page have HIGHER priority and will override views, etc + * from plugins above them. + * + * @package Elgg.Core + * @subpackage Administration.Site */ -// block non-admin users admin_gatekeeper(); -// Get the plugin $mod = get_input('plugin'); $mod = str_replace('.', '', $mod); $mod = str_replace('/', '', $mod); @@ -44,4 +48,4 @@ if (regenerate_plugin_list($plugins)) { elgg_view_regenerate_simplecache(); elgg_filepath_cache_reset(); -forward($_SERVER['HTTP_REFERER']); +forward($_SERVER['HTTP_REFERER']); \ No newline at end of file diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php index 197f183f9..1945868f2 100644 --- a/actions/admin/plugins/simple_update_states.php +++ b/actions/admin/plugins/simple_update_states.php @@ -1,13 +1,19 @@ getGUID()); } - + // allow new user registration? if (get_input('allow_registration', FALSE)) { set_config('allow_registration', TRUE, $site->getGUID()); } else { set_config('allow_registration', FALSE, $site->getGUID()); } - + // setup walled garden if (get_input('walled_garden', FALSE)) { set_config('walled_garden', TRUE, $site->getGUID()); diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php index 5914ab0b5..dd3e08301 100644 --- a/actions/admin/site/update_basic.php +++ b/actions/admin/site/update_basic.php @@ -1,14 +1,13 @@ save(); set_config('language', get_input('language'), $site->getGUID()); +} - forward($_SERVER['HTTP_REFERER']); - exit; -} \ No newline at end of file +forward($_SERVER['HTTP_REFERER']); \ No newline at end of file diff --git a/actions/admin/user/ban.php b/actions/admin/user/ban.php index 1a5d9e4a9..6622673e6 100644 --- a/actions/admin/user/ban.php +++ b/actions/admin/user/ban.php @@ -1,23 +1,20 @@ canEdit())) { - // Now actually disable it if ($obj->ban('banned')) { system_message(elgg_echo('admin:user:ban:yes')); } else { @@ -27,5 +24,4 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) { register_error(elgg_echo('admin:user:ban:no')); } -forward('pg/admin/user/'); -exit; +forward('pg/admin/user/'); \ No newline at end of file diff --git a/actions/admin/user/delete.php b/actions/admin/user/delete.php index 61dbc7e10..375f8b809 100644 --- a/actions/admin/user/delete.php +++ b/actions/admin/user/delete.php @@ -1,15 +1,16 @@ =1.7.1, admin is flagged by setting the admin + * column in the users_entity table. + * + * In <1.7.1, admin is a piece of metadata on the user object. + * + * @package Elgg.Core + * @subpackage Administration.User */ -global $CONFIG; - -// block non-admin users admin_gatekeeper(); -// Get the user $guid = get_input('guid'); $user = get_entity($guid); diff --git a/actions/admin/user/removeadmin.php b/actions/admin/user/removeadmin.php index b5872e592..9e8c55ac9 100644 --- a/actions/admin/user/removeadmin.php +++ b/actions/admin/user/removeadmin.php @@ -1,19 +1,13 @@ canEdit())) { $password = generate_random_cleartext_password(); - $obj->salt = generate_random_cleartext_password(); // Reset the salt + // Always reset the salt before generating the user password. + $obj->salt = generate_random_cleartext_password(); $obj->password = generate_user_password($obj, $password); if ($obj->save()) { @@ -39,5 +42,4 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) { register_error(elgg_echo('admin:user:resetpassword:no')); } -forward($_SERVER['HTTP_REFERER']); -exit; +forward($_SERVER['HTTP_REFERER']); \ No newline at end of file diff --git a/actions/admin/user/unban.php b/actions/admin/user/unban.php index 6e04c8114..2bc609b5c 100644 --- a/actions/admin/user/unban.php +++ b/actions/admin/user/unban.php @@ -1,26 +1,20 @@ canEdit())) { - // Now actually disable it if ($obj->unban()) { system_message(elgg_echo('admin:user:unban:yes')); } else { @@ -33,4 +27,3 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) { access_show_hidden_entities($access_status); forward($_SERVER['HTTP_REFERER']); -exit; -- cgit v1.2.3