1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package login
|
6
|
* @author Ryan Djurovich, WebsiteBaker Project
|
7
|
* @copyright 2009-2012, 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: index.php 1782 2012-10-11 12:29:11Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/login/index.php $
|
14
|
* @lastmodified $Date: 2012-10-11 14:29:11 +0200 (Thu, 11 Oct 2012) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
// Include the configuration file
|
19
|
if(!defined('WB_URL') && file_exists(realpath('../../config.php'))) {
|
20
|
require('../../config.php');
|
21
|
}
|
22
|
|
23
|
//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
|
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
|
$admin = new frontend();
|
47
|
|
48
|
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
|
49
|
|
50
|
$LoginTpl = 'loginBox.htt';
|
51
|
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
|
52
|
|
53
|
$thisApp = new Login( array(
|
54
|
'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
|
);
|
75
|
//$admin->print_footer();
|