Project

General

Profile

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 2119 2014-12-28 21:44:13Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/login/index.php $
14
 * @lastmodified    $Date: 2014-12-28 22:44:13 +0100 (Sun, 28 Dec 2014) $
15
 *
16
 */
17

    
18
// Include the configuration file
19
$sStartFile = dirname(dirname(__DIR__)).'/framework/initialize.php';
20
if (!defined('SYSTEM_RUN')) {
21
	require($sStartFile);
22
}
23
//if(!class_exists('login', false)){ require_once(WB_PATH.'/framework/class.login.php'); }
24
//if(!class_exists('frontend', false)){ require_once(WB_PATH.'/framework/class.frontend.php'); }
25

    
26
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
27
	// Generate username field name
28
	$username_fieldname = 'username_';
29
	$password_fieldname = 'password_';
30
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
31
	srand((double)microtime()*1000000);
32
	$i = 0;
33
	while ($i <= 7) {
34
		$num = rand() % 33;
35
		$tmp = substr($salt, $num, 1);
36
		$username_fieldname = $username_fieldname . $tmp;
37
		$password_fieldname = $password_fieldname . $tmp;
38
		$i++;
39
	}
40
} else {
41
	$username_fieldname = 'username';
42
	$password_fieldname = 'password';
43
}
44
$admin = new frontend();
45
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
46
$LoginTpl = 'loginBox.htt';
47
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
48
$thisApp = new Login( array(
49
        'MAX_ATTEMPS'           => '3',
50
        'WARNING_URL'           => $WarnUrl,
51
        'INFO_URL'              => '##',
52
        'INFO_TEXT'             => 'News',
53
        'USERNAME_FIELDNAME'    => $username_fieldname,
54
        'PASSWORD_FIELDNAME'    => $password_fieldname,
55
        'REMEMBER_ME_OPTION'    => SMART_LOGIN,
56
        'MIN_USERNAME_LEN'      => '2',
57
        'MIN_PASSWORD_LEN'      => '3',
58
        'MAX_USERNAME_LEN'      => '30',
59
        'MAX_PASSWORD_LEN'      => '30',
60
        'LOGIN_URL'             => ADMIN_URL."/login/index.php",
61
        'DEFAULT_URL'           => ADMIN_URL."/start/index.php",
62
        'TEMPLATE_DIR'          => $ThemePath,
63
        'TEMPLATE_FILE'         => $LoginTpl,
64
        'FRONTEND'              => false,
65
        'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
66
        'USERS_TABLE'           => TABLE_PREFIX."users",
67
        'GROUPS_TABLE'          => TABLE_PREFIX."groups",
68
    )
69
);
    (1-1/1)