本文整理汇总了PHP中Authentication::get_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::get_user方法的具体用法?PHP Authentication::get_user怎么用?PHP Authentication::get_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authentication
的用法示例。
在下文中一共展示了Authentication::get_user方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: navbar
navbar();
?>
<div class="container" role="main">
<h1 align="center" class="home-greeting-text"> <?php
echo date('l jS M Y');
?>
</h1>
<p class="lead">You have <?php
echo TaskList::getAllOutstandingCount(Authentication::get_user());
?>
tasks outstanding.</p>
<h2>Your Timetable</h2>
<?php
print_timetable_by_week(Authentication::get_user(), $week_block);
?>
</div>
<?php
foot();
?>
</body>
</html>
示例2: getWeekBlockbyDate
require 'config.php';
Authentication::require_login();
include DIR_LIB . 'helpers/ui.php';
include DIR_LIB . 'helpers/timetable.php';
$viewing_by_day = false;
$viewing_date = false;
if (isset($_GET['view'])) {
if ($_GET['view'] == "day") {
$viewing_by_day = true;
}
}
if (isset($_GET['date'])) {
$viewing_date = true;
}
$currentuser_id = Authentication::get_user();
function getWeekBlockbyDate($date)
{
$blockdate = date('Y-m-d', strtotime('last Monday', strtotime(TIMETABLE_WEEK_BLOCK_BEGIN_DATE)));
$week_block = 1;
while (strtotime($date) > strtotime($blockdate)) {
if ($week_block == 0) {
$week_block = 1;
} else {
$week_block = 0;
}
$blockdate = date('Y-m-d', strtotime('+1 week', strtotime($blockdate)));
}
return $week_block;
}
$week_block = getWeekBlockByDate(date('Y-m-d'));
示例3: 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>';
}
?>
示例4: array
<?php
?>
<div class="modal" id="newTTLessonDlg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="taskEditDlgTitle">Are you sure?</h4>
</div>
<form method="POST" action="del_lesson.php">
<?php
$periods_st = TimetablePeriod::get($where = array('number' => $_POST['period'], 'weekday' => $_POST['weekday']));
$pds_nd = TimetablePeriod::get($where = array('number' => $_POST['period'], 'weekday' => '0'));
$periods = array_merge($periods_st, $pds_nd);
$allocs = TimetablePeriodAllocation::get($where = array('attendinguser_id' => Authentication::get_user()));
$actual_lesson = 0;
foreach (TimetableLesson::get($where = array('weekday' => $_POST['weekday'], 'week_block' => $_POST['week_block'])) as $lesson) {
foreach ($periods as $period) {
if ($period->getId() == $lesson->getPeriodId()) {
foreach ($allocs as $alloc) {
if ($alloc->getLessonId() == $lesson->getId()) {
echo '<input type="hidden" name="alloc_id" value="' . $alloc->getId() . '" />';
$actual_lesson = $lesson;
break;
}
}
}
if ($actual_lesson != 0) {
break;
}
示例5: navbar
navbar(2);
?>
<div class="container" role="main">
<div class="page-header">
<h1><span class="glyphicon glyphicon-ok"></span> Tasks <small><?php
$conditions = array('user_id' => Authentication::get_user());
$viewing_single = false;
if (isset($_GET['list'])) {
if (ctype_digit($_GET['list'])) {
$conditions['id'] = $_GET['list'];
$viewing_single = true;
echo 'single view';
}
} else {
echo TaskList::getAllOutstandingCount(Authentication::get_user()) . ' outstanding';
}
?>
</small></h1>
</div>
<?php
if ($viewing_single) {
?>
<a class="btn btn-info" href="/tasks.php<?php
if (isset($_GET['show_complete'])) {
echo '?show_complete';
}
?>
" role="button"><i class="fa fa-hand-o-left"></i> Return</a>
示例6: navbar
function navbar($active = 0)
{
?>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#dk-nav-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand" href="#">Planner</span>
</div>
<div class="collapse navbar-collapse menu-text" id="dk-nav-collapse">
<ul class="nav navbar-nav">
<li <?php
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
}
//.........这里部分代码省略.........
示例7: session_start
<?php
session_start();
require 'config.php';
if (Authentication::get_user() != -1) {
// send user to the dashboard
header("Location: //" . APP_ROOT_URL);
die;
} else {
if (isset($_POST['username'])) {
try {
$user = new User();
$user->setUsername($_POST['username']);
$user->setForename($_POST['firstname']);
$user->setSurname($_POST['surname']);
$user->setEmail($_POST['email']);
$user->setPassword($_POST['password']);
$user->setGroupId(1);
$user->save();
} catch (Exception $e) {
die($e->getMessage());
}
header("Location: //" . APP_ROOT_URL);
die;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>