本文整理汇总了PHP中user::hasPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP user::hasPermission方法的具体用法?PHP user::hasPermission怎么用?PHP user::hasPermission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::hasPermission方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user
<?php
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
redirect::to('../index.php');
}
if (!$user->hasPermission("CompAdmin")) {
redirect::to('../Includes/home.php');
}
?>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Orchestrate</title>
<?php
require_once 'headinfo.php';
?>
<?php
require_once 'slideMenu.php';
?>
示例2: user
<?php
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
redirect::to('../index.php');
}
if (!$user->hasPermission("Driver") && !$user->hasPermission("Rep")) {
redirect::to('../Includes/home.php');
}
?>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Orchestrate</title>
<?php
require_once 'headinfo.php';
?>
</head>
<body>
<?php
require_once 'slideMenu.php';
$myid = $user->data()->Id;
?>
示例3: array
<?php
require_once 'core/init.php';
$a = array(0);
$user = new user();
if (!$user->isLoggedIn() && !$user->hasPermission('admin')) {
Redirect::to('login.php');
}
if ($user->hasPermission('admin') || $user->hasPermission('sadmin')) {
include 'includes/ad_head.php';
?>
<div class="container-fluid">
<div class="row">
<div class="jumbotron">
<center><p>For your Web Privacy You must<a href="logout.php"> Logout</a> Before close the Admin Panel </p></center>
</div>
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li><a href="pdfcontrol.php">Reports <span class="sr-only">(current)</span></a></li>
<li> <a href="add.php"><b>Add</b></a></li>
</ul>
<ul class="nav nav-sidebar">
<li> <a href="javascript:showOrHide('list');"><b>List</b></a></li>
<li><a href="userProfile.php">profile</a></li>
<li> <a href="search.php">Search user </a>
</ul>
</div>
示例4: elseif
</li>
<li>
<a href="about.php">ABOUT</a>
</li>
<li>
<a href="contact.php">CONTACT</a>
</li>
<?php
} else {
if ($_SESSION['admin'] == true) {
?>
<li>
<a href="dashboard_admin.php">DASHBOARD</a>
</li>
<?php
} elseif ($user->hasPermission('coord')) {
?>
<li>
<a href="dashboard_coord.php">DASHBOARD</a>
</li>
<?php
} else {
?>
<li>
<a href="dashboard_student.php">DASHBOARD</a>
</li>
<?php
}
?>
<li>
<a href="about.php">ABOUT</a>
示例5: user
<?php
require_once '../Core/init.php';
$user = new user(null, $_log);
if (!$user->isLoggedIn()) {
redirect::to('index.php');
}
if (!$user->hasPermission("Admin")) {
redirect::to('index.php');
}
$files = scandir('../Log');
$_log->info('Trying to delete log');
for ($i = 2; $i < sizeof($files); $i++) {
if ($i == sizeof($files) - 1) {
if (file_put_contents("../Log/" . $files[$i], "") !== false) {
$_log->info('Log file deleted by user: ' . $user->data()->Username);
echo "File deleted";
} else {
$_log->info('Log file NOT deleted by user: ' . $user->data()->Username);
echo "File not deleted";
}
} else {
if (unlink("../Log/" . $files[$i])) {
echo "File deleted";
} else {
$_log->info('Log file NOT deleted by user: ' . $user->data()->Username);
echo "File not deleted";
}
}
}
示例6: foreach
<p>Special query2 to see posts before a date</p>
<form name="form2" method="post" action="">
<div>
<input type="text" name="collect" placeholder="Date"> <input
type="submit" name="send" value="Search">
</div>
</form>
<?php
if (input::exists()) {
$val = input::get('collect');
if ($user->SpecialQuery2($user->data()->UserID, $val)) {
echo '<br>' . 'posts are:' . '<br>';
foreach ($user->lists() as $list) {
echo $list->Text . ' posted on ' . $list->RecievedBy;
}
//session::flash ( 'home', 'Posts are:' );
//redirect::to ( 'index.php' );
}
}
?>
<?php
}
// $Lname=input::get('LastName');
// echo $Fname." ".$Lname ;
if ($user->hasPermission('admin')) {
echo 'You are an admin';
}
} else {
echo '<p>' . 'You need to <a href="login.php"> login</a> or <a href="register.php">register</a>' . '</p>';
}
示例7: user
<?php
$user = new user(null, $_log);
$isrep = false;
$isdriver = false;
$ismanager = false;
$isadmin = false;
$isfinance = false;
if ($user->hasPermission("Rep")) {
$isrep = true;
}
if ($user->hasPermission("Driver")) {
$isdriver = true;
}
if ($user->hasPermission("Manager")) {
$ismanager = true;
}
if ($user->hasPermission("Admin")) {
$isadmin = true;
}
if ($user->hasPermission("Finance")) {
$isfinance = true;
}
?>
<nav class="navbar navbar-default navbar-inverse" role="navigation">
<div class="container-fluid">
<div class="navbar-brand"><a href="../Includes/home.php">Orchestrate</a></div>
<!-- <div class="navbar-brand"><a href="home.php">Booking</a></div> -->
示例8: user
<?php
require_once '../core/init.php';
req::once('functions/rand_pass.php');
$user = new user();
if ($user->hasPermission('logged in')) {
redirect::to('index.php');
}
if (input::exists()) {
$validate = new validate();
$validate->check($_POST, array('email' => array('required' => true, 'min' => 2, 'max' => 32, 'unique' => 'users', 'email' => true), 'password' => array('required' => true, 'min' => 6, 'max' => 32), 'confirmation' => array('required' => true, 'matches' => 'password')));
if ($validate->passed()) {
$user = new user();
$salt = hash::salt(32);
$activation_code = random_code(16);
$activation_hash = hash::make($activation_code);
try {
$id = $user->create(array('email' => input::get('email'), 'type' => input::get('account_type'), 'status' => 'u', 'password' => hash::make(input::get('password'), $salt), 'salt' => $salt, 'activation_code' => $activation_hash));
mail(input::get('email'), 'Thank you for registering with MyBasket', 'To activate your account, go here: ' . config::get('site_url') . '/activate.php?code=' . $activation_code . '&user=' . input::get('email'));
$db = db::getInstance();
if (input::get('account_type') === 'l') {
$db->insert('lab_user_data', array('user_id' => $id));
} else {
if (input::get('account_type') === 'd') {
$db->insert('ds_user_data', array('user_id' => $id));
}
}
} catch (Exception $e) {
die($e->getMessage());
}
}
示例9: user
<?php
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
redirect::to('../index.php');
}
if (!$user->hasPermission("Finance")) {
redirect::to('../Includes/home.php');
}
?>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Orchestrate</title>
<?php
require_once 'headinfo.php';
?>
</head>
<body>
<?php
require_once 'slideMenu.php';
$myid = $user->data()->Id;
?>
示例10: user
<?php
ob_start();
require_once '../Core/init.php';
$user = new user(null, $_log);
if (!$user->isLoggedIn() || !$user->hasPermission('Admin')) {
redirect::to('../index.php');
}
if (input::exists()) {
if (token::check(input::get('token'))) {
$validate = new validate();
$validation = $validate->check($_POST, array('Username' => array('required' => true, 'min' => 2, 'max' => 20, 'unique' => 'Users'), 'Password' => array('required' => true, 'min' => 6), 'password_again' => array('required' => true, 'matches' => 'Password'), 'Name' => array('required' => true, 'min' => 2, 'max' => 50)));
if ($validation->passed()) {
//session::flash('success','You registered successfully!');
//header('Location: index.php');
$user = new user(null, $_log);
$salt = hash::salt(32);
try {
$user->create(array('Username' => input::get('Username'), 'User_Group' => 3, 'Password' => hash::make(input::get('Password'), $salt), 'Salt' => $salt));
session::flash('home', 'You have been registered');
redirect::to('index.php');
} catch (Exception $e) {
//echo $e->getMessage(), '<br>';
die($e->getMessage());
}
} else {
foreach ($validation->errors() as $error) {
echo $error, '<br>';
}
}
}