-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
70 lines (64 loc) · 2.1 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**\
* eGroupWare - Registration *
* http://www.egroupware.org *
* *
* This application originally written by Joseph Engo <jengo@phpgroupware.org> *
* Funding for this program originally provided by http://www.checkwithmom.com *
***********************************************************************************
* @link http://www.egroupware.org
* @author Nathan Gray
* @package registration
* @copyright (c) 2011 by Nathan Gray
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
\*
/* $Id$ */
use EGroupware\Api;
/**
* Check if we allow anon access and with which creditials
*
* @param array &$anon_account anon account_info with keys 'login', 'passwd' and optional 'passwd_type'
* @return boolean true if we allow anon access, false otherwise
*/
function registration_check_anon_access(&$anon_account)
{
$config = Api\Config::read('registration');
if ($config['enable_registration'] && $config['anonymous_user'])
{
$anon_account = array(
'login' => $config['anonymous_user'],
'passwd' => $config['anonymous_pass'],
'passwd_type' => 'text',
);
return true;
}
return false;
}
// if confirmation id is given, redirect to confirm
if(!empty($_GET['confirm']))
{
$_GET['menuaction'] = 'registration.registration_ui.confirm';
}
$GLOBALS['egw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'registration',
'autocreate_session_callback' => 'registration_check_anon_access',
);
include('../header.inc.php');
$app = 'registration';
if ($_GET['menuaction'])
{
list($a,$class,$method) = explode('.',$_GET['menuaction']);
if ($a && $class && $method)
{
$obj = CreateObject($app. '.'. $class);
if (is_array($obj->public_functions) && $obj->public_functions[$method])
{
echo $obj->$method();
exit();
}
}
}
ExecMethod('registration.registration_ui.register');
exit();