/** * 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; }
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(); } }
public static function loginCheck() { global $db; if (Sessions::get("login")) { $username = Session::get("login")['username']; if ($username) { $kontrol = $db->query("SELECT username FROM username = '******'")->rowCount(); return $kontrol ? true : false; } } else { return false; } }
$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>
<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(); }
$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>
<?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/'); }
</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>