forked from WBCE/WBCE_CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
65 lines (60 loc) · 2.18 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
*
* @category admin
* @package login
* @author Ryan Djurovich, WebsiteBaker Project
* @copyright 2009-2011, Website Baker Org. e.V.
* @link http://www.websitebaker2.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.x
* @requirements PHP 5.2.2 and higher
* @version $Id: index.php 1625 2012-02-29 00:50:57Z Luisehahne $
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/admin/login/index.php $
* @lastmodified $Date: 2012-02-29 01:50:57 +0100 (Mi, 29. Feb 2012) $
*
*/
require_once("../../config.php");
require_once(WB_PATH."/framework/class.login.php");
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
// Generate username field name
$username_fieldname = 'username_';
$password_fieldname = 'password_';
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$username_fieldname = $username_fieldname . $tmp;
$password_fieldname = $password_fieldname . $tmp;
$i++;
}
} else {
$username_fieldname = 'username';
$password_fieldname = 'password';
}
$admin = new admin('Start', '', false, false);
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
// Setup template object, parse vars to it, then parse it
$ThemePath = dirname($admin->correct_theme_source('login.htt'));
$thisApp = new Login( array(
'MAX_ATTEMPS' => "3",
'WARNING_URL' => $WarnUrl,
'USERNAME_FIELDNAME' => $username_fieldname,
'PASSWORD_FIELDNAME' => $password_fieldname,
'REMEMBER_ME_OPTION' => SMART_LOGIN,
'MIN_USERNAME_LEN' => "2",
'MIN_PASSWORD_LEN' => "3",
'MAX_USERNAME_LEN' => "30",
'MAX_PASSWORD_LEN' => "30",
'LOGIN_URL' => ADMIN_URL."/login/index.php",
'DEFAULT_URL' => ADMIN_URL."/start/index.php",
'TEMPLATE_DIR' => $ThemePath,
'TEMPLATE_FILE' => "login.htt",
'FRONTEND' => false,
'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
'USERS_TABLE' => TABLE_PREFIX."users",
'GROUPS_TABLE' => TABLE_PREFIX."groups",
)
);