Till Brehm
2014-08-14 9edea9976bd605071e0694a90d704266c0b7e0f9
commit | author | age
fe670c 1 <?php
T 2
3 // Set the path to the form definition file.
4 $tform_def_file = 'form/remote_user.tform.php';
5
6 // include the core configuration and application classes
7fe908 7 require_once '../../lib/config.inc.php';
MC 8 require_once '../../lib/app.inc.php';
fe670c 9
T 10 // Check the  module permissions and redirect if not allowed.
7fe908 11 if(!stristr($_SESSION['s']['user']['modules'], 'admin')) {
MC 12     header('Location: ../index.php');
13     die;
fe670c 14 }
T 15
9edea9 16 $app->auth->check_module_permissions('admin');
TB 17 $app->auth->check_security_permissions('admin_allow_remote_users');
18
91624b 19 // Disable this function in demo mode
T 20 if($conf['demo_mode'] == true) $app->error('This function is disabled in demo mode.');
21
fe670c 22 // Load the templating and form classes
T 23 $app->uses('tpl,tform,tform_actions');
24 $app->load('tform_actions');
25
26 // Create a class page_action that extends the tform_actions base class
27 class page_action extends tform_actions {
28
7fe908 29     //* Customisations for the page actions will be defined here
40dd9f 30     function onShow() {
T 31         global $app;
7fe908 32
40dd9f 33         // Translate the items, very bad trick... :( because the language file is not loaded yet when the form file gets parsed
T 34         foreach($app->tform->formDef["tabs"]['remote_user']['fields']['remote_functions']['value'] as $key => $val) {
35             $app->tform->formDef["tabs"]['remote_user']['fields']['remote_functions']['value'][$key] = $app->tform->lng($val).'<br>';
36         }
7fe908 37
40dd9f 38         parent::onShow();
T 39     }
fe670c 40
T 41 }
42
43 // Create the new page object
44 $page = new page_action();
45
46 // Start the page rendering and action handling
47 $page->onLoad();
48
49 ?>