本文整理匯總了PHP中UserUtils::clear_admin_access方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserUtils::clear_admin_access方法的具體用法?PHP UserUtils::clear_admin_access怎麽用?PHP UserUtils::clear_admin_access使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserUtils
的用法示例。
在下文中一共展示了UserUtils::clear_admin_access方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: VALUES
$gender = $_POST['gender'];
if ($gender == '') {
$gender = NULL;
}
$result = $mysqli->prepare("UPDATE users SET roles = ?, title = ?, initials = ?, surname = ?, grade = ?, yearofstudy = ?, username = ?, email = ?, first_names = ?, gender = ? WHERE id = ?");
$result->bind_param('sssssissssi', $tmp_roles, $_POST['title'], $initials, $_POST['surname'], $_POST['grade'], $_POST['year'], $_POST['username'], $_POST['email'], $_POST['first_names'], $gender, $userID);
$result->execute();
$result->close();
// Remove from teams if 'left'.
if (strtolower($tmp_roles) == 'left') {
UserUtils::clear_staff_modules_by_userID($userID, $mysqli);
}
// Remove from admin access if role changed from Admin
if ($userObject->has_role('SysAdmin')) {
if ($tmp_roles != $_POST['prev_roles'] and $_POST['prev_roles'] == 'Staff,Admin') {
UserUtils::clear_admin_access($userID, $mysqli);
}
}
// Update 'sid' table;
$result = $mysqli->prepare("DELETE FROM sid WHERE userID = ?");
$result->bind_param('i', $userID);
$result->execute();
$result->close();
if (isset($_POST['sid']) and $_POST['sid'] != '' and $_POST['sid'] != $string['unknown']) {
$result = $mysqli->prepare("INSERT INTO sid VALUES (?, ?)");
$result->bind_param('si', $_POST['sid'], $userID);
$result->execute();
$result->close();
}
?>
<!DOCTYPE html>