Project

General

Profile

1 1425 Luisehahne
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         login
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
*/
18
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 1457 Luisehahne
$thisApp = new Login( array(
42
						'MAX_ATTEMPS' => "3",
43
						'WARNING_URL' => THEME_URL."/templates/warning.html",
44
						'USERNAME_FIELDNAME' => $username_fieldname,
45
						'PASSWORD_FIELDNAME' => $password_fieldname,
46
						'REMEMBER_ME_OPTION' => SMART_LOGIN,
47
						'MIN_USERNAME_LEN' => "2",
48
						'MIN_PASSWORD_LEN' => "2",
49
						'MAX_USERNAME_LEN' => "30",
50
						'MAX_PASSWORD_LEN' => "30",
51
						'LOGIN_URL' => ADMIN_URL."/login/index.php",
52
						'DEFAULT_URL' => ADMIN_URL."/start/index.php",
53
						'TEMPLATE_DIR' => THEME_PATH."/templates",
54
						'TEMPLATE_FILE' => "login.htt",
55
						'FRONTEND' => false,
56
						'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
57
						'USERS_TABLE' => TABLE_PREFIX."users",
58
						'GROUPS_TABLE' => TABLE_PREFIX."groups",
59
				)
60
		);