本文整理汇总了PHP中Access::has_access方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::has_access方法的具体用法?PHP Access::has_access怎么用?PHP Access::has_access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::has_access方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$groups = $ac->get_user_groups();
$status = $ac->has_confirmed($ac->user->id);
if ($status == 0) {
$dialog = $ac->get_tutor_access_dialog($ac->user->id, $groups);
echo $dialog;
die;
}
// Navigate directly to gradebook
$groupid = $groups[0];
$url = "http://" . $_SERVER['SERVER_NAME'] . "/lms/grade/report/grader/index.php?id=" . $ac->courseid . "&group={$groupid}";
header("Location: {$url}");
}
if ($roleid == 5) {
// Check student's access
$groups = $ac->get_user_groups();
$status = $ac->has_access($ac->user->id);
if ($status == 0) {
$dialog = $ac->get_acces_dialog($ac->user->id, $groups);
echo $dialog;
die;
}
// Navigate directly to course page section
$pageid = $nav->get_page_id();
if ($pageid != 0) {
$url = "http://" . $_SERVER['SERVER_NAME'] . "/lms/mod/page/view.php?id=" . $pageid . "";
header("Location: {$url}");
}
}
echo $OUTPUT->header();
echo $OUTPUT->custom_block_region('content');
echo $OUTPUT->footer();
示例2: effective_access
public function effective_access()
{
$access = new Access();
for ($i = count($this->access) - 1; $i >= 0; $i--) {
$curr = $this->access[$i];
if (!$access->has_access() && $curr->has_access()) {
$access->set_access($curr->get_access());
}
if (!$access->has_final() && $curr->has_final()) {
$access->set_final($curr->is_final());
}
if (!$access->has_abstract() && $curr->has_abstract()) {
$access->set_abstract($curr->is_abstract());
}
if (!$access->has_static() && $curr->has_static()) {
$access->set_static($curr->is_static());
}
}
return $access;
}