-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclass.ProfilesPage.php
41 lines (39 loc) · 1.38 KB
/
class.ProfilesPage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once('Autoload.php');
class ProfilesPage extends \Flipside\Http\WebPage
{
public $profiles_root;
public function __construct($title)
{
parent::__construct($title, true);
$root = $_SERVER['DOCUMENT_ROOT'];
$script_dir = dirname(__FILE__);
if(strstr($script_dir, $root) === false)
{
$this->profiles_root = dirname($_SERVER['SCRIPT_NAME']);
}
else
{
$this->profiles_root = substr($script_dir, strlen($root));
}
$this->content['root'] = $this->profiles_root;
$this->addTemplateDir('./templates', 'Profiles');
$this->setTemplateName('@Profiles/profile-main.html');
}
public function addLinks()
{
if($this->user !== false && $this->user !== null)
{
if($this->user->isInGroupNamed('LDAPAdmins') || $this->user->isInGroupNamed('AFs'))
{
$this->addLink('Admin', $this->profiles_root.'/_admin/index.php');
}
if(($this->user->isInGroupNamed('Leads') || $this->user->isInGroupNamed('CC')) || $this->user->isInGroupNamed('AFs'))
{
$this->addLink('Leads', $this->profiles_root.'/lead/index.php');
}
$this->addLink('My Profile', $this->profiles_root.'/profile.php');
}
}
}
/* vim: set tabstop=4 shiftwidth=4 expandtab: */