本文整理汇总了PHP中phpbb_cache_moderators函数的典型用法代码示例。如果您正苦于以下问题:PHP phpbb_cache_moderators函数的具体用法?PHP phpbb_cache_moderators怎么用?PHP phpbb_cache_moderators使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpbb_cache_moderators函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Executes the command cache:purge.
*
* Purge the cache (including permissions) and increment the asset_version number
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return null
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
$this->auth->acl_clear_prefetch();
phpbb_cache_moderators($this->db, $this->cache, $this->auth);
$this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array());
$output->writeln($this->user->lang('PURGE_CACHE_SUCCESS'));
}
示例2: add
public function add(&$forum_data, $forum_perm_from = 0)
{
$forum_data += array('parent_id' => $this->config['sitemaker_parent_forum_id'], 'forum_type' => FORUM_POST, 'type_action' => '', 'forum_status' => ITEM_UNLOCKED, 'forum_parents' => '', 'forum_name' => '', 'forum_link' => '', 'forum_link_track' => false, 'forum_desc' => '', 'forum_desc_uid' => '', 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', 'forum_rules' => '', 'forum_rules_uid' => '', 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', 'forum_rules_link' => '', 'forum_image' => '', 'forum_style' => 0, 'display_subforum_list' => false, 'display_on_index' => false, 'forum_topics_per_page' => 0, 'enable_indexing' => true, 'enable_icons' => false, 'enable_prune' => false, 'enable_post_review' => true, 'enable_quick_reply' => false, 'prune_days' => 7, 'prune_viewed' => 7, 'prune_freq' => 1, 'prune_old_polls' => false, 'prune_announce' => false, 'prune_sticky' => false, 'show_active' => false, 'forum_password' => '', 'forum_password_confirm' => '', 'forum_password_unset' => false);
$errors = $this->forum->update_forum_data($forum_data);
if (!sizeof($errors)) {
$forum_data['forum_id'] = (int) $forum_data['forum_id'];
// Copy permissions?
if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id']) {
copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], false, false);
phpbb_cache_moderators($this->db, $this->cache, $this->auth);
}
$this->auth->acl_clear_prefetch();
$this->cache->destroy('sql', FORUMS_TABLE);
}
return $errors;
}
示例3: add
public function add(array &$forum_data, $forum_perm_from = 0)
{
$forum_data += array('parent_id' => $this->config['sitemaker_parent_forum_id']);
$errors = admin::save($forum_data);
if (!sizeof($errors)) {
$forum_data['forum_id'] = (int) $forum_data['forum_id'];
// Copy permissions?
if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id']) {
copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], false, false);
phpbb_cache_moderators($this->db, $this->cache, $this->auth);
}
$this->auth->acl_clear_prefetch();
$this->cache->destroy('sql', FORUMS_TABLE);
}
return $errors;
}
示例4: main
//.........这里部分代码省略.........
AND p.poster_id <> ' . ANONYMOUS . '
GROUP BY p.poster_id, p.topic_id';
$result = $db->sql_query($sql);
$posted = array();
while ($row = $db->sql_fetchrow($result)) {
$posted[$row['poster_id']][] = $row['topic_id'];
}
$db->sql_freeresult($result);
$sql_ary = array();
foreach ($posted as $user_id => $topic_row) {
foreach ($topic_row as $topic_id) {
$sql_ary[] = array('user_id' => (int) $user_id, 'topic_id' => (int) $topic_id, 'topic_posted' => 1);
}
}
unset($posted);
if (sizeof($sql_ary)) {
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
}
}
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POST_MARKING');
if ($request->is_ajax()) {
trigger_error('RESYNC_POST_MARKING_SUCCESS');
}
break;
case 'purge_cache':
$config->increment('assets_version', 1);
$cache->purge();
// Remove old renderers from the text_formatter service. Since this
// operation is performed after the cache is purged, there is not "current"
// renderer and in effect all renderers will be purged
$phpbb_container->get('text_formatter.cache')->tidy();
// Clear permissions
$auth->acl_clear_prefetch();
phpbb_cache_moderators($db, $cache, $auth);
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_CACHE');
if ($request->is_ajax()) {
trigger_error('PURGE_CACHE_SUCCESS');
}
break;
case 'purge_sessions':
if ((int) $user->data['user_type'] !== USER_FOUNDER) {
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$tables = array(CONFIRM_TABLE, SESSIONS_TABLE);
foreach ($tables as $table) {
switch ($db->get_sql_layer()) {
case 'sqlite':
case 'sqlite3':
$db->sql_query("DELETE FROM {$table}");
break;
default:
$db->sql_query("TRUNCATE TABLE {$table}");
break;
}
}
// let's restore the admin session
$reinsert_ary = array('session_id' => (string) $user->session_id, 'session_page' => (string) substr($user->page['page'], 0, 199), 'session_forum_id' => $user->page['forum'], 'session_user_id' => (int) $user->data['user_id'], 'session_start' => (int) $user->data['session_start'], 'session_last_visit' => (int) $user->data['session_last_visit'], 'session_time' => (int) $user->time_now, 'session_browser' => (string) trim(substr($user->browser, 0, 149)), 'session_forwarded_for' => (string) $user->forwarded_for, 'session_ip' => (string) $user->ip, 'session_autologin' => (int) $user->data['session_autologin'], 'session_admin' => 1, 'session_viewonline' => (int) $user->data['session_viewonline']);
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
$db->sql_query($sql);
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_SESSIONS');
if ($request->is_ajax()) {
trigger_error('PURGE_SESSIONS_SUCCESS');
}
break;
}
}
示例5: copy_forum_permissions
/**
* Handles copying permissions from one forum to others
*/
function copy_forum_permissions()
{
global $db, $auth, $cache, $template, $user, $request;
$user->add_lang('acp/forums');
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
$src = $request->variable('src_forum_id', 0);
$dest = $request->variable('dest_forum_ids', array(0));
if (confirm_box(true)) {
if (copy_forum_permissions($src, $dest)) {
phpbb_cache_moderators($db, $cache, $auth);
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
} else {
trigger_error($user->lang['SELECTED_FORUM_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
} else {
$s_hidden_fields = array('submit' => $submit, 'src_forum_id' => $src, 'dest_forum_ids' => $dest);
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
confirm_box(false, $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields);
}
}
$template->assign_vars(array('S_FORUM_OPTIONS' => make_forum_select(false, false, false, false, false)));
}
示例6: finish_conversion
/**
* Finish conversion, the last function to be called.
*/
function finish_conversion()
{
global $db, $phpbb_root_path, $phpEx, $convert, $config, $language, $user, $template;
global $cache, $auth, $phpbb_container, $phpbb_log;
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "\n\t\t\tWHERE config_name = 'convert_progress'\n\t\t\t\tOR config_name = 'convert_options'\n\t\t\t\tOR config_name = 'convert_db_server'\n\t\t\t\tOR config_name = 'convert_db_user'");
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
@unlink($phpbb_root_path . 'cache/data_global.' . $phpEx);
phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));
$url = $this->p_master->module_url . "?mode={$this->mode}&sub=final&language={$language}";
$template->assign_vars(array('L_SUBMIT' => $user->lang['FINAL_STEP'], 'U_ACTION' => $url));
$this->meta_refresh($url);
return;
}
示例7: group_update_listings
/**
* Re-cache moderators and foes if group has a_ or m_ permissions
*/
function group_update_listings($group_id)
{
global $db, $cache, $auth;
$hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_'));
if (!sizeof($hold_ary)) {
return;
}
$mod_permissions = $admin_permissions = false;
foreach ($hold_ary as $g_id => $forum_ary) {
foreach ($forum_ary as $forum_id => $auth_ary) {
foreach ($auth_ary as $auth_option => $setting) {
if ($mod_permissions && $admin_permissions) {
break 3;
}
if ($setting != ACL_YES) {
continue;
}
if ($auth_option == 'm_') {
$mod_permissions = true;
}
if ($auth_option == 'a_') {
$admin_permissions = true;
}
}
}
}
if ($mod_permissions) {
if (!function_exists('phpbb_cache_moderators')) {
global $phpbb_root_path, $phpEx;
include $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
}
phpbb_cache_moderators($db, $cache, $auth);
}
if ($mod_permissions || $admin_permissions) {
if (!function_exists('phpbb_update_foes')) {
global $phpbb_root_path, $phpEx;
include $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
}
phpbb_update_foes($db, $auth, array($group_id));
}
}
示例8: main
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log;
$user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums';
$this->page_title = 'ACP_MANAGE_FORUMS';
$form_key = 'acp_forums';
add_form_key($form_key);
$action = $request->variable('action', '');
$update = isset($_POST['update']) ? true : false;
$forum_id = $request->variable('f', 0);
$this->parent_id = $request->variable('parent_id', 0);
$forum_data = $errors = array();
if ($update && !check_form_key($form_key)) {
$update = false;
$errors[] = $user->lang['FORM_INVALID'];
}
// Check additional permissions
switch ($action) {
case 'progress_bar':
$start = $request->variable('start', 0);
$total = $request->variable('total', 0);
$this->display_progress_bar($start, $total);
break;
case 'delete':
if (!$auth->acl_get('a_forumdel')) {
trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
case 'add':
if (!$auth->acl_get('a_forumadd')) {
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
}
// Major routines
if ($update) {
switch ($action) {
case 'delete':
$action_subforums = $request->variable('action_subforums', '');
$subforums_to_id = $request->variable('subforums_to_id', 0);
$action_posts = $request->variable('action_posts', '');
$posts_to_id = $request->variable('posts_to_id', 0);
$errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);
if (sizeof($errors)) {
break;
}
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
break;
case 'edit':
$forum_data = array('forum_id' => $forum_id);
// No break here
// No break here
case 'add':
$forum_data += array('parent_id' => $request->variable('forum_parent_id', $this->parent_id), 'forum_type' => $request->variable('forum_type', FORUM_POST), 'type_action' => $request->variable('type_action', ''), 'forum_status' => $request->variable('forum_status', ITEM_UNLOCKED), 'forum_parents' => '', 'forum_name' => $request->variable('forum_name', '', true), 'forum_link' => $request->variable('forum_link', ''), 'forum_link_track' => $request->variable('forum_link_track', false), 'forum_desc' => $request->variable('forum_desc', '', true), 'forum_desc_uid' => '', 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', 'forum_rules' => $request->variable('forum_rules', '', true), 'forum_rules_uid' => '', 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', 'forum_rules_link' => $request->variable('forum_rules_link', ''), 'forum_image' => $request->variable('forum_image', ''), 'forum_style' => $request->variable('forum_style', 0), 'display_subforum_list' => $request->variable('display_subforum_list', false), 'display_on_index' => $request->variable('display_on_index', false), 'forum_topics_per_page' => $request->variable('topics_per_page', 0), 'enable_indexing' => $request->variable('enable_indexing', true), 'enable_icons' => $request->variable('enable_icons', false), 'enable_prune' => $request->variable('enable_prune', false), 'enable_post_review' => $request->variable('enable_post_review', true), 'enable_quick_reply' => $request->variable('enable_quick_reply', false), 'enable_shadow_prune' => $request->variable('enable_shadow_prune', false), 'prune_days' => $request->variable('prune_days', 7), 'prune_viewed' => $request->variable('prune_viewed', 7), 'prune_freq' => $request->variable('prune_freq', 1), 'prune_old_polls' => $request->variable('prune_old_polls', false), 'prune_announce' => $request->variable('prune_announce', false), 'prune_sticky' => $request->variable('prune_sticky', false), 'prune_shadow_days' => $request->variable('prune_shadow_days', 7), 'prune_shadow_freq' => $request->variable('prune_shadow_freq', 1), 'forum_password' => $request->variable('forum_password', '', true), 'forum_password_confirm' => $request->variable('forum_password_confirm', '', true), 'forum_password_unset' => $request->variable('forum_password_unset', false));
/**
* Request forum data and operate on it (parse texts, etc.)
*
* @event core.acp_manage_forums_request_data
* @var string action Type of the action: add|edit
* @var array forum_data Array with new forum data
* @since 3.1.0-a1
*/
$vars = array('action', 'forum_data');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_request_data', compact($vars)));
// On add, add empty forum_options... else do not consider it (not updating it)
if ($action == 'add') {
$forum_data['forum_options'] = 0;
}
// Use link_display_on_index setting if forum type is link
if ($forum_data['forum_type'] == FORUM_LINK) {
$forum_data['display_on_index'] = $request->variable('link_display_on_index', false);
}
// Linked forums and categories are not able to be locked...
if ($forum_data['forum_type'] == FORUM_LINK || $forum_data['forum_type'] == FORUM_CAT) {
$forum_data['forum_status'] = ITEM_UNLOCKED;
}
$forum_data['show_active'] = $forum_data['forum_type'] == FORUM_POST ? $request->variable('display_recent', true) : $request->variable('display_active', false);
// Get data for forum rules if specified...
if ($forum_data['forum_rules']) {
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], $request->variable('rules_parse_bbcode', false), $request->variable('rules_parse_urls', false), $request->variable('rules_parse_smilies', false));
}
// Get data for forum description if specified
if ($forum_data['forum_desc']) {
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], $request->variable('desc_parse_bbcode', false), $request->variable('desc_parse_urls', false), $request->variable('desc_parse_smilies', false));
}
$errors = $this->update_forum_data($forum_data);
if (!sizeof($errors)) {
$forum_perm_from = $request->variable('forum_perm_from', 0);
$cache->destroy('sql', FORUMS_TABLE);
$copied_permissions = false;
// Copy permissions?
if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id'] && ($action != 'edit' || empty($forum_id) || $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) {
copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], $action == 'edit' ? true : false);
phpbb_cache_moderators($db, $cache, $auth);
$copied_permissions = true;
}
//.........这里部分代码省略.........
示例9: cache_moderators
/**
* Cache moderators. Called whenever permissions are changed
* via admin_permissions. Changes of usernames and group names
* must be carried through for the moderators table.
*
* @deprecated 3.1.0 (To be removed: 3.3.0)
* @return null
*/
function cache_moderators()
{
global $db, $cache, $auth;
return phpbb_cache_moderators($db, $cache, $auth);
}
示例10: finish_conversion
/**
* Finish conversion, the last function to be called.
*/
function finish_conversion()
{
global $db, $phpbb_root_path, $phpEx, $convert, $config, $language, $user;
global $cache, $auth, $phpbb_container, $phpbb_log;
include_once ($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
WHERE config_name = 'convert_progress'
OR config_name = 'convert_options'
OR config_name = 'convert_db_server'
OR config_name = 'convert_db_user'");
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
@unlink($phpbb_container->getParameter('core.cache_dir') . 'data_global.' . $phpEx);
phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));
$url = $this->controller_helper->route('phpbb_convert_finish');
$this->template->assign_vars(array(
'L_SUBMIT' => $user->lang['FINAL_STEP'],
'U_ACTION' => $url,
));
$this->meta_refresh($url);
return;
}