aboutsummaryrefslogtreecommitdiff
path: root/actions/admin
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin')
-rw-r--r--actions/admin/plugins/disable.php2
-rw-r--r--actions/admin/plugins/disableall.php2
-rw-r--r--actions/admin/plugins/enable.php6
-rw-r--r--actions/admin/plugins/enableall.php4
-rw-r--r--actions/admin/plugins/reorder.php5
-rw-r--r--actions/admin/plugins/simple_update_states.php41
-rw-r--r--actions/admin/site/update_advanced.php74
-rw-r--r--actions/admin/site/update_basic.php88
8 files changed, 138 insertions, 84 deletions
diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php
index d5042e2bf..ac80d46e3 100644
--- a/actions/admin/plugins/disable.php
+++ b/actions/admin/plugins/disable.php
@@ -21,6 +21,7 @@ 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');
} else {
register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
}
@@ -30,4 +31,3 @@ elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
forward($_SERVER['HTTP_REFERER']);
-exit;
diff --git a/actions/admin/plugins/disableall.php b/actions/admin/plugins/disableall.php
index 70a945ee4..80553e9d1 100644
--- a/actions/admin/plugins/disableall.php
+++ b/actions/admin/plugins/disableall.php
@@ -16,6 +16,7 @@ $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));
} else {
register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
@@ -26,4 +27,3 @@ elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
forward($_SERVER['HTTP_REFERER']);
-exit;
diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php
index b5286336b..053fbc556 100644
--- a/actions/admin/plugins/enable.php
+++ b/actions/admin/plugins/enable.php
@@ -11,8 +11,8 @@
// block non-admin users
admin_gatekeeper();
-// Get the plugin
$plugin = get_input('plugin');
+
if (!is_array($plugin)) {
$plugin = array($plugin);
}
@@ -20,6 +20,7 @@ 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));
} else {
register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
@@ -29,5 +30,4 @@ foreach ($plugin as $p) {
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
-exit;
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/actions/admin/plugins/enableall.php b/actions/admin/plugins/enableall.php
index ea4b48f95..d1758a4b3 100644
--- a/actions/admin/plugins/enableall.php
+++ b/actions/admin/plugins/enableall.php
@@ -16,6 +16,7 @@ $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));
} else {
register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
@@ -26,5 +27,4 @@ foreach ($plugins as $p => $data) {
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
-exit;
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/actions/admin/plugins/reorder.php b/actions/admin/plugins/reorder.php
index 6050a585f..6423dc14c 100644
--- a/actions/admin/plugins/reorder.php
+++ b/actions/admin/plugins/reorder.php
@@ -13,8 +13,8 @@ admin_gatekeeper();
// Get the plugin
$mod = get_input('plugin');
-$mod = str_replace('.','',$mod);
-$mod = str_replace('/','',$mod);
+$mod = str_replace('.', '', $mod);
+$mod = str_replace('/', '', $mod);
// Get the new order
$order = (int) get_input('order');
@@ -35,6 +35,7 @@ if ($key = array_search($mod, $plugins)) {
// Disable
if (regenerate_plugin_list($plugins)) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
system_message(sprintf(elgg_echo('admin:plugins:reorder:yes'), $plugin));
} else {
register_error(sprintf(elgg_echo('admin:plugins:reorder:no'), $plugin));
diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php
new file mode 100644
index 000000000..197f183f9
--- /dev/null
+++ b/actions/admin/plugins/simple_update_states.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Elgg administration simple plugin bulk enable / disable
+ *
+ * Shows an alphabetical list of "simple" plugins.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$installed_plugins = get_installed_plugins();
+$enabled_plugins = get_input('enabled_plugins', array());
+
+$success = TRUE;
+
+foreach ($installed_plugins as $plugin => $info) {
+ // this is only for simple plugins.
+ if (!isset($info['manifest']['admin_interface']) || $info['manifest']['admin_interface'] != 'simple') {
+ continue;
+ }
+
+ $plugin_enabled = is_plugin_enabled($plugin);
+
+ // only effect changes to plugins not already in that state.
+ if ($plugin_enabled && !in_array($plugin, $enabled_plugins)) {
+ $success = $success && disable_plugin($plugin);
+ } elseif (!$plugin_enabled && in_array($plugin, $enabled_plugins)) {
+ $success = $success && enable_plugin($plugin);
+ }
+}
+
+if ($success) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
+ system_message(elgg_echo('admin:plugins:simple_simple_success'));
+} else {
+ register_error(elgg_echo('admins:plugins:simple_simple_fail'));
+}
+
+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
new file mode 100644
index 000000000..c9b78c261
--- /dev/null
+++ b/actions/admin/site/update_advanced.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Elgg update site action
+ *
+ * This is an update version of the sitesettings/install action
+ * which is used by the admin panel to modify basic settings.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+admin_gatekeeper();
+
+if (datalist_get('default_site')) {
+ $site = get_entity(datalist_get('default_site'));
+ if (!($site instanceof ElggSite)) {
+ throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
+ }
+
+ $site->url = get_input('wwwroot');
+
+ datalist_set('path', sanitise_filepath(get_input('path')));
+ datalist_set('dataroot', sanitise_filepath(get_input('dataroot')));
+
+ if (get_input('simplecache_enabled')) {
+ elgg_view_enable_simplecache();
+ } else {
+ elgg_view_disable_simplecache();
+ }
+
+ if (get_input('viewpath_cache_enabled')) {
+ elgg_enable_filepath_cache();
+ } else {
+ elgg_disable_filepath_cache();
+ }
+
+ set_config('default_access', get_input('default_access', ACCESS_PRIVATE), $site->getGUID());
+
+ $user_default_access = (get_input('allow_user_default_access')) ? 1 : 0;
+ set_config('allow_user_default_access', $user_default_access, $site->getGUID());
+
+ set_config('view', get_input('view'), $site->getGUID());
+
+ $debug = get_input('debug');
+ if ($debug) {
+ set_config('debug', $debug, $site->getGUID());
+ } else {
+ unset_config('debug', $site->getGUID());
+ }
+
+ $https_login = get_input('https_login');
+ if ($https_login) {
+ set_config('https_login', 1, $site->getGUID());
+ } else {
+ unset_config('https_login', $site->getGUID());
+ }
+
+ $api = get_input('api');
+ if ($api) {
+ unset_config('disable_api', $site->getGUID());
+ } else {
+ set_config('disable_api', 'disabled', $site->getGUID());
+ }
+
+ if ($site->save()) {
+ system_message(elgg_echo("admin:configuration:success"));
+ } else {
+ register_error(elgg_echo("admin:configuration:fail"));
+ }
+
+ forward($_SERVER['HTTP_REFERER']);
+} \ No newline at end of file
diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php
index d9fa8f367..5914ab0b5 100644
--- a/actions/admin/site/update_basic.php
+++ b/actions/admin/site/update_basic.php
@@ -11,83 +11,21 @@
* @link http://elgg.org/
*/
-global $CONFIG;
-
-// block non-admin users
admin_gatekeeper();
-if (get_input('settings') == 'go') {
- if (datalist_get('default_site')) {
- $site = get_entity(datalist_get('default_site'));
- if (!($site instanceof ElggSite)) {
- throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
- }
-
- $site->description = get_input('sitedescription');
- $site->name = get_input('sitename');
- $site->email = get_input('siteemail');
- $site->url = get_input('wwwroot');
-
- datalist_set('path',sanitise_filepath(get_input('path')));
- datalist_set('dataroot',sanitise_filepath(get_input('dataroot')));
- if (get_input('simplecache_enabled')) {
- elgg_view_enable_simplecache();
- } else {
- elgg_view_disable_simplecache();
- }
- if (get_input('viewpath_cache_enabled')) {
- elgg_enable_filepath_cache();
- } else {
- elgg_disable_filepath_cache();
- }
-
- set_config('language', get_input('language'), $site->getGUID());
-
- set_config('default_access', get_input('default_access'), $site->getGUID());
-
- if (get_input('allow_user_default_access')) {
- set_config('allow_user_default_access', 1, $site->getGUID());
- } else {
- set_config('allow_user_default_access', 0, $site->getGUID());
- }
-
- set_config('view', get_input('view'), $site->getGUID());
-
- $debug = get_input('debug');
- if ($debug) {
- set_config('debug', $debug, $site->getGUID());
- } else {
- unset_config('debug', $site->getGUID());
- }
-
- $https_login = get_input('https_login');
- if ($https_login) {
- set_config('https_login', 1, $site->getGUID());
- } else {
- unset_config('https_login', $site->getGUID());
- }
-
- $usage = get_input('usage');
- if ($usage) {
- unset_config('ping_home', $site->getGUID());
- } else {
- set_config('ping_home', 'disabled', $site->getGUID());
- }
+if (datalist_get('default_site')) {
+ $site = get_entity(datalist_get('default_site'));
+ if (!($site instanceof ElggSite)) {
+ throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
+ }
- $api = get_input('api');
- if ($api) {
- unset_config('disable_api', $site->getGUID());
- } else {
- set_config('disable_api', 'disabled', $site->getGUID());
- }
+ $site->description = get_input('sitedescription');
+ $site->name = get_input('sitename');
+ $site->email = get_input('siteemail');
+ $site->save();
- if ($site->save()) {
- system_message(elgg_echo("admin:configuration:success"));
- } else {
- register_error(elgg_echo("admin:configuration:fail"));
- }
+ set_config('language', get_input('language'), $site->getGUID());
- forward($_SERVER['HTTP_REFERER']);
- exit;
- }
-}
+ forward($_SERVER['HTTP_REFERER']);
+ exit;
+} \ No newline at end of file