Project

General

Profile

1 432 doc
<?php
2 1247 Luisehahne
/****************************************************************************
3
* SVN Version information:
4
*
5
* $Id$
6
*
7
*****************************************************************************
8
*                          WebsiteBaker
9
*
10
* WebsiteBaker Project <http://www.websitebaker2.org/>
11
* Copyright (C) 2009, Website Baker Org. e.V.
12
*         http://start.websitebaker2.org/impressum-datenschutz.php
13
* Copyright (C) 2004-2009, Ryan Djurovich
14
*
15
*                        About WebsiteBaker
16
*
17
* Website Baker is a PHP-based Content Management System (CMS)
18
* designed with one goal in mind: to enable its users to produce websites
19
* with ease.
20
*
21
*****************************************************************************
22
*
23
*****************************************************************************
24
*                        LICENSE INFORMATION
25
*
26
* WebsiteBaker is free software; you can redistribute it and/or
27
* modify it under the terms of the GNU General Public License
28
* as published by the Free Software Foundation; either version 2
29
* of the License, or (at your option) any later version.
30
*
31
* WebsiteBaker is distributed in the hope that it will be useful,
32
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34
* See the GNU General Public License for more details.
35
*
36
* You should have received a copy of the GNU General Public License
37
* along with this program; if not, write to the Free Software
38
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39
****************************************************************************
40
*
41
*****************************************************************************
42
*                   WebsiteBaker Extra Information
43
*
44
*
45
*
46
*
47
*****************************************************************************/
48
/**
49
 * @category    admin
50
 * @package     login
51
 * @author      Ryan Djurovich
52
 * @copyright   2004-2009, Ryan Djurovich
53
 * @copyright   2009-2010, Website Baker Org. e.V.
54
 * @version     $Id$
55
 * @platform    WebsiteBaker 2.8.x
56
 * @requirements >= PHP 4.3.4
57
 * @license     http://www.gnu.org/licenses/gpl.html
58
 *
59
 */
60 432 doc
61
require_once("../../config.php");
62
require_once(WB_PATH."/framework/class.login.php");
63
64
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
65
	// Generate username field name
66
	$username_fieldname = 'username_';
67
	$password_fieldname = 'password_';
68
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
69
	srand((double)microtime()*1000000);
70
	$i = 0;
71
	while ($i <= 7) {
72
		$num = rand() % 33;
73
		$tmp = substr($salt, $num, 1);
74
		$username_fieldname = $username_fieldname . $tmp;
75
		$password_fieldname = $password_fieldname . $tmp;
76
		$i++;
77
	}
78
} else {
79
	$username_fieldname = 'username';
80
	$password_fieldname = 'password';
81
}
82
83
$thisApp = new Login(
84
							array(
85
									'MAX_ATTEMPS' => "3",
86 949 Ruebenwurz
									'WARNING_URL' => THEME_URL."/templates/warning.html",
87 432 doc
									'USERNAME_FIELDNAME' => $username_fieldname,
88
									'PASSWORD_FIELDNAME' => $password_fieldname,
89
									'REMEMBER_ME_OPTION' => SMART_LOGIN,
90
									'MIN_USERNAME_LEN' => "2",
91
									'MIN_PASSWORD_LEN' => "2",
92
									'MAX_USERNAME_LEN' => "30",
93
									'MAX_PASSWORD_LEN' => "30",
94
									'LOGIN_URL' => ADMIN_URL."/login/index.php",
95
									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
96 944 Ruebenwurz
									'TEMPLATE_DIR' => THEME_PATH."/templates",
97
									'TEMPLATE_FILE' => "login.htt",
98 432 doc
									'FRONTEND' => false,
99
									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
100
									'USERS_TABLE' => TABLE_PREFIX."users",
101
									'GROUPS_TABLE' => TABLE_PREFIX."groups",
102
							)
103
					);
104
105 4 ryan
?>