1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

work on sitedown

This commit is contained in:
marj
2009-10-28 16:57:51 +00:00
parent 785018a6db
commit 4ccabca5a9
4 changed files with 691 additions and 628 deletions

View File

@@ -1,4 +1,4 @@
<?php <?php
/* /*
* e107 website system * e107 website system
* *
@@ -9,38 +9,38 @@
* Administration - Site Maintenance * Administration - Site Maintenance
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/ugflag.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/ugflag.php,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2009-09-27 21:18:37 $ * $Date: 2009-10-28 16:57:51 $
* $Author: e107coders $ * $Author: marj_nl_fr $
* *
*/ */
require_once("../class2.php"); require_once ("../class2.php");
if (!getperms("9")) if(!getperms("9"))
{ {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
exit; exit();
} }
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
require_once(e_HANDLER."form_handler.php"); require_once (e_HANDLER."form_handler.php");
require_once (e_HANDLER."message_handler.php"); require_once (e_HANDLER."message_handler.php");
$emessage = eMessage::getInstance(); $emessage = eMessage::getInstance();
$emessage_method = e_AJAX_REQUEST ? 'add' : 'addSession'; $emessage_method = e_AJAX_REQUEST ? 'add' : 'addSession';
$frm = new e_form(true); $frm = new e_form(true);
if (isset($_POST['updatesettings'])) if(isset($_POST['updatesettings']))
{ {
$changed = FALSE; $changed = FALSE;
$temp = intval($_POST['maintainance_flag']); $temp = intval($_POST['maintainance_flag']);
if ($pref['maintainance_flag'] != $temp) if($pref['maintainance_flag'] != $temp)
{ {
$pref['maintainance_flag'] = $temp; $pref['maintainance_flag'] = $temp;
$changed = TRUE; $changed = TRUE;
} }
$temp = $tp->toDB($_POST['maintainance_text']); $temp = $tp->toDB($_POST['maintainance_text']);
if ($pref['maintainance_text'] != $temp) if($pref['maintainance_text'] != $temp)
{ {
$pref['maintainance_text'] = $temp; $pref['maintainance_text'] = $temp;
$changed = TRUE; $changed = TRUE;
@@ -50,25 +50,26 @@ if (isset($_POST['updatesettings']))
if(getperms('0') && $pref['main_admin_only'] != $temp) if(getperms('0') && $pref['main_admin_only'] != $temp)
{ {
$pref['main_admin_only'] = $temp; $pref['main_admin_only'] = $temp;
$changed = TRUE; $changed = TRUE;
} }
if ($changed) if($changed)
{ {
$admin_log->log_event(($pref['maintainance_flag'] == 0) ? 'MAINT_02' : 'MAINT_01',$pref['maintainance_text'],E_LOG_INFORMATIVE,''); $admin_log->log_event(($pref['maintainance_flag'] == 0) ? 'MAINT_02' : 'MAINT_01', $pref['maintainance_text'], E_LOG_INFORMATIVE, '');
save_prefs(); save_prefs();
$emessage->$emessage_method(UGFLAN_1, E_MESSAGE_SUCCESS); $emessage->$emessage_method(UGFLAN_1, E_MESSAGE_SUCCESS);
} }
else $emessage->$emessage_method(UGFLAN_7); else
$emessage->$emessage_method(UGFLAN_7);
if(!e_AJAX_REQUEST) if(!e_AJAX_REQUEST)
{ {
header("location:".e_SELF); header("location:".e_SELF);
exit; exit();
} }
} }
require_once("auth.php"); require_once ("auth.php");
$text = " $text = "
<form method='post' action='".e_SELF."' id='core-ugflag-form'> <form method='post' action='".e_SELF."' id='core-ugflag-form'>
@@ -79,32 +80,22 @@ $text = "
<col class='col-label' /> <col class='col-label' />
<col class='col-control' /> <col class='col-control' />
</colgroup> </colgroup>
<tbody> <tbody>";
$elements = array(e_UC_PUBLIC=>LAN_DISABLED,
e_UC_ADMIN=>UGFLAN_8,
e_UC_MAINADMIN=>UGFLAN_9);
$text .= "
<tr> <tr>
<td class='label'>".UGFLAN_2.": </td> <td class='label'>".UGFLAN_2.": </td>
<td class='control'> <td class='control'>
<div class='auto-toggle-area autocheck'> ".$frm->radio_multi('maintainance_flag', $elements, $pref['maintainance_flag'], TRUE)."
".$frm->checkbox('maintainance_flag', '1', $pref['maintainance_flag'])."
</div>
</td> </td>
</tr>"; </tr>";
if(getperms('0')) $text .= "
{
$text .= "<tr>
<td class='label'>".UGFLAN_8.":
</td>
<td class='control'>
<div class='auto-toggle-area autocheck'>
".$frm->checkbox('main_admin_only', '1', $pref['main_admin_only'])."
</div>
<div class='field-help'>".UGFLAN_9."</div>
</td>
</tr>";
}
$text .= "
<tr> <tr>
<td class='label'>".UGFLAN_5." <td class='label'>".UGFLAN_5."
@@ -130,8 +121,8 @@ if(!e_AJAX_REQUEST)
echo "<div id='ajax-container'>\n"; echo "<div id='ajax-container'>\n";
$e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag'); $e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag');
echo "\n</div>"; echo "\n</div>";
require_once(e_ADMIN."footer.php"); require_once (e_ADMIN."footer.php");
exit; exit();
} }
$e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag'); $e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag');
@@ -167,7 +158,7 @@ function headerjs()
</script> </script>
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script> <script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
"; ";
return $ret; return $ret;
} }
?> ?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
<?php <?php
/* /*
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <EFBFBD>Steve Dunstan 2001-2002 | Copyright (C) 2001-2009 e107 Inc
| http://e107.org | http://e107.org
| jalist@e107.org |
| |
| Released under the terms and conditions of the | Released under the terms and conditions of the
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2009-10-20 03:59:20 $ | $Date: 2009-10-28 16:57:51 $
| $Author: e107coders $ | $Author: marj_nl_fr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
class redirection class redirection
{ {
@@ -23,10 +23,11 @@ class redirection
var $self_exceptions = array(); var $self_exceptions = array();
var $page_exceptions = array(); var $page_exceptions = array();
/** /**
* Manage Member-Only Mode. * Manage Member-Only Mode.
* @return void
*/ */
function __construct() function __construct()
{ {
$this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php'); $this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php');
@@ -35,7 +36,7 @@ class redirection
/** /**
* Perform re-direction when Maintenance Mode is active. * Perform re-direction when Maintenance Mode is active.
* @return * @return void
*/ */
public function checkMaintenance() public function checkMaintenance()
{ {
@@ -66,8 +67,9 @@ class redirection
} }
/** check if user is logged in. /**
* * check if user is logged in.
* @return void
*/ */
public function checkMembersOnly() public function checkMembersOnly()
@@ -112,9 +114,9 @@ class redirection
$this->redirect(e_HTTP.'membersonly.php'); $this->redirect(e_HTTP.'membersonly.php');
} }
/** Store the current URL so that it can retrieved after login. /**
* @param * Store the current URL so that it can retrieved after login.
* @return * @return void
*/ */
private function saveMembersOnlyUrl() private function saveMembersOnlyUrl()
@@ -126,9 +128,9 @@ class redirection
} }
/** Restore the previously saved URL, and redirect the User to it after login. /**
* @param * Restore the previously saved URL, and redirect the User to it after login.
* @return * @return void
*/ */
private function restoreMembersOnlyUrl() private function restoreMembersOnlyUrl()
@@ -148,4 +150,3 @@ class redirection
exit(); exit();
} }
} }
?>

View File

@@ -1,22 +1,28 @@
<?php <?php
/* /*
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system - Language File. | e107 website system
|
| Copyright (C) 2001-2009 e107 Inc
| http://e107.org
|
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_ugflag.php,v $ | $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_ugflag.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2009-09-27 21:18:42 $ | $Date: 2009-10-28 16:57:51 $
| $Author: e107coders $ | $Author: marj_nl_fr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
define("UGFLAN_1", "Maintenance settings updated"); define('UGFLAN_1', 'Maintenance settings updated');
define("UGFLAN_2", "Activate maintenance flag"); define('UGFLAN_2', 'Activate maintenance flag');
define("UGFLAN_3", "Update Maintenance Setting"); define('UGFLAN_3', 'Update Maintenance Setting');
define("UGFLAN_4", "Maintenance Setting"); define('UGFLAN_4', 'Maintenance Setting');
define("UGFLAN_5", "Text to display when site down"); define('UGFLAN_5', 'Text to display when site down');
define("UGFLAN_6", "Leave blank to display default message"); define('UGFLAN_6', 'Leave blank to display default message');
define("UGFLAN_7","Update unsuccessful as no changes were made."); define('UGFLAN_7', 'Update unsuccessful as no changes were made.');
define("UGFLAN_8","Limit access to Main-Admins only"); define('UGFLAN_8', 'Limit access to Admins only');
define("UGFLAN_9","Only Main-Admins will be able to login while the maintenance mode is active."); define('UGFLAN_9', 'Limit access to Main-Admins only');
?>