Project

General

Profile

1 1425 Luisehahne
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         login
6 1529 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1425 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @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
*/
17
18
require_once("../../config.php");
19
require_once(WB_PATH."/framework/class.login.php");
20
21
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
22
	// Generate username field name
23
	$username_fieldname = 'username_';
24
	$password_fieldname = 'password_';
25
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
26
	srand((double)microtime()*1000000);
27
	$i = 0;
28
	while ($i <= 7) {
29
		$num = rand() % 33;
30
		$tmp = substr($salt, $num, 1);
31
		$username_fieldname = $username_fieldname . $tmp;
32
		$password_fieldname = $password_fieldname . $tmp;
33
		$i++;
34
	}
35
} else {
36
	$username_fieldname = 'username';
37
	$password_fieldname = 'password';
38
}
39
40 1529 Luisehahne
$admin = new admin('Start', '', false, false);
41 1625 Luisehahne
42
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
43 1529 Luisehahne
// Setup template object, parse vars to it, then parse it
44 1625 Luisehahne
$ThemePath = dirname($admin->correct_theme_source('login.htt'));
45 1529 Luisehahne
46 1457 Luisehahne
$thisApp = new Login( array(
47
						'MAX_ATTEMPS' => "3",
48 1625 Luisehahne
						'WARNING_URL' => $WarnUrl,
49 1457 Luisehahne
						'USERNAME_FIELDNAME' => $username_fieldname,
50
						'PASSWORD_FIELDNAME' => $password_fieldname,
51
						'REMEMBER_ME_OPTION' => SMART_LOGIN,
52
						'MIN_USERNAME_LEN' => "2",
53
						'MIN_PASSWORD_LEN' => "2",
54
						'MAX_USERNAME_LEN' => "30",
55
						'MAX_PASSWORD_LEN' => "30",
56
						'LOGIN_URL' => ADMIN_URL."/login/index.php",
57
						'DEFAULT_URL' => ADMIN_URL."/start/index.php",
58 1529 Luisehahne
						'TEMPLATE_DIR' => $ThemePath,
59 1457 Luisehahne
						'TEMPLATE_FILE' => "login.htt",
60
						'FRONTEND' => false,
61
						'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
62
						'USERS_TABLE' => TABLE_PREFIX."users",
63
						'GROUPS_TABLE' => TABLE_PREFIX."groups",
64
				)
65
		);