fix(admin): route password/protection pages and align username validation (#257)

This commit is contained in:
Ferywir
2026-06-23 05:55:13 +02:00
committed by GitHub
parent e49069a9c6
commit b880622fd1
2 changed files with 34 additions and 2 deletions
+22 -1
View File
@@ -86,7 +86,8 @@ function admin_validated_page(string $raw): string
'addUsers', 'users', 'admin_log', 'config', 'debug_log',
'editServerSet', 'editPlusSet', 'editLogSet', 'editNewsboxSet',
'editExtraSet', 'editAdminInfo', 'resetServer', 'player', 'editUser',
'deletion', 'Newmessage', 'editPlus', 'editSitter', 'editOverall',
'deletion', 'Newmessage', 'editPlus', 'editSitter', 'editPassword',
'editProtection', 'editOverall',
'editWeek', 'userlogin', 'userillegallog', 'editHero', 'editAdditional',
'village', 'editResources', 'addTroops', 'addABTroops', 'editVillage',
'villagelog', 'techlog', 'msg',
@@ -347,6 +348,26 @@ if ($page !== '') {
}
break;
case 'editPassword':
$uid = admin_input_id($_GET, 'uid');
if ($uid !== null) {
$user = $database->getUserArray($uid, 1);
$subpage = 'Edit Password (' . e($user['username']) . ')';
} else {
$subpage = 'Edit Password';
}
break;
case 'editProtection':
$uid = admin_input_id($_GET, 'uid');
if ($uid !== null) {
$user = $database->getUserArray($uid, 1);
$subpage = 'Edit Protection (' . e($user['username']) . ')';
} else {
$subpage = 'Edit Protection';
}
break;
case 'editOverall':
$uid = admin_input_id($_GET, 'uid');
if ($uid !== null) {