PHP Classes

File: examples/2.logged.admin.php

Recommend this page to a friend!
  Classes of Jorge Castro  >  PHP Security One  >  examples/2.logged.admin.php  >  Download  
File: examples/2.logged.admin.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Security One
Base class to authenticate an logged in users
Author: By
Last change: Update of examples/2.logged.admin.php
Date: 1 year ago
Size: 629 bytes
 

Contents

Class file image Download
<?php
include "../lib/SecurityOne.php";

use
eftec\SecurityOne;

$security=new SecurityOne(true);

if (
$security->isLogged()===false) {
   
header("location:1.basiclogin.php");
    die(
1);
}
$security->getCurrent();

if (!
$security->isMember("admin")) {
   
?>
<h1 style="color:red">User is not member of administrator</h1>
    <a href="1.basiclogin.php">login</a><br>
    <a href="3.logout.php">logout</a><br>
    <?php
} else {
   
?>
<h1 >Logged as Administrator <?=$security->user?> - <?=$security->fullName?></h1>
    <a href="1.basiclogin.php">login</a><br>
    <a href="3.logout.php">logout</a><br>
    <?php
}




For more information send a message to info at phpclasses dot org.