aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php14
-rw-r--r--phpBB/includes/acp/acp_bots.php10
-rw-r--r--phpBB/includes/acp/acp_forums.php8
-rw-r--r--phpBB/includes/acp/acp_icons.php12
-rw-r--r--phpBB/includes/acp/acp_main.php43
-rw-r--r--phpBB/includes/acp/acp_modules.php11
-rw-r--r--phpBB/includes/acp/acp_profile.php18
-rw-r--r--phpBB/includes/acp/acp_ranks.php14
8 files changed, 118 insertions, 12 deletions
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index a3822a982a..e537d7a8b9 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -24,7 +24,7 @@ class acp_bbcodes
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
@@ -272,6 +272,18 @@ class acp_bbcodes
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['BBCODE_DELETED'],
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index f080b3c9fb..b9dd6664f4 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -24,7 +24,7 @@ class acp_bots
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
+ global $config, $db, $user, $auth, $template, $cache, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
@@ -352,6 +352,14 @@ class acp_bots
break;
}
+
+ if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate'))
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'text' => $user->lang['BOT_' . (($action == 'activate') ? 'DE' : '') . 'ACTIVATE'],
+ ));
+ }
$s_options = '';
$_options = array('activate' => 'BOT_ACTIVATE', 'deactivate' => 'BOT_DEACTIVATE', 'delete' => 'DELETE');
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index fad22fc285..3a3b2021eb 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -25,7 +25,7 @@ class acp_forums
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang('acp/forums');
@@ -255,6 +255,12 @@ class acp_forums
add_log('admin', 'LOG_FORUM_' . strtoupper($action), $row['forum_name'], $move_forum_name);
$cache->destroy('sql', FORUMS_TABLE);
}
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array('success' => ($move_forum_name !== false)));
+ }
break;
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 49a092f16b..bfe17c5007 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -782,6 +782,18 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $notice,
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 88c29702d4..144b225766 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -24,7 +24,7 @@ class acp_main
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template;
+ global $config, $db, $user, $auth, $template, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Show restore permissions notice
@@ -129,6 +129,11 @@ class acp_main
set_config('record_online_users', 1, true);
set_config('record_online_date', time(), true);
add_log('admin', 'LOG_RESET_ONLINE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESET_ONLINE_SUCCESS');
+ }
break;
case 'stats':
@@ -179,6 +184,11 @@ class acp_main
update_last_username();
add_log('admin', 'LOG_RESYNC_STATS');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESYNC_STATS_SUCCESS');
+ }
break;
case 'user':
@@ -241,7 +251,11 @@ class acp_main
}
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
-
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESYNC_POSTCOUNTS_SUCCESS');
+ }
break;
case 'date':
@@ -252,6 +266,11 @@ class acp_main
set_config('board_startdate', time() - 1);
add_log('admin', 'LOG_RESET_DATE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESET_DATE_SUCCESS');
+ }
break;
case 'db_track':
@@ -327,14 +346,14 @@ class acp_main
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
- break;
-
- case 'purge_cache':
- if ((int) $user->data['user_type'] !== USER_FOUNDER)
+
+ if ($request->is_ajax())
{
- trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error('RESYNC_POST_MARKING_SUCCESS');
}
+ break;
+ case 'purge_cache':
global $cache;
$cache->purge();
@@ -343,6 +362,11 @@ class acp_main
cache_moderators();
add_log('admin', 'LOG_PURGE_CACHE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('PURGE_CACHE_SUCCESS');
+ }
break;
case 'purge_sessions':
@@ -389,6 +413,11 @@ class acp_main
$db->sql_query($sql);
add_log('admin', 'LOG_PURGE_SESSIONS');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('PURGE_SESSIONS_SUCCESS');
+ }
break;
}
}
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 9d87bbbfbb..8528dc91c4 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -36,7 +36,7 @@ class acp_modules
function main($id, $mode)
{
- global $db, $user, $auth, $template, $module;
+ global $db, $user, $auth, $template, $module, $request;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
@@ -373,6 +373,15 @@ class acp_modules
// Default management page
if (sizeof($errors))
{
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang('ERROR'),
+ 'MESSAGE_TEXT' => implode('<br />', $errors),
+ ));
+ }
+
$template->assign_vars(array(
'S_ERROR' => true,
'ERROR_MSG' => implode('<br />', $errors))
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 511148baf9..3ffffd3047 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -242,6 +242,15 @@ class acp_profile
$db->sql_freeresult($result);
add_log('admin', 'LOG_PROFILE_FIELD_ACTIVATE', $field_ident);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('DEACTIVATE'),
+ ));
+ }
+
trigger_error($user->lang['PROFILE_FIELD_ACTIVATED'] . adm_back_link($this->u_action));
break;
@@ -266,7 +275,16 @@ class acp_profile
$field_ident = (string) $db->sql_fetchfield('field_ident');
$db->sql_freeresult($result);
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('ACTIVATE'),
+ ));
+ }
+
add_log('admin', 'LOG_PROFILE_FIELD_DEACTIVATE', $field_ident);
+
trigger_error($user->lang['PROFILE_FIELD_DEACTIVATED'] . adm_back_link($this->u_action));
break;
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index ec5a76df87..d9ed5b17f1 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -24,7 +24,7 @@ class acp_ranks
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
@@ -122,6 +122,18 @@ class acp_ranks
$cache->destroy('_ranks');
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['RANK_REMOVED'],
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{