Project

General

Profile

1 432 doc
<?php
2 1247 Luisehahne
/**
3
 *
4 1269 Luisehahne
 * @category        admin
5
 * @package         login
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8 1349 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
9 1269 Luisehahne
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12 1374 Luisehahne
 * @requirements    PHP 5.2.2 and higher
13 1269 Luisehahne
 * @version         $Id$
14 1270 Luisehahne
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16 1269 Luisehahne
 *
17
*/
18 432 doc
19
require_once("../../config.php");
20
require_once(WB_PATH."/framework/class.login.php");
21
22
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
23
	// Generate username field name
24
	$username_fieldname = 'username_';
25
	$password_fieldname = 'password_';
26
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
27
	srand((double)microtime()*1000000);
28
	$i = 0;
29
	while ($i <= 7) {
30
		$num = rand() % 33;
31
		$tmp = substr($salt, $num, 1);
32
		$username_fieldname = $username_fieldname . $tmp;
33
		$password_fieldname = $password_fieldname . $tmp;
34
		$i++;
35
	}
36
} else {
37
	$username_fieldname = 'username';
38
	$password_fieldname = 'password';
39
}
40
41
$thisApp = new Login(
42
							array(
43
									'MAX_ATTEMPS' => "3",
44 949 Ruebenwurz
									'WARNING_URL' => THEME_URL."/templates/warning.html",
45 432 doc
									'USERNAME_FIELDNAME' => $username_fieldname,
46
									'PASSWORD_FIELDNAME' => $password_fieldname,
47
									'REMEMBER_ME_OPTION' => SMART_LOGIN,
48
									'MIN_USERNAME_LEN' => "2",
49
									'MIN_PASSWORD_LEN' => "2",
50
									'MAX_USERNAME_LEN' => "30",
51
									'MAX_PASSWORD_LEN' => "30",
52
									'LOGIN_URL' => ADMIN_URL."/login/index.php",
53
									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
54 944 Ruebenwurz
									'TEMPLATE_DIR' => THEME_PATH."/templates",
55
									'TEMPLATE_FILE' => "login.htt",
56 432 doc
									'FRONTEND' => false,
57
									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
58
									'USERS_TABLE' => TABLE_PREFIX."users",
59
									'GROUPS_TABLE' => TABLE_PREFIX."groups",
60
							)
61
					);
62
63 4 ryan
?>