2009-10-28 16:57:51 +00:00
|
|
|
<?php
|
2006-12-02 04:36:16 +00:00
|
|
|
/*
|
2009-01-07 15:40:06 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2013-03-10 15:21:32 +01:00
|
|
|
* Copyright (C) 2008-2024 e107 Inc (e107.org)
|
2009-01-07 15:40:06 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* Administration - Site Maintenance
|
|
|
|
*
|
2009-10-28 16:57:51 +00:00
|
|
|
*/
|
2021-01-16 13:32:35 -08:00
|
|
|
require_once (__DIR__.'/../class2.php');
|
2017-01-17 01:33:03 +01:00
|
|
|
|
2010-09-02 07:19:23 +00:00
|
|
|
if(!getperms('9'))
|
2008-11-01 23:01:11 +00:00
|
|
|
{
|
2016-01-13 19:17:37 -08:00
|
|
|
e107::redirect('admin');
|
2009-10-28 16:57:51 +00:00
|
|
|
exit();
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2010-09-02 07:19:23 +00:00
|
|
|
$e_sub_cat = 'maintain';
|
|
|
|
|
2017-01-17 01:33:03 +01:00
|
|
|
e107::coreLan('ugflag', true);
|
2009-08-28 16:11:02 +00:00
|
|
|
|
2013-03-10 15:21:32 +01:00
|
|
|
$mes = e107::getMessage();
|
|
|
|
$frm = e107::getForm();
|
2009-01-07 15:40:06 +00:00
|
|
|
|
2009-10-28 16:57:51 +00:00
|
|
|
if(isset($_POST['updatesettings']))
|
2008-11-01 23:01:11 +00:00
|
|
|
{
|
|
|
|
$changed = FALSE;
|
|
|
|
$temp = intval($_POST['maintainance_flag']);
|
2009-10-28 16:57:51 +00:00
|
|
|
if($pref['maintainance_flag'] != $temp)
|
2008-11-01 23:01:11 +00:00
|
|
|
{
|
|
|
|
$pref['maintainance_flag'] = $temp;
|
|
|
|
$changed = TRUE;
|
|
|
|
}
|
|
|
|
$temp = $tp->toDB($_POST['maintainance_text']);
|
2009-10-28 16:57:51 +00:00
|
|
|
if($pref['maintainance_text'] != $temp)
|
2008-11-01 23:01:11 +00:00
|
|
|
{
|
|
|
|
$pref['maintainance_text'] = $temp;
|
|
|
|
$changed = TRUE;
|
|
|
|
}
|
2009-09-27 21:18:42 +00:00
|
|
|
|
|
|
|
$temp = intval($_POST['main_admin_only']);
|
|
|
|
if(getperms('0') && $pref['main_admin_only'] != $temp)
|
|
|
|
{
|
|
|
|
$pref['main_admin_only'] = $temp;
|
2009-10-28 16:57:51 +00:00
|
|
|
$changed = TRUE;
|
2009-09-27 21:18:42 +00:00
|
|
|
}
|
|
|
|
|
2009-10-28 16:57:51 +00:00
|
|
|
if($changed)
|
2008-11-01 23:01:11 +00:00
|
|
|
{
|
2014-10-23 11:12:13 -07:00
|
|
|
e107::getLog()->add(($pref['maintainance_flag'] == 0) ? 'MAINT_02' : 'MAINT_01', $pref['maintainance_text'], E_LOG_INFORMATIVE, '');
|
2008-11-01 23:01:11 +00:00
|
|
|
save_prefs();
|
2018-01-09 14:43:26 -08:00
|
|
|
// $mes->addSuccess(UGFLAN_1);
|
2008-11-01 23:01:11 +00:00
|
|
|
}
|
2009-10-28 16:57:51 +00:00
|
|
|
else
|
2013-03-10 15:21:32 +01:00
|
|
|
{
|
|
|
|
$mes->addInfo(LAN_NO_CHANGE);
|
|
|
|
}
|
|
|
|
|
2018-01-09 14:43:26 -08:00
|
|
|
$pref = e107::getConfig('core', true, true)->getPref();
|
2009-10-28 16:57:51 +00:00
|
|
|
|
2020-12-18 19:55:12 -08:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2013-03-10 15:21:32 +01:00
|
|
|
require_once("auth.php");
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
$text = "
|
|
|
|
<form method='post' action='".e_SELF."' id='core-ugflag-form'>
|
|
|
|
<fieldset id='core-ugflag'>
|
|
|
|
<legend class='e-hideme'>".UGFLAN_4."</legend>
|
2012-11-26 14:41:32 -08:00
|
|
|
<table class='table adminform'>
|
2012-05-13 05:50:32 +00:00
|
|
|
<colgroup>
|
2009-01-07 15:40:06 +00:00
|
|
|
<col class='col-label' />
|
|
|
|
<col class='col-control' />
|
|
|
|
</colgroup>
|
2009-10-28 16:57:51 +00:00
|
|
|
<tbody>";
|
|
|
|
|
2014-08-20 02:02:01 -07:00
|
|
|
$elements = array(
|
|
|
|
e_UC_PUBLIC => LAN_DISABLED,
|
|
|
|
e_UC_MEMBER => ADLAN_110,
|
|
|
|
e_UC_ADMIN => UGFLAN_8,
|
|
|
|
e_UC_MAINADMIN => UGFLAN_9
|
|
|
|
);
|
2009-10-28 16:57:51 +00:00
|
|
|
|
|
|
|
$text .= "
|
2009-01-07 15:40:06 +00:00
|
|
|
<tr>
|
2012-11-26 14:41:32 -08:00
|
|
|
<td>".UGFLAN_2.": </td>
|
2013-03-24 18:04:37 -07:00
|
|
|
<td>".$frm->radio('maintainance_flag', $elements, $pref['maintainance_flag'], TRUE)."</td>
|
2009-09-27 21:18:42 +00:00
|
|
|
</tr>";
|
2009-10-28 16:57:51 +00:00
|
|
|
|
2009-10-28 20:26:04 +00:00
|
|
|
//TODO multilanguage pref
|
2009-10-28 16:57:51 +00:00
|
|
|
$text .= "
|
2009-01-07 15:40:06 +00:00
|
|
|
<tr>
|
2013-03-10 15:21:32 +01:00
|
|
|
<td>".UGFLAN_5."</td>
|
2019-01-28 18:10:08 +01:00
|
|
|
<td>".$frm->bbarea('maintainance_text', vartrue($pref['maintainance_text']), 'maintenance', '_common', 'small')."<div class='smalltext clear'>".UGFLAN_6."</div></td>
|
2009-01-07 15:40:06 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div class='buttons-bar center'>
|
2013-03-10 15:21:32 +01:00
|
|
|
".$frm->admin_button('updatesettings', LAN_UPDATE, 'update')."
|
2009-01-07 15:40:06 +00:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
//Ajax Support
|
2021-01-16 13:32:35 -08:00
|
|
|
if(e_AJAX_REQUEST)
|
2009-01-07 15:40:06 +00:00
|
|
|
{
|
2013-03-10 15:21:32 +01:00
|
|
|
$ns->tablerender(UGFLAN_4, $mes->render().$text, 'core-ugflag');
|
2021-01-16 13:32:35 -08:00
|
|
|
exit;
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2021-01-16 13:32:35 -08:00
|
|
|
echo "<div id='ajax-container'>\n";
|
2013-03-10 15:21:32 +01:00
|
|
|
$ns->tablerender(UGFLAN_4, $mes->render().$text, 'core-ugflag');
|
2021-01-16 13:32:35 -08:00
|
|
|
echo "\n</div>";
|
|
|
|
require_once (e_ADMIN."footer.php");
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
/**
|
|
|
|
* Handle page DOM within the page header
|
|
|
|
*
|
|
|
|
* @return string JS source
|
|
|
|
*/
|
2016-03-14 19:28:13 -07:00
|
|
|
|
|
|
|
/*
|
2009-01-07 15:40:06 +00:00
|
|
|
function headerjs()
|
|
|
|
{
|
|
|
|
$ret = "
|
2022-03-31 08:24:34 -07:00
|
|
|
<script>
|
2009-01-07 15:40:06 +00:00
|
|
|
//Ajax Support
|
|
|
|
var CoreUgflagAjaxPage = function(e_event) {
|
|
|
|
\$('updatesettings').observe('click', function(event) {
|
|
|
|
var form = \$('core-ugflag-form');
|
|
|
|
if(form) {
|
|
|
|
event.stop();
|
|
|
|
form.submitForm('ajax-container', { overlayPage: 'core-ugflag', parameters: { updatesettings: 1 } });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
e107.runOnLoad(CoreUgflagAjaxPage, 'ajax-container', true);
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
//Admin JS Init Rules
|
|
|
|
var e107Admin = {}
|
|
|
|
e107Admin.initRules = {
|
|
|
|
'Helper': true,
|
|
|
|
'AdminMenu': false
|
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
</script>
|
2022-03-31 08:24:34 -07:00
|
|
|
<script src='".e_JS."core/admin.js'></script>
|
2009-01-07 15:40:06 +00:00
|
|
|
";
|
2009-10-28 16:57:51 +00:00
|
|
|
|
2009-01-07 15:40:06 +00:00
|
|
|
return $ret;
|
|
|
|
}
|
2016-03-14 19:28:13 -07:00
|
|
|
|
2019-01-28 18:10:08 +01:00
|
|
|
*/
|