Edit some access for MH user and recreate mass messaage

Edit some access for MH user and recreate mass message and new maintenance system view for admins
This commit is contained in:
novgorodschi catalin
2026-06-02 10:59:35 +03:00
parent 2eaa92fc03
commit 547e164143
16 changed files with 595 additions and 344 deletions
+51
View File
@@ -0,0 +1,51 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : maintenance_status.tpl ##
## Type : Left Menu Widget ##
## --------------------------------------------------------------------------- ##
## Developed by : Shadow ##
## Project : TravianZ ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $database, $session;
// rulează doar pentru admin
if($isAdmin) {
// === TOGGLE RAPID din meniu (?m=on / ?m=off) ===
if(isset($_GET['m']) && ($_GET['m'] == 'on' || $_GET['m'] == 'off')) {
$newState = ($_GET['m'] == 'on') ? 1 : 0;
$database->setMaintenance($newState, $session->uid);
// redirect ca sa curatam URL-ul
$cleanUrl = strtok($_SERVER["REQUEST_URI"], '?');
header("Location: $cleanUrl");
exit;
}
$maint = $database->getMaintenance();
if(!empty($maint['active'])) {
$started = $maint['started_at'] ? date('H:i d.m.Y', $maint['started_at']) : '-';
$starter = $database->getUserArray($maint['started_by'], 1);
$starterName = $starter['username'] ?? 'UID '.$maint['started_by'];
?>
<a href="?m=off"
title="Pornit de <?=htmlspecialchars($starterName)?> la <?=$started?> - Click pentru OPRIRE"
style="color:#dc2626; font-weight:700;">
Maintenance ON
</a>
<?php
} else {
?>
<a href="?m=on"
title="Server deschis - Click pentru ACTIVARE"
style="color:#16a34a; font-weight:700;">
Maintenance OFF
</a>
<?php
}
}
?>
+6 -4
View File
@@ -126,10 +126,6 @@ $idUser = isset($_SESSION['id_user']) ? (int)$_SESSION['id_user'] : 0;
<font color="Red"><?php echo ADMIN_PANEL; ?></font>
</a>
<a href="massmessage.php">
<?php echo MASS_MESSAGE; ?>
</a>
<a href="build_croppers.php">
Build Cropper
</a>
@@ -197,6 +193,12 @@ $idUser = isset($_SESSION['id_user']) ? (int)$_SESSION['id_user'] : 0;
* Natars include
*/
include("Templates/natars.tpl");
/**
* Maintenance status for admins
*/
include("Templates/maintenance_status.tpl");
?>
</p>