-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathModule.php
More file actions
55 lines (47 loc) · 1.51 KB
/
Module.php
File metadata and controls
55 lines (47 loc) · 1.51 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace tailgate;
/**
* @license http://opensource.org/licenses/lgpl-3.0.html
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
class Module extends \Canopy\Module implements \Canopy\SettingDefaults
{
public function __construct()
{
parent::__construct();
$this->setTitle('tailgate');
$this->setProperName('Tailgating');
}
public function beforeRun(\Canopy\Request $request, \Canopy\Controller $controller)
{
require_once PHPWS_SOURCE_DIR . 'mod/tailgate/conf/defines.php';
}
public function getController(\Canopy\Request $request)
{
$cmd = $request->shiftCommand();
if ($cmd == 'Admin') {
if (\Current_User::allow('tailgate')) {
$admin = new \tailgate\Controller\Admin($this);
return $admin;
} else {
\Current_User::requireLogin();
}
} else {
$user = new \tailgate\Controller\User($this);
return $user;
}
}
public function runTime(\Canopy\Request $request)
{
if (\PHPWS_Core::atHome()) {
require_once PHPWS_SOURCE_DIR . 'mod/tailgate/conf/defines.php';
\tailgate\Controller\User\Game::userStatusSidebar();
}
}
public function getSettingDefaults()
{
$settings['new_account_information'] = '<p>Fill out a description of the Tailgate process in administration.</p>';
$settings['reply_to'] = null;
return $settings;
}
}