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