1 |
4
|
ryan
|
<?php
|
2 |
|
|
|
3 |
310
|
ryan
|
// $Id$
|
4 |
4
|
ryan
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
310
|
ryan
|
Copyright (C) 2004-2006, Ryan Djurovich
|
9 |
4
|
ryan
|
|
10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with Website Baker; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
require_once("../../config.php");
|
27 |
|
|
require_once(WB_PATH."/framework/class.login.php");
|
28 |
|
|
|
29 |
|
|
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
|
30 |
|
|
// Generate username field name
|
31 |
|
|
$username_fieldname = 'username_';
|
32 |
|
|
$password_fieldname = 'password_';
|
33 |
|
|
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
|
34 |
|
|
srand((double)microtime()*1000000);
|
35 |
|
|
$i = 0;
|
36 |
|
|
while ($i <= 7) {
|
37 |
|
|
$num = rand() % 33;
|
38 |
|
|
$tmp = substr($salt, $num, 1);
|
39 |
|
|
$username_fieldname = $username_fieldname . $tmp;
|
40 |
|
|
$password_fieldname = $password_fieldname . $tmp;
|
41 |
|
|
$i++;
|
42 |
|
|
}
|
43 |
|
|
} else {
|
44 |
|
|
$username_fieldname = 'username';
|
45 |
|
|
$password_fieldname = 'password';
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
$thisApp = new Login(
|
49 |
|
|
array(
|
50 |
|
|
'MAX_ATTEMPS' => "50",
|
51 |
|
|
'WARNING_URL' => ADMIN_URL."/login/warning.html",
|
52 |
|
|
'USERNAME_FIELDNAME' => $username_fieldname,
|
53 |
|
|
'PASSWORD_FIELDNAME' => $password_fieldname,
|
54 |
|
|
'REMEMBER_ME_OPTION' => SMART_LOGIN,
|
55 |
|
|
'MIN_USERNAME_LEN' => "2",
|
56 |
|
|
'MIN_PASSWORD_LEN' => "2",
|
57 |
|
|
'MAX_USERNAME_LEN' => "30",
|
58 |
|
|
'MAX_PASSWORD_LEN' => "30",
|
59 |
|
|
'LOGIN_URL' => ADMIN_URL."/login/index.php",
|
60 |
|
|
'DEFAULT_URL' => ADMIN_URL."/start/index.php",
|
61 |
|
|
'TEMPLATE_DIR' => ADMIN_PATH."/login",
|
62 |
|
|
'TEMPLATE_FILE' => "template.html",
|
63 |
|
|
'FRONTEND' => false,
|
64 |
|
|
'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
|
65 |
|
|
'USERS_TABLE' => TABLE_PREFIX."users",
|
66 |
|
|
'GROUPS_TABLE' => TABLE_PREFIX."groups",
|
67 |
|
|
)
|
68 |
|
|
);
|
69 |
|
|
|
70 |
|
|
?>
|