diff options
| -rw-r--r-- | actions/admin/plugins/disable.php | 17 | ||||
| -rw-r--r-- | actions/admin/plugins/disableall.php | 14 | ||||
| -rw-r--r-- | actions/admin/plugins/enable.php | 16 | ||||
| -rw-r--r-- | actions/admin/plugins/enableall.php | 15 | ||||
| -rw-r--r-- | actions/admin/plugins/reorder.php | 20 | ||||
| -rw-r--r-- | actions/admin/plugins/simple_update_states.php | 22 | ||||
| -rw-r--r-- | actions/admin/site/update_advanced.php | 16 | ||||
| -rw-r--r-- | actions/admin/site/update_basic.php | 18 | ||||
| -rw-r--r-- | actions/admin/user/ban.php | 18 | ||||
| -rw-r--r-- | actions/admin/user/delete.php | 13 | ||||
| -rw-r--r-- | actions/admin/user/makeadmin.php | 17 | ||||
| -rw-r--r-- | actions/admin/user/removeadmin.php | 12 | ||||
| -rw-r--r-- | actions/admin/user/resetpassword.php | 26 | ||||
| -rw-r--r-- | 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 @@  <?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(); diff --git a/actions/admin/plugins/disableall.php b/actions/admin/plugins/disableall.php index 80553e9d1..8cba6252a 100644 --- a/actions/admin/plugins/disableall.php +++ b/actions/admin/plugins/disableall.php @@ -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(); 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 @@  <?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(); diff --git a/actions/admin/plugins/enableall.php b/actions/admin/plugins/enableall.php index d1758a4b3..f3325d2a6 100644 --- a/actions/admin/plugins/enableall.php +++ b/actions/admin/plugins/enableall.php @@ -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(); 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 @@  <?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 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 @@  <?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 diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php index e65919ce1..10a186bd1 100644 --- a/actions/admin/site/update_advanced.php +++ b/actions/admin/site/update_advanced.php @@ -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()); 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 @@  <?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 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 @@  <?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 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 @@  <?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 diff --git a/actions/admin/user/makeadmin.php b/actions/admin/user/makeadmin.php index dc5c508fb..f8a426a41 100644 --- a/actions/admin/user/makeadmin.php +++ b/actions/admin/user/makeadmin.php @@ -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); 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 @@  <?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); diff --git a/actions/admin/user/resetpassword.php b/actions/admin/user/resetpassword.php index aead052dd..c70410201 100644 --- a/actions/admin/user/resetpassword.php +++ b/actions/admin/user/resetpassword.php @@ -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 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 @@  <?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; | 
