本文整理汇总了PHP中auth_admin::ghost_permissions方法的典型用法代码示例。如果您正苦于以下问题:PHP auth_admin::ghost_permissions方法的具体用法?PHP auth_admin::ghost_permissions怎么用?PHP auth_admin::ghost_permissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth_admin
的用法示例。
在下文中一共展示了auth_admin::ghost_permissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
break;
case 'switch_perm':
$user_id = request_var('u', 0);
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
WHERE user_id = ' . (int) $user_id;
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm')) {
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
include $phpbb_root_path . 'includes/acp/auth.' . $phpEx;
$auth_admin = new auth_admin();
if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id'])) {
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']);
$message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
trigger_error($message);
break;
case 'restore_perm':
if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm')) {
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
$auth->acl_cache($user->data);
$sql = 'SELECT username
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user->data['user_perm_from'];
$result = $db->sql_query($sql);