Project

General

Profile

1 1425 Luisehahne
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         login
6 1529 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1709 Luisehahne
 * @copyright       2009-2012, Website Baker Org. e.V.
8 1425 Luisehahne
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16 1709 Luisehahne
 */
17 1425 Luisehahne
18 1709 Luisehahne
// Include the configuration file
19 1805 Luisehahne
$config_file = realpath('../../config.php');
20
if(file_exists($config_file) && !defined('WB_URL'))
21
{
22
	require_once($config_file);
23 1709 Luisehahne
}
24 1425 Luisehahne
25 1782 Luisehahne
if(!class_exists('login', false)){ require_once(WB_PATH.'/framework/class.login.php'); }
26
if(!class_exists('frontend', false)){ require_once(WB_PATH.'/framework/class.frontend.php'); }
27
28 1425 Luisehahne
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
29
	// Generate username field name
30
	$username_fieldname = 'username_';
31
	$password_fieldname = 'password_';
32
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
33
	srand((double)microtime()*1000000);
34
	$i = 0;
35
	while ($i <= 7) {
36
		$num = rand() % 33;
37
		$tmp = substr($salt, $num, 1);
38
		$username_fieldname = $username_fieldname . $tmp;
39
		$password_fieldname = $password_fieldname . $tmp;
40
		$i++;
41
	}
42
} else {
43
	$username_fieldname = 'username';
44
	$password_fieldname = 'password';
45
}
46
47 1782 Luisehahne
$admin = new frontend();
48 1625 Luisehahne
49
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
50 1529 Luisehahne
51 1709 Luisehahne
$LoginTpl = 'loginBox.htt';
52
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
53
54 1457 Luisehahne
$thisApp = new Login( array(
55 1709 Luisehahne
					'MAX_ATTEMPS' => "3",
56
					'WARNING_URL' => $WarnUrl,
57
					'INFO_URL' => '##',
58
					'INFO_TEXT' => 'News',
59
					'USERNAME_FIELDNAME' => $username_fieldname,
60
					'PASSWORD_FIELDNAME' => $password_fieldname,
61
					'REMEMBER_ME_OPTION' => SMART_LOGIN,
62
					'MIN_USERNAME_LEN' => "2",
63
					'MIN_PASSWORD_LEN' => "2",
64
					'MAX_USERNAME_LEN' => "30",
65
					'MAX_PASSWORD_LEN' => "30",
66
					'LOGIN_URL' => ADMIN_URL."/login/index.php",
67
					'DEFAULT_URL' => ADMIN_URL."/start/index.php",
68
					'TEMPLATE_DIR' => $ThemePath,
69
					'TEMPLATE_FILE' => $LoginTpl,
70
					'FRONTEND' => false,
71
					'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
72
					'USERS_TABLE' => TABLE_PREFIX."users",
73
					'GROUPS_TABLE' => TABLE_PREFIX."groups",
74
			)
75 1457 Luisehahne
		);