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
$ThemeUrl = WB_URL.$admin->correct_theme_source('warning.html');
42
// Setup template object, parse vars to it, then parse it
43
$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('login.htt'));
44
45 1457 Luisehahne
$thisApp = new Login( array(
46
						'MAX_ATTEMPS' => "3",
47 1529 Luisehahne
						'WARNING_URL' => $ThemeUrl.'/warning.html',
48 1457 Luisehahne
						'USERNAME_FIELDNAME' => $username_fieldname,
49
						'PASSWORD_FIELDNAME' => $password_fieldname,
50
						'REMEMBER_ME_OPTION' => SMART_LOGIN,
51
						'MIN_USERNAME_LEN' => "2",
52
						'MIN_PASSWORD_LEN' => "2",
53
						'MAX_USERNAME_LEN' => "30",
54
						'MAX_PASSWORD_LEN' => "30",
55
						'LOGIN_URL' => ADMIN_URL."/login/index.php",
56
						'DEFAULT_URL' => ADMIN_URL."/start/index.php",
57 1529 Luisehahne
						'TEMPLATE_DIR' => $ThemePath,
58 1457 Luisehahne
						'TEMPLATE_FILE' => "login.htt",
59
						'FRONTEND' => false,
60
						'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
61
						'USERS_TABLE' => TABLE_PREFIX."users",
62
						'GROUPS_TABLE' => TABLE_PREFIX."groups",
63
				)
64
		);