Loading...
Searching...
No Matches
PublicSession.php
<?php
class PublicSession {
public $username;
public $user_no;
public $principal_id;
public $email;
public $fullname;
public $groups;
/* These fields were being added dynmically. Set to private mostly, I had to
* set these as public for tests to pass: principal
*/
private $dav_name;
public $principal;
private $roles;
private $logged_in;
function __construct() {
global $c;
$principal = new Principal('username','unauthenticated');
$this->username = $principal->username();
$this->user_no = $principal->user_no();
$this->principal_id = $principal->principal_id();
$this->email = $principal->email();
$this->fullname = $principal->fullname;
$this->dav_name = $principal->dav_name();
$this->principal = $principal;
if ( function_exists("awl_set_locale") && isset($this->locale) && $this->locale != "" ) {
awl_set_locale($this->locale);
}
$this->groups = ( isset($c->public_groups) ? $c->public_groups : array() );
$this->roles = array( 'Public' => true );
$this->logged_in = false;
}
function AllowedTo ( $whatever ) {
dbg_error_log('session', 'Checking whether "Public" is allowed to "%s"', $whatever);
return ( isset($this->roles[$whatever]) && $this->roles[$whatever] );
}
}
Principal
Definition Principal.php:19
PublicSession
Definition PublicSession.php:17
PublicSession\__construct
__construct()
Definition PublicSession.php:70
PublicSession\AllowedTo
AllowedTo( $whatever)
Definition PublicSession.php:101