本文整理汇总了PHP中Authentication::getUserObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::getUserObject方法的具体用法?PHP Authentication::getUserObject怎么用?PHP Authentication::getUserObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authentication
的用法示例。
在下文中一共展示了Authentication::getUserObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
echo date('H:i', strtotime($event->getRemindMeTime()));
} else {
echo $event->getRemindMeTime();
}
echo ' ';
}
echo '<i class="fa fa-clock-o"></i> ';
if ($event->getAllDay() == '1') {
echo "all day";
} else {
echo $start_time . '-' . $end_time;
}
echo '</small>';
echo ' <i class="fa fa-info-circle"></i> ';
echo $event->getDescription() . ' <small><a href="/edit_evt.php?id=' . $event->getId() . '">edit</a>';
if ($event->getUserId() == Authentication::get_user() || PermissionMgr::groupHasPermission(Authentication::getUserObject()->getGroupId(), 'is_administrator')) {
echo ' <a href="#" onclick="deleteEvt(' . $event->getId() . ', \'' . htmlspecialchars($event->getDescription()) . '\')">delete</a>';
}
echo '</small></h5>';
$number += 1;
}
if ($number == 0) {
echo '<i>No events on this date.</i>';
}
$date = date("Y-m-d", strtotime("+1 day", strtotime($date)));
echo '<hr>';
}
?>
示例2: navbar
//.........这里部分代码省略.........
if ($active == 0) {
?>
class="active"<?php
}
?>
><a href="<?php
if ($active == 0) {
?>
#<?php
} else {
?>
index.php<?php
}
?>
"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home <!--<span class="sr-only">(current)</span>--></a></li>
<li <?php
if ($active == 1) {
?>
class="active"<?php
}
?>
><a href="<?php
if ($active == 1) {
?>
#<?php
} else {
?>
timetable.php<?php
}
?>
"><span class="fa fa-table" aria-hidden="true"></span> Timetable</a></li>
<li <?php
if ($active == 2) {
?>
class="active"<?php
}
?>
><a href="<?php
if ($active == 2) {
?>
#<?php
} else {
?>
tasks.php<?php
}
?>
"><span class="fa fa-check" aria-hidden="true"></span> Tasks <span class="badge"><?php
echo TaskList::getAllOutstandingCount(Authentication::get_user());
?>
</span></a></li>
<li <?php
if ($active == 4) {
?>
class="active"<?php
}
?>
><a href="<?php
if ($active == 4) {
?>
#<?php
} else {
?>
calendar.php<?php
}
?>
"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> Calendar</a></li>
<li <?php
if ($active == 3) {
?>
class="active"<?php
}
?>
><a href="<?php
if ($active == 3) {
?>
#<?php
} else {
?>
profile.php<?php
}
?>
"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> You</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/<?php
echo APP_LOGOUT_LOC;
?>
"><i class="fa fa-sign-out"></i> Log out <?php
echo Authentication::getUserObject()->getUsername();
?>
</a></li>
</ul>
</div>
</div>
</nav>
<?php
}
示例3: json_encode
echo json_encode(array('status' => 'error', 'reason' => 'Task description not supplied.'));
}
} else {
if ($_POST['action'] == "new_list") {
if (isset($_POST['name'])) {
if (empty(trim($_POST['name']))) {
echo json_encode(array('status' => 'validation', 'reason' => 'Your task list name is empty!'));
die;
}
/*if (strlen($_POST['name']) > 32)
{
echo json_encode(array('status'=>'validation', 'reason' => 'Your task list name is too long!'));
die();
}*/
$tasklist = new TaskList();
$tasklist->setUserId(Authentication::getUserObject()->getId());
$tasklist->setName($_POST['name']);
$tasklist->setIcon($_POST['icon']);
$tasklist->save();
echo json_encode(array('status' => 'success', 'tasklist-id' => $tasklist->getId()));
} else {
echo json_encode(array('status' => 'error', 'reason' => 'List name not supplied.'));
}
} else {
if ($_POST['action'] == "delete_list") {
if (isset($_POST['id'])) {
$list = TaskList::get($where = array('id' => $_POST['id']))[0];
foreach (Task::get($where = array('list_id' => $list->getId())) as $task) {
$task->delete();
}
$list->delete();
示例4: head
<!DOCTYPE html>
<html lang="en">
<?php
require 'config.php';
include DIR_LIB . 'helpers/ui.php';
Authentication::require_login();
?>
<head>
<?php
head();
$user = Authentication::getUserObject();
?>
</head>
<body>
<?php
navbar(3);
?>
<div class="container" role="main">
<div class="page-header">
<h1><span class="glyphicon glyphicon-user"></span> <?php
echo htmlspecialchars($user->getUsername());
?>
<small><?php
$group = PermGroup::get($where = array('id' => $user->getGroupId()))[0];