Project

General

Profile

« Previous | Next » 

Revision 1782

Added by Dietmar about 12 years ago

+ add maintance modus in backend

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
11 Oct-2012 Build 1782 Dietmar Woellbrink (Luisehahne)
17
+ add maintance modus in backend
16 18
10 Oct-2012 Build 1781 Dietmar Woellbrink (Luisehahne)
17 19
! fixed form modul (Tks to Ruebenwurzel)
18 20
! Send forgotten Theme CSS in Revision 1780
branches/2.8.x/wb/admin/groups/groups_list.inc.php
25 25
 */
26 26
	function show_grouplist($admin)
27 27
	{
28
//		global $TEXT, $MESSAGE, $MENU, $HEADING;
28
		global $TEXT, $MESSAGE, $MENU, $HEADING;
29 29
		$database = WbDatabase::getInstance();
30 30
		$mLang = ModLanguage::getInstance();
31 31
// Create new template object for the modify/remove section
......
140 140
		$tpl->set_var(array(
141 141
				'TEXT_MODIFY'    => ($admin->get_permission('groups_modify') == true) ? $mLang->TEXT_MODIFY : $mLang->TEXT_VIEW,
142 142
				'TEXT_DELETE'    => $mLang->TEXT_DELETE,
143
				'CONFIRM_DELETE' => $mLang->MESSAGE_GROUPS_CONFIRM_DELETE
143
				'CONFIRM_DELETE' => $MESSAGE['GROUPS_CONFIRM_DELETE']
144 144
				));
145 145

  
146 146
	// Parse template object
branches/2.8.x/wb/admin/skel/themes/htt/maintance.htt
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
<head>
4
    <title>CMS WebsiteBaker | {PAGE_TITLE}</title>
5
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="content-language" content="{LANGUAGE}" />
7
    <meta name="description" content="{PAGE_TITLE}" />
8
    <meta name="keywords" content="{PAGE_TITLE}" />
9
    <link href="{THEME_URL}/css/warn.css" rel="stylesheet" type="text/css" />
10
</head>
11

  
12
<body>
13

  
14
<div class="main">
15
    <table class="header layout">
16
        <tr>
17
        	<td class="logo">
18
        		<a href="http://www.websitebaker2.org/" title=""><img src="{THEME_URL}/images/logo.png" alt="Logo" /></a>
19
        	</td>
20
        	<td></td>
21
        </tr>
22
    </table>
23

  
24
    <div class="table">
25
        <div class="td">
26
            <div class="content">
27
                <div class="login_box">
28
                        <div class="topdiv">
29
                        OFF-LINE - {WB_URL}
30
                        </div>
31
                        <div class="bottomdiv">
32
        					<h3>{PAGE_TITLE}</h3>
33
        					<h3>{BE_PATIENT}</h3>
34
        					<img src="{THEME_URL}/images/{PAGE_ICON}.png" alt="{PAGE_TITLE}" /><br />
35
        					<h3>{CHECK_BACK}</h3>
36
                        </div>
37
                </div>
38
            </div>
39
        </div>
40
    </div>
41
    <table class="footer">
42
    <tbody>
43
        <tr>
44
        	<td>
45
              <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
46
              <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
47
              <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
48
              <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
49
        	</td>
50
        </tr>
51
        </tbody>
52
    </table>
53
</div>
54
</body>
55
</html>
56
<!--- Icons from http://www.iconfinder.com Filter: Allowed for commercial use (No link required) -->
57
<!--- Icon Designer David Vignoni - http://www.icon-king.com/ License: http://www.gnu.org/licenses/lgpl.html -->
0 58

  
branches/2.8.x/wb/admin/skel/themes/htt/header.htt
43 43
	<td></td>
44 44
	<td class="topnav {LOGIN_DISPLAY_NONE}">
45 45
		<span><a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/{START_ICON}.png" alt="{TITLE_START}" /></a></span>
46
		&nbsp;&nbsp;<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
47
		&nbsp; <a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
48
		&nbsp; <a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
46
		<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
47
		<a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
48
    <!-- BEGIN maintenance_block -->
49
        <a href="{MAINTAINANCE_URL}" title="{MAINTENANCE_MODE}"><img src="{MAINTENANCE_ICON}" alt="{MAINTENANCE_MODE}" title="{MAINTENANCE_MODE}" /></a>
50
    <!-- END maintenance_block -->
51
		&nbsp;<a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
49 52
	</td>
50 53
	<td></td>
51 54
	<td class="version {LOGIN_DISPLAY_NONE}">
branches/2.8.x/wb/admin/pages/settings_save.php
75 75
$template = preg_replace('/[^a-z0-9_-]/i', "", $admin->get_post('template')); // fix secunia 2010-93-3
76 76
$template = (($template == DEFAULT_TEMPLATE ) ? '' : $template);
77 77
$target = preg_replace("/\W/", "", $admin->get_post('target'));
78
$aAdminGroups   = (isset($_POST['admin_groups']) ? $_POST['admin_groups'] : array(1));
78
$aAdminGroups   = (isset($_POST['admin_groups']) ? $_POST['admin_groups'] : array('1'));
79 79
$aAdminUsers    = (isset($_POST['admin_users']) ? $_POST['admin_users'] : array());
80
$aViewingGroups = (isset($_POST['viewing_groups']) ? $_POST['viewing_groups'] : array(1));
80
$aViewingGroups = (isset($_POST['viewing_groups']) ? $_POST['viewing_groups'] : array('1'));
81 81
$aViewingUsers  = (isset($_POST['viewing_users']) ? $_POST['viewing_users'] : array());
82 82
$searching = intval($admin->get_post('searching'));
83 83
$language = strtoupper($admin->get_post('language'));
branches/2.8.x/wb/admin/pages/languages/EN.php
75 75
$HELP['PAGE_CODE'] .= '<p>If you have put a side into another language, confirm from this list the matching entry of the standard language</p>';
76 76
$HELP['PAGE_CODE'] .= '<p>Example:<br />Created page in sub DE: <b>Impressum</b> choose Default Language EN: <b>Imprint</b></p>';
77 77

  
78
$HELP['SEO_TITLE']  = '<p>Folder and Filename for this Accessfile <br /> <b>{{filename}}</b></p>';
79
$HELP['SEO_TITLE'] .= '<p>In WebsiteBaker version 2.8.4 you have the possibility to create a Seo friendly Accessfile independent of Menutitle..</p>';
78
$HELP['SEO_TITLE']  = '<p>Path and file name of the access file of this page. <br /> <b>{{filename}}</b></p>';
79
$HELP['SEO_TITLE'] .= '<p>In this field you can define a well readable, expressive name for the access file, regardless of menu title or page title. This is also usable well to create SEO friendly links..</p>';
80 80
$HELP['SEO_TITLE'] .= '<p><b>For Example:</b><br /><br />Input Menu Title: <b>Pressemitteilung</b><br />';
81 81
$HELP['SEO_TITLE'] .= 'Input Filename: <b>Pressemitteilung and Downloads</b><br />';
82 82
$HELP['SEO_TITLE'] .= 'Create Accessfile: <b>pressemitteilungen-and-downloads.php</b></p>';
branches/2.8.x/wb/admin/pages/languages/DE.php
73 73
$HELP['PAGE_CODE'] .= '<p>Wenn sie eine Seite in einer anderen Sprache angelegt haben, bestätigen Sie aus dieser Liste den dazugehörigen Eintrag der Standardsprache.</p>';
74 74
$HELP['PAGE_CODE'] .= '<p>Beispiel:<br />Erstellte Seite im Zweig EN: <b>Imprint</b> zuweisen an Standardsprache DE: <b>Impressum</b></p>';
75 75

  
76
$HELP['SEO_TITLE']  = '<p>Verzeichnis und Dateiname dieser Zugriffsdatei <br /> <b>{{filename}}</b></p>';
77
$HELP['SEO_TITLE'] .= '<p>In der WebsiteBaker Version 2.8.4 haben Sie die Möglichkeit, unabhängig vom Menutitel eine Seo freundliche Zugriffsdatei anzulegen.</p>';
76
$HELP['SEO_TITLE']  = '<p>Verzeichnis und Dateiname der Zugriffsdatei dieser Seite<br /> <b>{{filename}}</b></p>';
77
$HELP['SEO_TITLE'] .= '<p>In diesem Feld können Sie unabhängig von Menü- oder Seitentitel einen gut lesbaren, aussagekräftigen Dateinamen für die Zugriffsdatei festlegen. Dieser ist auch gut zur Erstellung SEO-freundlicher Links verwendbar.</p>';
78 78
$HELP['SEO_TITLE'] .= '<p><b>Beispiel:</b><br /><br />Eingabe Menütitel: <b>Pressemitteilung</b><br />';
79 79
$HELP['SEO_TITLE'] .= 'Eingabe Dateiname: <b>Pressemitteilung und Downloads</b><br />';
80 80
$HELP['SEO_TITLE'] .= 'Erstellt Zugriffsdatei: <b>pressemitteilungen-und-downloads.php</b></p>';
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1781');
54
if(!defined('REVISION')) define('REVISION', '1782');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/settings/locking.php
1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         login
6
 * @author          Ryan Djurovich (2004-2009)), WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.9
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
*/
17
if(!defined('WB_PATH'))
18
{
19
	require('../../config.php');
20
	require_once(WB_PATH.'/framework/class.admin.php');
21
}
22
$admin = new admin('Start', 'settings', false, false);
23

  
24
if($admin->get_user_id() == 1)
25
{
26
	$val = (((int)(defined('SYSTEM_LOCKED') ? SYSTEM_LOCKED : 0)) + 1) % 2;
27
	$sql = 'SELECT COUNT(`setting_id`) FROM `'.TABLE_PREFIX.'settings` WHERE `name` = \'system_locked\'';
28
	if($database->get_one($sql))
29
	{
30
		$sql = 'UPDATE ';
31
		$sql_where = 'WHERE `name` = \'system_locked\'';
32
	} else {
33
		$sql = 'INSERT INTO ';
34
		$sql_where = '';
35
	}
36
	$sql .= '`'.TABLE_PREFIX.'settings` ';
37
	$sql .= 'SET `name` = \'system_locked\', ';
38
	$sql .= '`value` = \''.$val.'\' '.$sql_where;
39
	$database->query($sql);
40
}
41
// redirect to backend
42
header('Location: ' . ADMIN_URL . '/index.php');
43
exit();
0 44

  
branches/2.8.x/wb/admin/preferences/save.php
52 52
	$date_format = (array_key_exists($date_format_key, $DATE_FORMATS) ? $date_format : 'system_default');
53 53
	$date_format = ($date_format == 'system_default' ? '' : $date_format);
54 54
	unset($DATE_FORMATS);
55
// time_format must be a key from /interface/time_formats	
55
// time_format must be a key from /interface/time_formats
56 56
	$time_format      = $admin->get_post('time_format');
57 57
	$time_format_key  = str_replace(' ', '|', $time_format);
58 58
	$user_time = true;
branches/2.8.x/wb/admin/login/forgot/index.php
3 3
 *
4 4
 * @category        admin
5 5
 * @package         login
6
 * @author          Ryan Djurovich, WebsiteBaker Project
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7 7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
......
21 21
}
22 22
// Include the language file
23 23
require(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
24

  
24 25
// Include the database class file and initiate an object
25
require(WB_PATH.'/framework/class.admin.php');
26
//if(!class_exists('frontend', false)){ require_once(WB_PATH.'/framework/class.frontend.php'); }
27
//$admin = new frontend();
28
if(!class_exists('admin', false)){ require_once(WB_PATH.'/framework/class.admin.php'); }
26 29
$admin = new admin('Start', 'start', false, false);
27 30

  
28 31
// Get the website title
......
50 53
		if($time_diff < 2) {
51 54

  
52 55
			// Tell the user that their password cannot be reset more than once per hour
53
			$message = $MESSAGE['FORGOT_PASS']['ALREADY_RESET'];
56
			$message = $MESSAGE['FORGOT_PASS_ALREADY_RESET'];
54 57

  
55 58
		} else {
56 59

  
......
76 79
			} else {
77 80
				// Setup email to send
78 81
				$mail_to = $email;
79
				$mail_subject = $MESSAGE['SIGNUP2']['SUBJECT_LOGIN_INFO'];
82
				$mail_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'];
80 83

  
81 84
				// Replace placeholders from language variable with values
82 85
				$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
83 86
				$replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass);
84
				$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2']['BODY_LOGIN_FORGOT']);
87
				$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2_BODY_LOGIN_FORGOT']);
85 88

  
86 89
				// Try sending the email
87 90
				if($admin->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
88
					$message = $MESSAGE['FORGOT_PASS']['PASSWORD_RESET'];
91
					$message = $MESSAGE['FORGOT_PASS_PASSWORD_RESET'];
89 92
					$display_form = false;
90 93
				} else {
91 94
					$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".$old_pass."' WHERE user_id = '".$results_array['user_id']."'");
92
					$message = $MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'];
95
					$message = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL'];
93 96
				}
94 97
			}
95 98

  
......
97 100

  
98 101
	} else {
99 102
		// Email doesn't exist, so tell the user
100
		$message = $MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND'];
103
		$message = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
101 104
		// and delete the wrong Email
102 105
		$email = '';
103 106
	}
......
107 110
}
108 111

  
109 112
if(!isset($message)) {
110
	$message = $MESSAGE['FORGOT_PASS']['NO_DATA'];
113
	$message = $MESSAGE['FORGOT_PASS_NO_DATA'];
111 114
	$message_color = '000000';
112 115
} else {
113 116
	$message_color = 'FF0000';
branches/2.8.x/wb/admin/login/index.php
15 15
 *
16 16
 */
17 17

  
18
	require('../../config.php');
19 18
// Include the configuration file
20 19
if(!defined('WB_URL') && file_exists(realpath('../../config.php'))) {
20
    require('../../config.php');
21 21
}
22
require_once(WB_PATH."/framework/class.login.php");
23 22

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

  
24 27
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
25 28
	// Generate username field name
26 29
	$username_fieldname = 'username_';
......
40 43
	$password_fieldname = 'password';
41 44
}
42 45

  
43
$admin = new admin('Start', '', false, false);
46
$admin = new frontend();
44 47

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

  
branches/2.8.x/wb/framework/class.admin.php
1 1
<?php
2 2
/**
3 3
 *
4
 * @category        framewotk
5
 * @package         backend admin
6
 * @author          Ryan Djurovich, WebsiteBaker Project
4
 * @category        backend
5
 * @package         framework
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7 7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
......
28 28

  
29 29
// Include EditArea wrapper functions
30 30
// require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
31
//require_once(WB_PATH . '/framework/SecureForm.php');
31
// require_once(WB_PATH . '/framework/SecureForm.php');
32 32

  
33 33

  
34 34
/**
......
53 53
	public function __construct($section_name= '##skip##', $section_permission = 'start', $auto_header = true, $auto_auth = true)
54 54
	{
55 55
		parent::__construct(SecureForm::BACKEND);
56
	if( $section_name != '##skip##' )
57
	{
58
		global $database, $MESSAGE;
59
		// Specify the current applications name
60
		$this->section_name = $section_name;
61
		$this->section_permission = $section_permission;
62
		// Authenticate the user for this application
63
		if($auto_auth == true)
64
		{
65
			// First check if the user is logged-in
66
			if($this->is_authenticated() == false)
56
    	if( $section_name != '##skip##' )
57
    	{
58
    		global $database, $MESSAGE;
59
    		// Specify the current applications name
60
    		$this->section_name = $section_name;
61
    		$this->section_permission = $section_permission;
62
    		$maintance = ( defined('SYSTEM_LOCKED') && (SYSTEM_LOCKED==true) ? true : false );
63
    		// Authenticate the user for this application
64
    		if( ($auto_auth == true) )
65
    		{
66
    			// First check if the user is logged-in
67
    			if($this->is_authenticated() == false)
68
    			{
69
    				header('Location: '.ADMIN_URL.'/login/index.php');
70
    				exit(0);
71
    			}
72
    			// Now check if they are allowed in this section
73
    			if($this->get_permission($section_permission) == false) {
74
    				die($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
75
    			}
76
    		}
77

  
78
			if( ($maintance==true) || $this->get_session('USER_ID')!= 1 )
67 79
			{
68
				header('Location: '.ADMIN_URL.'/login/index.php');
69
				exit(0);
70
			}
80
           	//  check for show maintenance screen and terminate if needed
81
        		$this->ShowMaintainScreen('locked');
82
            }
71 83

  
72
			// Now check if they are allowed in this section
73
			if($this->get_permission($section_permission) == false) {
74
				die($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
75
			}
76
		}
84
    		// Check if the backend language is also the selected language. If not, send headers again.
85
    		$sql  = 'SELECT `language` FROM `'.TABLE_PREFIX.'users` ';
86
    		$sql .= 'WHERE `user_id`='.(int)$this->get_user_id();
87
    		$get_user_language = @$database->query($sql);
88
    		$user_language = ($get_user_language) ? $get_user_language->fetchRow() : '';
89
    		// prevent infinite loop if language file is not XX.php (e.g. DE_du.php)
90
    		$user_language = substr($user_language[0],0,2);
91
    		// obtain the admin folder (e.g. /admin)
92
    		$admin_folder = str_replace(WB_PATH, '', ADMIN_PATH);
77 93

  
78
		// Check if the backend language is also the selected language. If not, send headers again.
79
		$sql  = 'SELECT `language` FROM `'.TABLE_PREFIX.'users` ';
80
		$sql .= 'WHERE `user_id`='.(int)$this->get_user_id();
81
		$get_user_language = @$database->query($sql);
82
		$user_language = ($get_user_language) ? $get_user_language->fetchRow() : '';
83
		// prevent infinite loop if language file is not XX.php (e.g. DE_du.php)
84
		$user_language = substr($user_language[0],0,2);
85
		// obtain the admin folder (e.g. /admin)
86
		$admin_folder = str_replace(WB_PATH, '', ADMIN_PATH);
87
		if((LANGUAGE != $user_language) && file_exists(WB_PATH .'/languages/' .$user_language .'.php')
88
			&& strpos($_SERVER['PHP_SELF'],$admin_folder.'/') !== false) {
89
			// check if page_id is set
90
			$page_id_url = (isset($_GET['page_id'])) ? '&page_id=' .(int) $_GET['page_id'] : '';
91
			$section_id_url = (isset($_GET['section_id'])) ? '&section_id=' .(int) $_GET['section_id'] : '';
92
			if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') { // check if there is an query-string
93
				header('Location: '.$_SERVER['PHP_SELF'] .'?lang='.$user_language .$page_id_url .$section_id_url.'&'.$_SERVER['QUERY_STRING']);
94
			} else {
95
				header('Location: '.$_SERVER['PHP_SELF'] .'?lang='.$user_language .$page_id_url .$section_id_url);
96
			}
97
			exit();
98
		}
94
    		if( (LANGUAGE != $user_language) && file_exists(WB_PATH .'/languages/' .$user_language .'.php')
95
    			&& strpos($_SERVER['SCRIPT_NAME'],$admin_folder.'/') !== false) {
96
    			// check if page_id is set
97
    			$page_id_url = (isset($_GET['page_id'])) ? '&page_id=' .(int) $_GET['page_id'] : '';
98
    			$section_id_url = (isset($_GET['section_id'])) ? '&section_id=' .(int) $_GET['section_id'] : '';
99
    			 //  check if there is an query-string
100
    			if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
101
    				header('Location: '.$_SERVER['SCRIPT_NAME'] .'?lang='.$user_language .$page_id_url .$section_id_url.'&'.$_SERVER['QUERY_STRING']);
102
    			} else {
103
    				header('Location: '.$_SERVER['SCRIPT_NAME'] .'?lang='.$user_language .$page_id_url .$section_id_url);
104
    			}
105
    			exit();
106
    		}
99 107

  
100
		// Auto header code
101
		if($auto_header == true) {
102
			$this->print_header();
103
		}
108
    		// Auto header code
109
    		if($auto_header == true) {
110
    			$this->print_header();
111
    		}
112
    	}
104 113
	}
105
	}
106 114

  
107 115
	// Print the admin header
108 116
	/**
109
	 * admin::print_header()
110 117
	 *
111 118
	 * @param string $body_tags
112 119
	 * @return void
......
143 150
			$row = @$result->fetchRow();
144 151
			if($row) $view_url .= PAGES_DIRECTORY .$row['link']. PAGE_EXTENSION;
145 152
		}
153

  
154
        $HelpUrl = ((strtolower(LANGUAGE)!='de') ? '/en/help.php' : '/de/hilfe.php');
146 155
		$sServerAdress = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '127.0.0.1';
147 156
		$header_template->set_var(	array(
148 157
							'SECTION_FORGOT' => $MENU['FORGOT'],
......
166 175
							'START_CLASS' => 'start',
167 176
							'TITLE_START' => $TEXT['READ_MORE'],
168 177
							'TITLE_VIEW' => $TEXT['WEBSITE'],
169
							'TITLE_HELP' => $MENU['HELP'],
178
							'TITLE_HELP' => 'WebsiteBaker '.$MENU['HELP'],
170 179
							'URL_VIEW' => $view_url,
171 180
							'TITLE_LOGOUT' => $MENU['LOGIN'],
172 181
							'LOGIN_DISPLAY_HIDDEN' => !$this->is_authenticated() ? 'hidden' : '',
......
174 183
							'LOGIN_LINK' => $_SERVER['SCRIPT_NAME'],
175 184
							'LOGIN_ICON' => 'login',
176 185
							'START_ICON' => 'blank',
177
							'URL_HELP' => 'http://www.websitebaker.org/',
186
							'URL_HELP' => 'http://www.websitebaker2.org'.$HelpUrl,
178 187
							'BACKEND_MODULE_CSS' => $this->register_backend_modfiles('css'),	// adds backend.css
179 188
							'BACKEND_MODULE_JS'  => $this->register_backend_modfiles('js')		// adds backend.js
180 189
						)
181 190
					);
191
		$header_template->set_block('header_block', 'maintenance_block', 'maintenance');
192
		if($this->get_user_id() == 1)
193
		{
194
			$sys_locked = (((int)(defined('SYSTEM_LOCKED') ? SYSTEM_LOCKED : 0)) == 1);
195
			$header_template->set_var('MAINTENANCE_MODE', ($sys_locked ? $TEXT['MAINTENANCE_OFF'] : $TEXT['MAINTENANCE_ON']));
196
			$header_template->set_var('MAINTENANCE_ICON', THEME_URL.'/images/'.($sys_locked ? 'lock' : 'unlock').'.png');
197
			$header_template->set_var('MAINTAINANCE_URL', ADMIN_URL.'/settings/locking.php');
198
			$header_template->parse('maintenance', 'maintenance_block', true);
199
		}else
200
		{
201
			$header_template->set_block('maintenance_block', '');
202
		}
182 203

  
183 204
		// Create the menu
205
        $UrlLang = ((strtolower(LANGUAGE)!='de') ? 'en' : strtolower(LANGUAGE));
184 206
		if(!$this->is_authenticated())
185 207
		{
186
		$header_template->set_var('STYLE', 'login');
187
		$menu = array(
208
    		$header_template->set_var('STYLE', 'login');
209
    		$menu = array(
188 210
//						array('http://www.websitebaker.org/', '_blank', 'WebsiteBaker Home', 'help', 0),
189 211
//						array($view_url, '_blank', $TEXT['FRONTEND'], '', 0),
190 212
//						array(ADMIN_URL.'/login/index.php', '', $MENU['LOGIN'], '', 0)
......
201 223
						'TITLE_START' => $MENU['START']
202 224
						)
203 225
					);
204
			// @array ( $url, $target, $title, $page_permission, $ppermission_required )
226

  
227
			// @array ( $url, $target, $title, $page_permission, $permission_required )
205 228
			$menu = array(
206 229
//					array(ADMIN_URL.'/index.php', '', $MENU['START'], 'start', 1 ),
207 230
					array(ADMIN_URL.'/pages/index.php', '', $MENU['PAGES'], 'pages', 1),
......
212 235
					array(ADMIN_URL.'/settings/index.php', '', $MENU['SETTINGS'], 'settings', 1),
213 236
					array(ADMIN_URL.'/admintools/index.php', '', $MENU['ADMINTOOLS'], 'admintools', 1),
214 237
					array(ADMIN_URL.'/access/index.php', '', $MENU['ACCESS'], 'access', 1),
238
//					array('http://addons.websitebaker2.org/', '', 'WB-Addons', 'preferences', 1),
239
//					array('http://template.websitebaker2.org/', '', 'WB-Template', 'preferences', 1),
215 240
//					array('http://www.websitebaker.org/', '_blank', 'WebsiteBaker Home', '', 0),
216 241
//					array(ADMIN_URL.'/logout/index.php', '', $MENU['LOGOUT'], '', 0)
217

  
218 242
					);
219 243
		}
220 244

  
branches/2.8.x/wb/framework/class.login.php
3 3
 *
4 4
 * @category        framework
5 5
 * @package         backend login
6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, Website Baker Org. e.V.
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
......
24 24
define('LOGIN_CLASS_LOADED', true);
25 25

  
26 26
// Load the other required class files if they are not already loaded
27
require_once(WB_PATH."/framework/class.admin.php");
27
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
28 28
// Get WB version
29 29
require_once(ADMIN_PATH.'/interface/version.php');
30 30

  
......
140 140
		$sql  = 'SELECT * FROM `'.$this->users_table.'` ';
141 141
		$sql .= 'WHERE `username`=\''.$loginname.'\' AND `password`=\''.$this->password.'\' AND `active`=1';
142 142
		$results = $database->query($sql);
143
		$results_array = $results->fetchRow();
143
		$results_array = $results->fetchRow(MYSQL_ASSOC);
144 144
		$num_rows = $results->numRows();
145 145
		if($num_rows == 1) {
146 146
			$user_id = $results_array['user_id'];
......
188 188
			$_SESSION['TEMPLATE_PERMISSIONS'] = array();
189 189
			$_SESSION['GROUP_NAME'] = array();
190 190

  
191

  
192

  
191 193
			$first_group = true;
192 194
			foreach (explode(",", $this->get_session('GROUPS_ID')) as $cur_group_id)
193 195
            {
......
196 198
				$results_array = $results->fetchRow();
197 199
				$_SESSION['GROUP_NAME'][$cur_group_id] = $results_array['name'];
198 200
				// Set system permissions
199
				if($results_array['system_permissions'] != '') {
201
				if( $results_array['system_permissions'] != '' ) {
200 202
					$_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $results_array['system_permissions']));
201 203
				}
202 204
				// Set module permissions
203
				if($results_array['module_permissions'] != '') {
205
				if( $results_array['module_permissions'] != '' ) {
204 206
					if ($first_group) {
205
          	$_SESSION['MODULE_PERMISSIONS'] = explode(',', $results_array['module_permissions']);
206
          } else {
207
          	$_SESSION['MODULE_PERMISSIONS'] = array_intersect($_SESSION['MODULE_PERMISSIONS'], explode(',', $results_array['module_permissions']));
207
                  	$_SESSION['MODULE_PERMISSIONS'] = explode(',', $results_array['module_permissions']);
208
                  } else {
209
                  	$_SESSION['MODULE_PERMISSIONS'] = array_intersect($_SESSION['MODULE_PERMISSIONS'], explode(',', $results_array['module_permissions']));
208 210
					}
209 211
				}
210 212
				// Set template permissions
211 213
				if($results_array['template_permissions'] != '') {
212 214
					if ($first_group) {
213
          	$_SESSION['TEMPLATE_PERMISSIONS'] = explode(',', $results_array['template_permissions']);
214
          } else {
215
          	$_SESSION['TEMPLATE_PERMISSIONS'] = array_intersect($_SESSION['TEMPLATE_PERMISSIONS'], explode(',', $results_array['template_permissions']));
215
                      	$_SESSION['TEMPLATE_PERMISSIONS'] = explode(',', $results_array['template_permissions']);
216
                      } else {
217
                      	$_SESSION['TEMPLATE_PERMISSIONS'] = array_intersect($_SESSION['TEMPLATE_PERMISSIONS'], explode(',', $results_array['template_permissions']));
216 218
					}
217 219
				}
218 220
				$first_group = false;
219 221
			}
220 222

  
223
            if( $this->ami_group_member('1')) {
224
    			$_SESSION['MODULE_PERMISSIONS'] = array();
225
    			$_SESSION['TEMPLATE_PERMISSIONS'] = array();
226
            }
227

  
221 228
			// Update the users table with current ip and timestamp
222 229
			$get_ts = time();
223 230
			$get_ip = $_SERVER['REMOTE_ADDR'];
branches/2.8.x/wb/framework/class.wb.php
3 3
 *
4 4
 * @category        framework
5 5
 * @package         frontend
6
 * @author          Ryan Djurovich, WebsiteBaker Project
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7 7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
......
31 31
{
32 32

  
33 33
 	public $password_chars = 'a-zA-Z0-9\_\-\!\#\*\+\@\$\&\:';	// General initialization function
34

  
34 35
	// performed when frontend or backend is loaded.
35

  
36 36
	public function  __construct($mode = SecureForm::FRONTEND) {
37 37
		parent::__construct($mode);
38 38
	}
39 39

  
40

  
41
	/**
42
	 *
43
	 *
44
	 * @param mixed $lang
45
	 * @param mixed $level
46
	 * @param mixed $parent
47
	 * @return
48
	 */
49
	public function GetLanguagesPages ( $lang, $level, $parent ) {
50
		global $database;
51
        $page = array();
52
        $sql =
53
        'SELECT `language`,`visibility`,`viewing_groups`,`viewing_users`,`language`,`position`, '.
54
        '`page_id`,`level`,`parent`,`root_parent`,`page_code`,`link` '.
55
        'FROM `'.TABLE_PREFIX.'pages` '.
56
        'WHERE `level`=\''.$level.'\' '.
57
          'AND `language`=\''.$lang['language'].'\' '.
58
          'AND `visibility`!=\'none\' '.
59
          'AND `visibility`!=\'hidden\' '.
60
          'AND `parent`=\''.$parent.'\' '.
61
          'AND `root_parent`=`page_id` '.
62
        'ORDER BY `position`';
63
        if($oPage = $database->query($sql))
64
        {
65
            $page = $oPage->fetchRow(MYSQL_ASSOC);
66
        }
67
        return $page;
68
	}
69

  
70
	/**
71
	 *
72
	 *
73
	 * @return
74
	 */
75
	public function GetLanguagesInUsed (  ) {
76
		global $database;
77
        $retVal = '';
78
        $page = array();
79
        $sql =
80
        'SELECT DISTINCT `language` '.
81
        'FROM `'.TABLE_PREFIX.'pages` '.
82
        'WHERE `level`= \'0\' '.
83
          'AND `visibility`!=\'none\' '.
84
          'AND `visibility`!=\'hidden\' '.
85
       'ORDER BY `position`';
86

  
87
        if($oRes = $database->query($sql))
88
        {
89
            while($lang = $oRes->fetchRow(MYSQL_ASSOC))
90
            {
91
                $page = $this->GetLanguagesPages ( $lang, 0, 0 );
92
                if(!$this->page_is_visible($page)) {continue;}
93
                $retVal .= $page['language'].',';
94
            }
95
        }
96
        return trim($retVal,',');
97
	}
98

  
99

  
40 100
/* ****************
41 101
 * check if one or more group_ids are in both group_lists
42 102
 *
......
429 489
		}
430 490
		return $retval;
431 491
	}
492
/*
493
 * @param string $type: 'locked'(default)  or 'new'
494
 * @return void: terminates application
495
 * @description: 'locked' >> Show maintenance screen and terminate, if system is locked
496
 *               'new' >> Show 'new site under construction'(former print_under_construction)
497
 */
498
	public function ShowMaintainScreen($type = 'locked')
499
	{
500
		global $database, $MESSAGE;
501
		$CHECK_BACK = $MESSAGE['GENERIC_PLEASE_CHECK_BACK_SOON'];
502
		$BE_PATIENT = '';
503
		$LANGUAGE   = strtolower((isset($_SESSION['LANGUAGE']) ? $_SESSION['LANGUAGE'] : LANGUAGE ));
432 504

  
505
		$show_screen = false;
506
		if($type == 'locked')
507
		{
508
			$curr_user = (intval(isset($_SESSION['USER_ID']) ? $_SESSION['USER_ID'] : 0) ) ;
509
			if( (defined('SYSTEM_LOCKED') && (int)SYSTEM_LOCKED == 1) && ($curr_user != 1))
510
			{
511
				header($_SERVER['SERVER_PROTOCOL'].' 503 Service Unavailable');
512
	// first kick logged users out of the system
513
		// delete all remember keys from table 'user' except user_id=1
514
				$sql  = 'UPDATE `'.TABLE_PREFIX.'users` SET `remember_key`=\'\' ';
515
				$sql .= 'WHERE `user_id`<>1';
516
				$database->query($sql);
517
		// delete remember key-cookie if set
518
				if (isset($_COOKIE['REMEMBER_KEY'])) {
519
					setcookie('REMEMBER_KEY', '', time() - 3600, '/');
520
				}
521
		// overwrite session array
522
				$_SESSION = array();
523
		// delete session cookie if set
524
				if (ini_get("session.use_cookies")) {
525
					$params = session_get_cookie_params();
526
					setcookie(session_name(), '', time() - 42000, $params["path"],
527
						$params["domain"], $params["secure"], $params["httponly"]
528
					);
529
				}
530
		// delete the session itself
531
				session_destroy();
532
				$PAGE_TITLE = $MESSAGE['GENERIC_WEBSITE_LOCKED'];
533
				$BE_PATIENT = $MESSAGE['GENERIC_BE_PATIENT'];
534
				$PAGE_ICON  = 'system';
535
				$show_screen = true;
536
			}
537
		} else {
538
			header($_SERVER['SERVER_PROTOCOL'].' 503 Service Unavailable');
539
			$PAGE_TITLE = $MESSAGE['GENERIC_WEBSITE_UNDER_CONSTRUCTION'];
540
			$PAGE_ICON  = 'negative';
541
			$show_screen = true;
542
		}
543
		if($show_screen)
544
		{
545
            $sMaintanceFile = $this->correct_theme_source('maintance.htt');
546
    		if(file_exists($sMaintanceFile))
547
    		{
548
                $tpl = new Template(dirname( $sMaintanceFile ));
549
    		    $tpl->set_file( 'page', 'maintance.htt' );
550
    		    $tpl->set_block( 'page', 'main_block', 'main' );
551

  
552
    			if(defined('DEFAULT_CHARSET'))
553
    			{
554
    				$charset=DEFAULT_CHARSET;
555
    			} else {
556
    				$charset='utf-8';
557
    			}
558
    		    $tpl->set_var( 'PAGE_TITLE', $MESSAGE['GENERIC_WEBSITE_UNDER_CONSTRUCTION'] );
559
    	 	    $tpl->set_var( 'CHECK_BACK', $MESSAGE['GENERIC_PLEASE_CHECK_BACK_SOON'] );
560
    	 	    $tpl->set_var( 'CHARSET', $charset );
561
    	 	    $tpl->set_var( 'WB_URL', WB_URL );
562
    	 	    $tpl->set_var( 'BE_PATIENT', $BE_PATIENT );
563
    	 	    $tpl->set_var( 'THEME_URL', THEME_URL );
564
    			$tpl->set_var( 'PAGE_ICON', $PAGE_ICON);
565
    			$tpl->set_var( 'LANGUAGE', strtolower(LANGUAGE));
566
    		    $tpl->parse( 'main', 'main_block', false );
567
    		    $tpl->pparse( 'output', 'page' );
568
                exit();
569
    		} else {
570
    		 require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
571
    		echo '<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
572
    		<head><title>'.$MESSAGE['GENERIC_WEBSITE_UNDER_CONSTRUCTION'].'</title>
573
    		<style type="text/css"><!-- body{ font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 12px; background-image: url("'.WB_URL.'/templates/'.DEFAULT_THEME.'/images/background.png");background-repeat: repeat-x; background-color: #A8BCCB; text-align: center; }
574
    		h1 { margin: 0; padding: 0; font-size: 18px; color: #000; text-transform: uppercase;}--></style></head><body>
575
    		<br /><h1>'.$MESSAGE['GENERIC_WEBSITE_UNDER_CONSTRUCTION'].'</h1><br />
576
    		'.$MESSAGE['GENERIC_PLEASE_CHECK_BACK_SOON'].'</body></html>';
577
    		}
578
    		flush();
579
            exit();
580
		}
581
	}
582

  
433 583
	// Validate send email
434 584
	function mail($fromaddress, $toaddress, $subject, $message, $fromname='', $replyTo='') {
435 585
/*
branches/2.8.x/wb/framework/class.frontend.php
1 1
<?php
2 2
/**
3 3
 *
4
 * @category        framework
5
 * @package         frontend
6
 * @author          Ryan Djurovich, WebsiteBaker Project
4
 * @category        frontend
5
 * @package         framework
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7 7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
......
13 13
 * @filesource		$HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16
*/
16
 */
17 17
/* -------------------------------------------------------- */
18 18
// Must include code to stop this file being accessed directly
19 19
if(!defined('WB_PATH')) {
......
21 21
	throw new IllegalFileException();
22 22
}
23 23
/* -------------------------------------------------------- */
24
require_once(WB_PATH.'/framework/class.wb.php');
24
//require_once(WB_PATH.'/framework/class.wb.php');
25 25
//require_once(WB_PATH.'/framework/SecureForm.php');
26
if(!class_exists('wb', false)){ require(WB_PATH.'/framework/class.wb.php'); }
26 27

  
27 28
class frontend extends wb {
28 29
	// defaults
......
47 48
	// ugly database stuff
48 49
	public $extra_where_sql, $sql_where_language;
49 50

  
50
	public function __construct() {
51
// do not chnage if working in frontend account
52
    public $FrontendLanguage;
53

  
54
	public function __construct($value=true) {
51 55
		parent::__construct(SecureForm::FRONTEND);
56
        $this->FrontendLanguage = isset($value) ? $value : true;
52 57
	}
53 58

  
59
    public function ChangeFrontendLanguage( $value=true ) {
60
        $this->FrontendLanguage=$value;
61
    }
62

  
54 63
	public function page_select() {
55
		global $page_id,$no_intro;
56
		global $database;
64
		global $database, $page_id,$no_intro;
65
/*
66
		// set by user statusflag and maintance enabled select in options
67
		// if maintance flag is set registered user can see normal pages
68
		// otherwise show show maintance message
69

  
70
		if($maintance == true)
71
		{
72
			$this->print_under_construction();
73
			return false;
74
		}
75
*/
76

  
77
/**
78
 * Store installed languages in SESSION
79
 */
80

  
81
        if( $this->get_session('session_started') ) {
82
            $_SESSION['USED_LANGUAGES'] = $this->GetLanguagesInUsed();
83
        }
84

  
85
		$maintance = ( defined('SYSTEM_LOCKED') && (SYSTEM_LOCKED==true) ? true : false );
57 86
		// We have no page id and are supposed to show the intro page
58
		if((INTRO_PAGE AND !isset($no_intro)) AND (!isset($page_id) OR !is_numeric($page_id))) {
87
		if((INTRO_PAGE && ($maintance != true) && !isset($no_intro)) && (!isset($page_id) || !is_numeric($page_id)))
88
		{
59 89
			// Since we have no page id check if we should go to intro page or default page
60 90
			// Get intro page content
61
			$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
62
			if(file_exists($filename)) {
63
				$handle = @fopen($filename, "r");
64
				$content = @fread($handle, filesize($filename));
65
				@fclose($handle);
66
				$this->preprocess($content);
67
				header("Location: ".WB_URL.PAGES_DIRECTORY."/intro".PAGE_EXTENSION."");   // send intro.php as header to allow parsing of php statements
68
				echo ($content);
69
				return false;
91
			$sIntroFilename = PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
92
			if(file_exists(WB_PATH.$sIntroFilename)) {
93
                // send intro.php as header to allow parsing of php statements
94
				header("Location: ".WB_URL.$sIntroFilename."");
95
				exit();
70 96
			}
71 97
		}
98

  
72 99
		// Check if we should add page language sql code
73 100
		if(PAGE_LANGUAGES) {
74 101
			$this->sql_where_language = ' AND `language`=\''.LANGUAGE.'\'';
......
87 114
			$sql .= trim($this->sql_where_language).' ';
88 115
		}
89 116
		$sql .= 'ORDER BY `p`.`position` ASC';
90
		$get_default = $database->query($sql);
91
		$default_num_rows = $get_default->numRows();
92
		if(!isset($page_id) OR !is_numeric($page_id)){
93
			// Go to or show default page
94
			if($default_num_rows > 0) {
95
				$fetch_default = $get_default->fetchRow();
96
				$this->default_link = $fetch_default['link'];
97
				$this->default_page_id = $fetch_default['page_id'];
98
				// Check if we should redirect or include page inline
99
				if(HOMEPAGE_REDIRECTION) {
100
					// Redirect to page
101
//					header("Location: ".$this->page_link($this->default_link));
102
//					exit();
103
					$this->send_header($this->page_link($this->default_link));
104
				} else {
105
					// Include page inline
106
					$this->page_id = $this->default_page_id;
107
				}
108
			} else {
109
		   		// No pages have been added, so print under construction page
110
				$this->print_under_construction();
111
				exit();
112
			}
117
		if($get_default = $database->query($sql)) {
118

  
119
    		$default_num_rows = $get_default->numRows();
120
    		if(!isset($page_id) OR !is_numeric($page_id)){
121
    			// Go to or show default page
122
    			if($default_num_rows > 0) {
123
    				$fetch_default = $get_default->fetchRow(MYSQL_ASSOC);
124
    				$this->default_link = $fetch_default['link'];
125
    				$this->default_page_id = $fetch_default['page_id'];
126
    				// Check if we should redirect or include page inline
127
    				if(HOMEPAGE_REDIRECTION) {
128
    					// Redirect to page
129
    //					header("Location: ".$this->page_link($this->default_link));
130
    //					exit();
131
    					$this->send_header($this->page_link($this->default_link));
132
    				} else {
133
    					// Include page inline
134
    					$this->page_id = $this->default_page_id;
135
    				}
136
    			} else {
137
    		   		// No pages have been added, so print under construction page
138
    //				if(trim($this->sql_where_language) == '') {
139
    //					$this->ShowMaintainScreen('new');
140
    //    				exit();
141
    //				}
142
    				$this->ShowMaintainScreen('new');
143
    //				$this->print_under_construction();
144
    				exit();
145
    			}
146
    		} else {
147
    			$this->page_id=$page_id;
148
    		}
149
    		// Get default page link
150
    		if(!isset($fetch_default)) {
151
    		  	$fetch_default = $get_default->fetchRow(MYSQL_ASSOC);
152
    	 		$this->default_link = $fetch_default['link'];
153
    			$this->default_page_id = $fetch_default['page_id'];
154
    		}
155
    		return true;
156

  
113 157
		} else {
114
			$this->page_id=$page_id;
115
		}
116
		// Get default page link
117
		if(!isset($fetch_default)) {
118
		  	$fetch_default = $get_default->fetchRow();
119
	 		$this->default_link = $fetch_default['link'];
120
			$this->default_page_id = $fetch_default['page_id'];
121
		}
122
		return true;
158
			$this->ShowMaintainScreen('new');
159
			exit();
160
    	}
161

  
123 162
	}
124 163

  
125 164
	public function get_page_details() {
......
134 173
				exit("Page not found");
135 174
			}
136 175
			// Fetch page details
137
			$this->page = $get_page->fetchRow();
138
			// Check if the page language is also the selected language. If not, send headers again.
139
			if ($this->page['language']!=LANGUAGE) {
140
				if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') { // check if there is an query-string
176
			$this->page = $get_page->fetchRow(MYSQL_ASSOC);
177

  
178
		//  Check if the page language is also the selected language. If not, send headers again.
179
			if (($this->page['language'] != LANGUAGE) && $this->FrontendLanguage )
180
            {
181
            //  check if there is an query-string
182
				if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
141 183
					header('Location: '.$this->page_link($this->page['link']).'?'.$_SERVER['QUERY_STRING'].'&lang='.$this->page['language']);
142 184
				} else {
143 185
					header('Location: '.$this->page_link($this->page['link']).'?lang='.$this->page['language']);
144 186
				}
145 187
				exit();
146 188
			}
189

  
147 190
			// Begin code to set details as either variables of constants
148 191
			// Page ID
149 192
			if(!defined('PAGE_ID')) {define('PAGE_ID', $this->page['page_id']);}
......
233 276
					// User isnt allowed on this page so tell them
234 277
					$this->page_access_denied=true;
235 278
				}
236

  
237 279
			}
238 280
		}
239 281
		// check if there is at least one active section
......
411 453

  
412 454
	// Function to show the "Under Construction" page
413 455
	public function print_under_construction() {
414
		global $MESSAGE;
415
		require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
416
		echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
417
		<head><title>'.$MESSAGE['GENERIC']['WEBSITE_UNDER_CONSTRUCTION'].'</title>
418
		<style type="text/css"><!-- body{ font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 12px; background-image: url("'.THEME_URL.'/images/background.png");background-repeat: repeat-x; background-color: #A8BCCB; text-align: center; }
419
		h1 { margin: 0; padding: 0; font-size: 18px; color: #000; text-transform: uppercase;
420
}--></style></head><body>
421
		<br /><h1>'.$MESSAGE['GENERIC']['WEBSITE_UNDER_CONSTRUCTION'].'</h1><br />
422
		'.$MESSAGE['GENERIC']['PLEASE_CHECK_BACK_SOON'].'</body></html>';
456
		$this->ShowMaintainScreen('new');
457
		exit();
423 458
	}
424 459
}
425 460

  
branches/2.8.x/wb/index.php
17 17

  
18 18
// Include config file
19 19
$config_file = dirname(__FILE__).'/config.php';
20
if(file_exists($config_file))
20
if(file_exists($config_file) && !defined('WB_URL'))
21 21
{
22 22
	require_once($config_file);
23 23
}
......
40 40
	exit;	// make sure that subsequent code will not be executed
41 41
}
42 42

  
43
require_once(WB_PATH.'/framework/class.frontend.php');
43
//require_once(WB_PATH.'/framework/class.frontend.php');
44

  
45
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
46

  
44 47
// Create new frontend object
45
$wb = new frontend();
48
if (!isset($wb)) {
49
    $wb = new frontend();
50
}
46 51

  
47 52
// Figure out which page to display
48 53
// Stop processing if intro page was shown
branches/2.8.x/wb/templates/wb_theme/css/login.css
7 7
 .login_box a:hover { text-decoration :underline; color :#3366ff; }
8 8
form.settings_table { overflow :visible; margin :0; padding :0; }
9 9
form.settings_table fieldset { border :1px none #eeeeee; display :block; margin :0; padding :0; }
10
legend.settings_table, form.settings_table legend { background :#336699 url(../images/menu.png) repeat-x center; border :medium none; color :#ffffff; font-size :140%; height :25px; margin :0 auto auto -7px!important; padding :10px 0 0 10px; width :100%; text-align :left; }
10
legend.settings_table, form.settings_table legend { background :url(../images/menu.png) #336699 repeat-x center; border :medium none; color :#ffffff; font-size :140%; height :25px; margin :0 auto auto -7px!important; padding :8px 0 0 10px; width :100%; text-align :left; }
branches/2.8.x/wb/templates/wb_theme/css/warn.css
1
/**
2
 * @id  $Date$
3
 *
4
 */
5
html { color :#003366; font-family :Verdana,"Trebuchet MS",Arial,Helvetica,sans-serif; font-size :100.1%; font-weight :normal; overflow-x :auto; overflow-y :scroll; }
6
* html div{ height :0.1em; }
7
body{ background :#a8bccb; margin :0px auto; padding :0px; text-align :left; }
8
h1, h3, h4 { color :#5b9acf; display :block; font-weight :bold; margin :0.5em auto; padding-bottom :5px; }
9
h1 { font-size :140%; }
10
h3 { font-size :110%; }
11
h4 { font-size :100%; }
12
hr { color :#003366; margin :0em auto; }
13
img { border :none; }
14
li p { margin :0.5em 0; }
15
ul, li { list-style :none; margin :0; padding :0; }
16
div.bottomdiv { background-color :#eff2f6; background-repeat :repeat-x; border-bottom :0px solid #0099ff; border-bottom-right-radius :8px; border-left :0px solid #0099ff; border-right :0px solid #0099ff; color :#003366; font-weight :bold; -moz-border-radius-bottomleft :8px; -moz-border-radius-bottomright :8px; padding :10px; text-align :center; -webkit-border-bottom-left-radius :8px; -webkit-border-bottom-right-radius :8px; }
17
div.topdiv { background-color :#eff2f6; background-image :url(../images/menu.png); background-position :left top; background-repeat :repeat-x; border-top-left-radius :8px; border-top-right-radius :8px; font-size :110%; font-weight :normal; height :34px; -moz-border-radius-topleft :8px; -moz-border-radius-topright :8px; padding :5px 10px; -webkit-border-top-left-radius :8px; -webkit-border-top-right-radius :8px; color :#330033; color :#dddddd; }
18
.clear { clear :both; }
19
.invalid_message { clear :both; color :#990000; font-size :1em; height :auto; padding-top :5px; text-align :center; width :100%; }
20
.shadow { box-shadow :5px 5px 10px #000030; -khtml-box-shadow :5px 5px 10px #000030; -moz-box-shadow :5px 5px 10px #000030; -webkit-box-shadow :5px 5px 10px #000030; }
21
.smaller { font-size :0.8em; }
22
.spacer { line-height :1em; }
23
div.main { border :0 none #666666; font-size :1em; margin :0 auto 1em; max-width :90em; min-width :60em; overflow :hidden; padding :10px 15px; width :78.6%; }
24
div.main .table { background :url("../images/bgtitle.png") repeat-x scroll 0 0 #ffffff; border-radius :10px 10px 10px 10px; box-shadow :5px 5px 5px rgba(68, 68, 68, 0.6); margin :0 auto; overflow :hidden; padding :0px 0px; width :74%; }
25
table.header { margin :0 auto; padding :0px 2px; width :74%; }
26
table.layout { table-layout :auto; }
27
.td,.content { padding :0; }
28
.login_box { border :none; }
29
 .login_box a { text-decoration :none; }
30
 .login_box a:hover { color :#3366ff; text-decoration :underline; }
31
table.footer { margin :1em auto; width :100%; }
32
table.footer tbody tr td { font-size :12px; text-align :center; }
33
legend.settings_table, .settings_table legend { background :url("../images/menu.png") repeat-x scroll center center #336699; border :medium none; color :#ffffff; font-size :140%; height :25px; margin :0 auto auto -7px !important; padding :10px 0 0 10px; text-align :left; width :100%; }
34
table a:link { display :inline; font-weight :bold; padding-top :0; text-decoration :none; vertical-align :baseline; }
35
a:link { display :inline; font-weight :bold; padding-top :0; text-decoration :none; vertical-align :baseline; }
36
a:visited { color :#0066cc; }
37
a:hover { color :#6699ff; text-decoration :underline; }
0 38

  
branches/2.8.x/wb/templates/wb_theme/templates/header.htt
42 42
	<td></td>
43 43
	<td class="topnav {LOGIN_DISPLAY_NONE}">
44 44
		<span><a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/{START_ICON}.png" alt="{TITLE_START}" /></a></span>
45
		&nbsp;&nbsp;<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
46
		&nbsp; <a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
47
		&nbsp; <a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
45
		<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
46
		<a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
47
    <!-- BEGIN maintenance_block -->
48
        <a href="{MAINTAINANCE_URL}" title="{MAINTENANCE_MODE}"><img src="{MAINTENANCE_ICON}" alt="{MAINTENANCE_MODE}" title="{MAINTENANCE_MODE}" /></a>
49
    <!-- END maintenance_block -->
50
		&nbsp;<a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
48 51
	</td>
49
	<td></td>
50 52
	<td class="version {LOGIN_DISPLAY_NONE}">
51 53
	Version {VERSION} {SP}<br />
52 54
    Revision {REVISION}
branches/2.8.x/wb/templates/wb_theme/templates/warning.html
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
<head>
4
    <title>CMS WebsiteBaker | Excessive Invalid Logins</title>
5
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="content-language" content="en" />
7
    <meta name="description" content="Excessive Invalid Logins" />
8
    <meta name="keywords" content="" />
9
    <link href="../css/warning.css" rel="stylesheet" type="text/css" />
10
</head>
11

  
12
<body>
13
		<div class="container">
14
			<div style="width: 500px; margin: 0em auto; padding: 0;">
15
				<div class="topdiv shadow">
16
					Invalid Logins
17
				</div>
18
				<div class="bottomdiv shadow">
19
            	<h1>Excessive Invalid Logins</h1>
20
            	<h4>You have attempted to login too many times</h4>
21
            	<p>Close this Tab and restart your Browser</p>
22
			    <div class="center">
23
			      <img src="../icons/negative.png" alt="Excessive Invalid Logins" />
24
			    </div>
25
				<hr />
26
				<p class="smaller">
27
<!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
28
					<a href="http://www.websitebaker2.org/" title="WebsiteBaker Home">WebsiteBaker</a>
29
					is released under the
30
					<a href="http://www.gnu.org/licenses/gpl.html"
31
					title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
32
<!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
33
					</p>
34
				</div>
35
			</div>
36
		</div>
37

  
38

  
39
</body>
40
</html>
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
<head>
4
    <title>CMS WebsiteBaker | Excessive Invalid Logins</title>
5
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="content-language" content="en" />
7
    <meta name="description" content="Excessive Invalid Logins" />
8
    <meta name="keywords" content="" />
9
    <link href="../css/warn.css" rel="stylesheet" type="text/css" />
10
</head>
11

  
12
<body>
13

  
14
<div class="main">
15
    <table class="header layout">
16
        <tr>
17
        	<td class="logo">
18
        		<a href="http://www.websitebaker2.org/" title=""><img src="../images/logo.png" alt="Logo" /></a>
19
        	</td>
20
        	<td></td>
21
        </tr>
22
    </table>
23

  
24
    <div class="table">
25
        <div class="td">
26
            <div class="content">
27
                <div class="login_box">
28
                        <div class="topdiv">
29
                        Invalid Logins
30
                        </div>
31
                        <div class="bottomdiv">
32
                        <h1>Excessive Invalid Logins</h1>
33
                        <h4>You have attempted to login too many times
34
                            <div class="center">
35
                            <img src="../icons/warning.png" alt="Excessive Invalid Logins" />
36
                            </div>
37
                        </h4>
38
                        <p>Close this Tab and restart your Browser</p>
39
                        </div>
40
                </div>
41
            </div>
42
        </div>
43
    </div>
44
    <table class="footer">
45
    <tbody>
46
        <tr>
47
        	<td>
48
              <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
49
              <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
50
              <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
51
              <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
52
        	</td>
53
        </tr>
54
        </tbody>
55
    </table>
56
</div>
57
</body>
58
</html>
59
<!--- Icons from http://www.iconfinder.com Filter: Allowed for commercial use (No link required) -->
60
<!--- Icon Designer Alessandro Rei - http://www.kde-look.org/usermanager/search.php?username=mentalrey License: http://www.gnu.org/copyleft/gpl.html -->
61
<!--- Icon Designer Everaldo Coelho - http://www.everaldo.com/ License: http://www.gnu.org/licenses/lgpl.html -->
62
<!--- Icon Designer David Vignoni - http://www.icon-king.com/ License: http://www.gnu.org/licenses/lgpl.html -->
63
<!--- Icon Designer Pavel InFeRnODeMoN - http://www.kde-look.org/usermanager/search.php?username=InFeRnODeMoN License: http://www.gnu.org/copyleft/gpl.html -->
64
<!--- Icon Designer Alexandre Moore - http://sa-ki.deviantart.com/ License: http://www.gnu.org/licenses/lgpl.html -->
65
<!--- Icon Designer Alexandre Moore - http://sa-ki.deviantart.com/ License: http://www.gnu.org/copyleft/gpl.html -->
branches/2.8.x/wb/templates/argos_theme/css/screen.css
3 3
body,td,th,input,textarea { font-family :verdana,arial,helvetica,sans-serif; font-size :12px; color : #666666; }
4 4
body { background :url(../images/background.jpg) #f9f9f9 0 0 repeat-x; margin :0; text-align :center; }
5 5
img { border :0px; }
6
#admin_header { text-align :center; width :900px; height :105px; margin :0 auto; padding :10px 0 0 0; }
6
#admin_header { text-align :center; width :948px; height :105px; margin :0 auto; padding :10px 0 0 0; }
7 7
#admin_header a#website_title { display :block; text-align :left; font-size :14px; font-weight :bold; color :#ffffff; text-transform :uppercase; text-decoration :none; }
8 8
#topmenu { float :right; text-align :right; color :#ffffff; width :220px; }
9 9
#topmenu a { font-size :11px; color :#ffffff; text-decoration :underline; margin :0 5px; }
......
22 22
.menu a span { display :block; background :url(../images/tabr.jpg) #28609b no-repeat right top; padding :6px 9px 6px 6px; }
23 23
.menu a:hover, .menu a:hover span { background-color :#28609b; text-decoration :none; }
24 24
.menu .current a, .menu a:hover { border-bottom :3px solid #d25e59; }
25
#content_container { text-align :center; width :900px; clear :both; margin :0 auto; }
26
.content { margin :0; padding :20px 0; width :900px; text-align :left; vertical-align :top; }
25
#content_container { text-align :center; width : 948px; clear :both; margin :0 auto; }
26
.content { margin :0; padding :20px 0; width : 948px; text-align :left; vertical-align :top; }
27 27
hr { margin :15px 0; color :#003366; height :1px; }
28 28
.center { text-align :center; }
29
.none { display :none; height :0; }
30 29
form { margin :0; }
31 30
label { cursor :pointer; }
32 31
input:focus, select:focus, textarea:focus { background :#f1f8fd; }
......
91 90
.spacer { line-height :1em; margin-right :0.5em; position :relative; }
92 91
/* ************************************************************************** */
93 92
/* DIV-mbox to show selector or simply content only ************************* */
94
div.mbox {
95
   padding : 5px 10px;
96
   margin : 5px auto;
97
   background-color :#ffffff;
98
   color :#330033;
99
   font-size :1em;
100
   display :block;
101
}
93
div.mbox { padding :5px 10px; margin :5px auto; background-color :#ffffff; color :#330033; font-size :1em; display :block; }
102 94
 	div.mbox div { }
103 95
		div.mbox div a { font-size :1em; color :#0052a1; }
104 96
		div.mbox div a:hover { color :#0099ff; }
......
106 98
		div.mbox div p { margin :0; padding :0 0 0.6em 0; }
107 99
div.mbox:hover { }
108 100
/* extension for mbox to show additional icons on left side ***************** */
109
div.mbox-icon {
110
   background-repeat :no-repeat;
111
   background-image :url(icons/info_50.png);
112
   background-position :15px 50%;
113
   padding : 10px 5px;
114
   min-height :25px;
115
}
116
	div.mbox-icon div {
117
   margin-left :70px;
118
   border-left :0px outset;
119
   padding-left :5px;
120
}
101
div.mbox-icon { background-repeat :no-repeat; background-image :url(icons/info_50.png); background-position :15px 50%; padding :10px 5px; min-height :25px; }
102
	div.mbox-icon div { margin-left :70px; border-left :0px outset; padding-left :5px; }
121 103
div.mbox-icon16 { background-repeat :no-repeat; background-image :url(icons/info_16.png); background-position :5px 50%; padding :5px; min-height :10px; }
122 104
	div.mbox-icon16 div { margin-left :30px; border-left :4px outset; padding-left :5px; }
123 105
/* coloring of the mbox and other boxes also ******************************** */
......
142 124
/* END of mbox - definition ************************************************* */
143 125
/* ************************************************************************** */
144 126
div.mbox input [type="checkbox"] { width :2.5em; }
145
div.mbox.dev-info { background :#dddddd; font-size :0.9em; overflow :auto; height :auto; white-space :normal; margin :0 auto 3em; position :relative; }
127
div.mbox.dev-info { background :#dddddd; color :#990066; font-size :0.9em; overflow :auto; height :auto; white-space :normal; margin :0 auto 3em; position :relative; }
146 128
div.mbox.dev-info div span { margin-bottom :1px; }
147 129
/* */
148 130
.msg-box { background :#e5ffe6; border :0.2em #009900 solid; color :#336600; margin-bottom :1em; padding :0.63em; text-align : left; }
......
313 295
div.page-settings-leftcol label a:hover { color : #006699; text-decoration : underline; }
314 296
div.page-settings-leftcol textarea { resize :vertical; } 
315 297
#overDiv { max-width :450px; background-position :center; background-attachment :fixed; text-align :left; padding :1px; font-size :120%; }
298
div.page-settings span.overlib { width :20px; margin-left :-20px; }
316 299
/* */
317 300
div.page_group { height: 180px;max-height: 260px; margin: 0; padding: 0; overflow: auto; }
318 301
div.page_group div { overflow: hidden; }
branches/2.8.x/wb/templates/argos_theme/templates/header.htt
53 53
      <!-- BEGIN linkBlock -->
54 54
      <li class="{CLASS}"><a href="{LINK}" target="{TARGET}"><span>{TITLE}</span></a></li>
55 55
      <!-- END linkBlock -->
56
		<li>&nbsp;</li>
56
		<li class="hidden">&nbsp;</li>
57 57
    </ul>
58 58
  </div>
59 59
</div>
branches/2.8.x/wb/modules/form/frontend.css
17 17
.frm-warning { background :#ffeeee; border :0.2em #884444 solid; color :#e10000; margin-bottom :1em; padding :0.8em; font-size :1.2em; font-weight :bold; }
18 18
.frm-note { background :#eeffee; border :0.2em #448844 solid; color :#004400; margin-bottom :1em; padding :0.8em; font-size :1.2em; font-weight :bold; }
19 19
.previewPrintTop { text-align :right; font-size :0.9em; }
20
.previewPrintTop img { padding-left :16px; }
20
.previewPrintTop img { padding-left :16px; }
21
fielset { border :none; }

Also available in: Unified diff