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 1805 2012-11-04 00:53:51Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/login/index.php $
14
 * @lastmodified    $Date: 2012-11-04 01:53:51 +0100 (Sun, 04 Nov 2012) $
15
 *
16
 */
17

    
18
// Include the configuration file
19
$config_file = realpath('../../config.php');
20
if(file_exists($config_file) && !defined('WB_URL'))
21
{
22
	require_once($config_file);
23
}
24

    
25
if(!class_exists('login', false)){ require_once(WB_PATH.'/framework/class.login.php'); }
26
if(!class_exists('frontend', false)){ require_once(WB_PATH.'/framework/class.frontend.php'); }
27

    
28
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
29
	// Generate username field name
30
	$username_fieldname = 'username_';
31
	$password_fieldname = 'password_';
32
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
33
	srand((double)microtime()*1000000);
34
	$i = 0;
35
	while ($i <= 7) {
36
		$num = rand() % 33;
37
		$tmp = substr($salt, $num, 1);
38
		$username_fieldname = $username_fieldname . $tmp;
39
		$password_fieldname = $password_fieldname . $tmp;
40
		$i++;
41
	}
42
} else {
43
	$username_fieldname = 'username';
44
	$password_fieldname = 'password';
45
}
46

    
47
$admin = new frontend();
48

    
49
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
50

    
51
$LoginTpl = 'loginBox.htt';
52
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
53

    
54
$thisApp = new Login( array(
55
					'MAX_ATTEMPS' => "3",
56
					'WARNING_URL' => $WarnUrl,
57
					'INFO_URL' => '##',
58
					'INFO_TEXT' => 'News',
59
					'USERNAME_FIELDNAME' => $username_fieldname,
60
					'PASSWORD_FIELDNAME' => $password_fieldname,
61
					'REMEMBER_ME_OPTION' => SMART_LOGIN,
62
					'MIN_USERNAME_LEN' => "2",
63
					'MIN_PASSWORD_LEN' => "2",
64
					'MAX_USERNAME_LEN' => "30",
65
					'MAX_PASSWORD_LEN' => "30",
66
					'LOGIN_URL' => ADMIN_URL."/login/index.php",
67
					'DEFAULT_URL' => ADMIN_URL."/start/index.php",
68
					'TEMPLATE_DIR' => $ThemePath,
69
					'TEMPLATE_FILE' => $LoginTpl,
70
					'FRONTEND' => false,
71
					'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
72
					'USERS_TABLE' => TABLE_PREFIX."users",
73
					'GROUPS_TABLE' => TABLE_PREFIX."groups",
74
			)
75
		);
    (1-1/1)