/**
  * Check if the authenticate user has the specific user role
  * This function is overwritable from the custom helpers/auth_helper.php
  * @param  string $role The user role name or key
  * @return boolean
  */
 function auth_role($role)
 {
     if (auth_isAnonymous()) {
         return false;
     }
     $auth = auth_prerequisite();
     $field = $auth['fields']['role'];
     $session = auth_get();
     return $session->{$field} == $role ? true : false;
 }
Beispiel #2
0
<?php

auth_prerequisite();
$pageTitle = _t('Sign In');
?>
<!DOCTYPE html>
<html lang="<?php 
echo _lang();
?>
">
<head>
    <title><?php 
echo _title($pageTitle);
?>
</title>
    <?php 
include _i('inc/tpl/head.php');
?>
</head>
<body class="mini-page">
    <?php 
include 'view.php';
?>
</body>
</html>