本文整理汇总了PHP中Sessions::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Sessions::get方法的具体用法?PHP Sessions::get怎么用?PHP Sessions::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sessions
的用法示例。
在下文中一共展示了Sessions::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCRF
/**
* Check token submitted
* @param $token
* @return bool
*/
public static function checkCRF($token)
{
if (!$token) {
return false;
}
return Sessions::get('current_token') != trim($token) ? false : true;
}
示例2: logout
public function logout()
{
/*
* compares session token against get method to see if it's the actual user
*/
if (Sessions::get('token') == Requests::get('token')) {
Sessions::destroy();
}
}
示例3: loginCheck
public static function loginCheck()
{
global $db;
if (Sessions::get("login")) {
$username = Session::get("login")['username'];
if ($username) {
$kontrol = $db->query("SELECT username FROM username = '{$username}'")->rowCount();
return $kontrol ? true : false;
}
} else {
return false;
}
}
示例4: Sessions
$pagetitle = "My Sessions";
require_once 'includes/header.php';
echo '<h3 class="text-center">My Sessions</h3><br>';
$s = new Sessions();
?>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Forthcoming Sessions</h3>
</div>
<div class="panel-body">
<?php
try {
$sessions = $s->get(array('student' => $user->data()->id, 'future' => 1));
if (!empty($sessions)) {
?>
<table class="table table-condensed table-striped">
<tr>
<td>
<strong>Mentor</strong>
</td>
<td>
<strong>Program</strong>
</td>
<td>
<strong>Position</strong>
</td>
<td>
<strong>Type</strong>
示例5: foreach
<h3 class="panel-title">The following errors occured:</h3>
</div>
<div class="panel-body">';
foreach ($validation->errors() as $error) {
echo $error . '<br>';
}
echo '</div>
</div>
</div>
';
}
}
// else {
try {
$s = new Sessions();
$session = $s->get(['id' => Input::get('s')])[0];
$type = $r->getTypes(0, ['type' => $session->report_type])[0];
$positions = $r->getPositionsByProgram($type->program_id);
//get all positions for this program level
$sliders = $r->getSliders(1, $type->program_id);
if (!count($type)) {
Session::flash('error', 'No report type found for that ID');
Redirect::to('./view_student.php?cid=' . $session->student);
}
if (!$user->hasPermission($session->program_permissions)) {
Session::flash('error', 'Insufficient permissions');
Redirect::to('./');
}
} catch (Exception $e) {
echo $e->getMessage();
}
示例6: Sessions
$pagetitle = "My Sessions";
require_once '../includes/header.php';
echo '<h3 class="text-center">My Sessions</h3><br>';
$s = new Sessions();
?>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Forthcoming Sessions</h3>
</div>
<div class="panel-body">
<?php
try {
$sessions = $s->get(array('mentor' => $user->data()->id, 'future' => 1));
if (!empty($sessions)) {
?>
<table class="table table-condensed table-striped">
<tr>
<td>
<strong>Student</strong>
</td>
<td>
<strong>Program</strong>
</td>
<td>
<strong>Position</strong>
</td>
<td>
<strong>Type</strong>
示例7: Sessions
<?php
//llamamos la constante URL
require '../util/constants.php';
//controlamos que se haya iniciado session.
require '../class/sessions.php';
$objSes = new Sessions();
$objSes->init();
$profile = $objSes->get('profi');
if (!isset($profile) && $profile != 'Admin') {
header('location: ' . URL);
}
if (isset($_POST['nombre'])) {
require '../class/books.php';
$objBook = new Books();
$objBook->insert_book();
} else {
header('location: ' . URL . 'admin/');
}
示例8: Sessions
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Sessions without reports</h3>
</div>
<div class="panel-body" style="padding:0px;">
<?php
try {
$s = new Sessions();
$noreport = $s->get(array('all' => 1, 'noreport' => 1, 'future' => 2));
if (!empty($noreport)) {
?>
<table class="table table-condensed table-striped">
<tr>
<td>
<strong>Student</strong>
</td>
<td>
<strong>Mentor</strong>
</td>
<td>
<strong>Position</strong>
</td>
<td>
<strong>Date</strong>