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 2098 darkviper
if(file_exists($config_file) && !defined('WB_URL')) {
21 1805 Luisehahne
	require_once($config_file);
22 1709 Luisehahne
}
23 2098 darkviper
//if(!class_exists('login', false)){ require_once(WB_PATH.'/framework/class.login.php'); }
24
//if(!class_exists('frontend', false)){ require_once(WB_PATH.'/framework/class.frontend.php'); }
25 1425 Luisehahne
26
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
27
	// Generate username field name
28
	$username_fieldname = 'username_';
29
	$password_fieldname = 'password_';
30
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
31
	srand((double)microtime()*1000000);
32
	$i = 0;
33
	while ($i <= 7) {
34
		$num = rand() % 33;
35
		$tmp = substr($salt, $num, 1);
36
		$username_fieldname = $username_fieldname . $tmp;
37
		$password_fieldname = $password_fieldname . $tmp;
38
		$i++;
39
	}
40
} else {
41
	$username_fieldname = 'username';
42
	$password_fieldname = 'password';
43
}
44 1782 Luisehahne
$admin = new frontend();
45 1625 Luisehahne
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
46 1709 Luisehahne
$LoginTpl = 'loginBox.htt';
47
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
48 1457 Luisehahne
$thisApp = new Login( array(
49 2098 darkviper
        'MAX_ATTEMPS'           => '3',
50
        'WARNING_URL'           => $WarnUrl,
51
        'INFO_URL'              => '##',
52
        'INFO_TEXT'             => 'News',
53
        'USERNAME_FIELDNAME'    => $username_fieldname,
54
        'PASSWORD_FIELDNAME'    => $password_fieldname,
55
        'REMEMBER_ME_OPTION'    => SMART_LOGIN,
56
        'MIN_USERNAME_LEN'      => '2',
57
        'MIN_PASSWORD_LEN'      => '6',
58
        'MAX_USERNAME_LEN'      => '30',
59
        'MAX_PASSWORD_LEN'      => '30',
60
        'LOGIN_URL'             => ADMIN_URL."/login/index.php",
61
        'DEFAULT_URL'           => ADMIN_URL."/start/index.php",
62
        'TEMPLATE_DIR'          => $ThemePath,
63
        'TEMPLATE_FILE'         => $LoginTpl,
64
        'FRONTEND'              => false,
65
        'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
66
        'USERS_TABLE'           => TABLE_PREFIX."users",
67
        'GROUPS_TABLE'          => TABLE_PREFIX."groups",
68
    )
69
);