Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         login
6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, 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 1529 2011-11-25 05:03:32Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/login/index.php $
14
 * @lastmodified    $Date: 2011-11-25 06:03:32 +0100 (Fri, 25 Nov 2011) $
15
 *
16
*/
17

    
18
require_once("../../config.php");
19
require_once(WB_PATH."/framework/class.login.php");
20

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

    
40
$admin = new admin('Start', '', false, false);
41
$ThemeUrl = WB_URL.$admin->correct_theme_source('warning.html');
42
// Setup template object, parse vars to it, then parse it
43
$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('login.htt'));
44

    
45
$thisApp = new Login( array(
46
						'MAX_ATTEMPS' => "3",
47
						'WARNING_URL' => $ThemeUrl.'/warning.html',
48
						'USERNAME_FIELDNAME' => $username_fieldname,
49
						'PASSWORD_FIELDNAME' => $password_fieldname,
50
						'REMEMBER_ME_OPTION' => SMART_LOGIN,
51
						'MIN_USERNAME_LEN' => "2",
52
						'MIN_PASSWORD_LEN' => "2",
53
						'MAX_USERNAME_LEN' => "30",
54
						'MAX_PASSWORD_LEN' => "30",
55
						'LOGIN_URL' => ADMIN_URL."/login/index.php",
56
						'DEFAULT_URL' => ADMIN_URL."/start/index.php",
57
						'TEMPLATE_DIR' => $ThemePath,
58
						'TEMPLATE_FILE' => "login.htt",
59
						'FRONTEND' => false,
60
						'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
61
						'USERS_TABLE' => TABLE_PREFIX."users",
62
						'GROUPS_TABLE' => TABLE_PREFIX."groups",
63
				)
64
		);
    (1-1/1)