]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2450: Updated docs for core admin actions.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 13 Sep 2010 15:31:24 +0000 (15:31 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 13 Sep 2010 15:31:24 +0000 (15:31 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6929 36083f99-b078-4883-b0ff-0f9b5a30f544

14 files changed:
actions/admin/plugins/disable.php
actions/admin/plugins/disableall.php
actions/admin/plugins/enable.php
actions/admin/plugins/enableall.php
actions/admin/plugins/reorder.php
actions/admin/plugins/simple_update_states.php
actions/admin/site/update_advanced.php
actions/admin/site/update_basic.php
actions/admin/user/ban.php
actions/admin/user/delete.php
actions/admin/user/makeadmin.php
actions/admin/user/removeadmin.php
actions/admin/user/resetpassword.php
actions/admin/user/unban.php

index ac80d46e39dfe966e906bfa628917418f66f2e40..3207e6800732b1d03e0768a978a23ce728809c84 100644 (file)
@@ -1,24 +1,24 @@
 <?php
 /**
- * Disable plugin action.
+ * Disable a plugin or plugins.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugins to be disabled are passed via $_REQUEST['plugin'] as plugin ID (directory name).
+ * After disabling the plugin(s), the views cache and simplecache are both reset.
+ *
+ * @uses mixed $_GET['plugin'] The id (directory name) of the plugin to disable. Can be an array.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
-// block non-admin users
 admin_gatekeeper();
 
-// Get the plugin
 $plugin = get_input('plugin');
 if (!is_array($plugin)) {
        $plugin = array($plugin);
 }
 
 foreach ($plugin as $p) {
-       // Disable
        if (disable_plugin($p)) {
                system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p));
                elgg_delete_admin_notice('first_installation_plugin_reminder');
@@ -27,6 +27,7 @@ foreach ($plugin as $p) {
        }
 }
 
+// need to reset caches for new view locations and cached view output.
 elgg_view_regenerate_simplecache();
 elgg_filepath_cache_reset();
 
index 80553e9d1af2c7cd1f1c979af6ad40c882e0b99d..8cba6252afbe849fa59909c3cb34a9cd16a8d1ee 100644 (file)
@@ -1,20 +1,19 @@
 <?php
 /**
- * Disable plugin action.
+ * Disable all installed plugins.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * All plugins in the mod/ directory are disabled and the views cache and simplecache
+ * are reset.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
-// block non-admin users
 admin_gatekeeper();
 
 $plugins = get_installed_plugins();
 
 foreach ($plugins as $p => $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();
 
index 053fbc556d64ddd6dc5eb01bbcaf2446ccabe343..0510fafa8cd8595f169e611d102299ea992da09e 100644 (file)
@@ -1,14 +1,16 @@
 <?php
 /**
- * Enable plugin action.
+ * Enables a plugin or plugins.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugins to be enabled are passed via $_REQUEST['plugin'] as plugin ID (directory name).
+ * After enabling the plugin(s), the views cache and simplecache are reset.
+ *
+ * @uses mixed $_GET['plugin'] The id (directory name) of the plugin to enable. Can be an array.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
-// block non-admin users
 admin_gatekeeper();
 
 $plugin = get_input('plugin');
@@ -18,7 +20,6 @@ if (!is_array($plugin)) {
 }
 
 foreach ($plugin as $p) {
-       // Disable
        if (enable_plugin($p)) {
                elgg_delete_admin_notice('first_installation_plugin_reminder');
                system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p));
@@ -27,6 +28,7 @@ foreach ($plugin as $p) {
        }
 }
 
+// need to reset caches for new view locations and cached view output.
 elgg_view_regenerate_simplecache();
 elgg_filepath_cache_reset();
 
index d1758a4b3e7bc80b3a9e25c39c0b7927be70d118..f3325d2a6806929ae52bcec894108616f267809e 100644 (file)
@@ -1,20 +1,19 @@
 <?php
 /**
- * Enable plugin action.
+ * Enables all installed plugins.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * All plugins in the mod/ directory are enabled and the views cache and simplecache
+ * are reset.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
-// block non-admin users
 admin_gatekeeper();
 
 $plugins = get_installed_plugins();
 
 foreach ($plugins as $p => $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();
 
index 6423dc14c5b20ac703654f33f123068443d4a85e..e3f5c4a0add0f69a32752e8832fbf4cc8af6e783 100644 (file)
@@ -1,17 +1,21 @@
 <?php
 /**
- * Reorder plugin action.
+ * Changes the load order of a plugin.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugin order affects priority for view, action, and page handler
+ * overriding as well as the order of view extensions.  Higher numbers
+ * are loaded after lower numbers, and so receive higher priority.
+ *
+ * NOTE: When viewing the admin page (advanced plugin admin in >= 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
index 197f183f93855a83c8f4e480ed5c870bb49c5553..1945868f244a0cf7b215ee675353e8ef6b7b0f6c 100644 (file)
@@ -1,13 +1,19 @@
 <?php
 /**
- * Elgg administration simple plugin bulk enable / disable
+ * Bulk enable and disable for plugins appearing in the "simple" interface.
  *
- * Shows an alphabetical list of "simple" plugins.
+ * Plugins marked as using the "simple" interface can be enabled and disabled
+ * en masse by passing the enabled plugins as an array of their plugin ids
+ * (directory names) through $_REQUEST['enabled_plugins'].  All "simple" plugins
+ * not in this array will be disabled.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Simplecache and views cache are reset.
+ *
+ * @uses array $_REQUEST['enabled_plugins'] An array of plugin ids (directory names) to enable.
+ *
+ * @since 1.8
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
 $installed_plugins = get_installed_plugins();
@@ -38,4 +44,8 @@ if ($success) {
        register_error(elgg_echo('admins:plugins:simple_simple_fail'));
 }
 
+// need to reset caches for new view locations and cached view output.
+elgg_view_regenerate_simplecache();
+elgg_filepath_cache_reset();
+
 forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file
index e65919ce1f7a14afb7bb89783c91e6b6a137054c..10a186bd142efc49c6c44a2f93ad7f04b619845c 100644 (file)
@@ -1,14 +1,12 @@
 <?php
 /**
- * Elgg update site action
+ * Updates the advanced settings for the primary site object.
  *
- * This is an update version of the sitesettings/install action
- * which is used by the admin panel to modify basic settings.
+ * Options are saved among metadata on the site object, entries
+ * in the datalist table, and entries in the config table.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
 admin_gatekeeper();
@@ -49,14 +47,14 @@ if (datalist_get('default_site')) {
        } else {
                unset_config('debug', $site->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());
index 5914ab0b543a84b89672b8f11c3987a023bd91c7..dd3e083010016d8b06d0bdad091c0cbca524f8c1 100644 (file)
@@ -1,14 +1,13 @@
 <?php
 /**
- * Elgg update site action
+ * Updates the basic settings for the primary site object.
  *
- * This is an update version of the sitesettings/install action
- * which is used by the admin panel to modify basic settings.
+ * Basic site settings are saved as metadata on the site object,
+ * with the exception of the default language, which is saved in
+ * the config table.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * @package Elgg.Core
+ * @subpackage Administration.Site
  */
 
 admin_gatekeeper();
@@ -25,7 +24,6 @@ if (datalist_get('default_site')) {
        $site->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
index 1a5d9e4a9d11d9b4d39183d9669a74409e8e88ac..6622673e64ea07c502ba2c5b7f600fe3a0112adf 100644 (file)
@@ -1,23 +1,20 @@
 <?php
 /**
- * Elgg ban user
+ * Bans a user.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * User entities are banned by setting the 'banned' column
+ * to 'yes' in the users_entity table.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.User
  */
 
-
-// block non-admin users
 admin_gatekeeper();
 
-// Get the user
 $guid = get_input('guid');
 $obj = get_entity($guid);
 
 if (($obj instanceof ElggUser) && ($obj->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
index 61dbc7e10153b707e36a4afadd503f3219a2ad7d..375f8b80995a853992416e2c3218040d142bca32 100644 (file)
@@ -1,15 +1,16 @@
 <?php
 /**
- * Elgg delete user
+ * Delete a user.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * The user will be deleted recursively, meaning all entities
+ * owned or contained by the user will also be removed.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.User
  */
 
-
 // block non-admin users - require since this action is not registered
+// @todo why isn't this action registered?
 admin_gatekeeper();
 
 // Get the user
index dc5c508fb04869a779c3f0520fe6513e480061df..f8a426a41b168b555d7cc47d7c44f24aebb3fc21 100644 (file)
@@ -1,19 +1,18 @@
 <?php
 /**
- * Make another user an admin.
+ * Grants admin privileges to a user.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * In >=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);
 
index b5872e592f2e3265cf328bb519caf47da9ae8df1..9e8c55ac9e2509dc747eb0cca4a80e701072c3c5 100644 (file)
@@ -1,19 +1,13 @@
 <?php
 /**
- * Make another user an admin.
+ * Revokes admin privileges from a user.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * @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);
 
index aead052dd1cf592ed1cb58d0a1c9d16a80e8a95c..c704102015d88448d0e3b7e20961a947e8843e72 100644 (file)
@@ -1,26 +1,29 @@
 <?php
 /**
- * Admin password reset.
+ * Reset a user's password.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * This is an admin action that generates a new salt and password
+ * for a user, then emails the password to the user's registered
+ * email address.
+ *
+ * NOTE: This is different to the "reset password" link users
+ * can use in that it does not first email the user asking if
+ * they want to have their password reset.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.User
  */
 
-global $CONFIG;
-
-// block non-admin users
 admin_gatekeeper();
 
-// Get the user
 $guid = get_input('guid');
 $obj = get_entity($guid);
 
 if (($obj instanceof ElggUser) && ($obj->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
index 6e04c811435c5608581713ae0e00a6e8576bf545..2bc609b5c9cbd104195b7b58607db7917ca2979e 100644 (file)
@@ -1,26 +1,20 @@
 <?php
 /**
- * Elgg ban user
+ * Unbans a user.
  *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * @package Elgg.Core
+ * @subpackage Administration.User
  */
 
-
-// block non-admin users
 admin_gatekeeper();
 
 $access_status = access_get_show_hidden_status();
 access_show_hidden_entities(true);
 
-// Get the user
 $guid = get_input('guid');
 $obj = get_entity($guid);
 
 if (($obj instanceof ElggUser) && ($obj->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;