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 1625 2012-02-29 00:50:57Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/login/index.php $
14
 * @lastmodified    $Date: 2012-02-29 01:50:57 +0100 (Wed, 29 Feb 2012) $
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

    
42
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
43
// Setup template object, parse vars to it, then parse it
44
$ThemePath = dirname($admin->correct_theme_source('login.htt'));
45

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