Fix changing user permissions. usernames with _ in them would be split into multiple users

This page is utterly broken and deserves a rewrite.
delimiting fields with "_" is a bad idea.
But i'm too lazy to be bothered. Don't call me when the db breaks
This commit is contained in:
2018-08-06 23:30:27 +02:00
parent f5c088fdc1
commit cb3949f6e8
2 changed files with 26 additions and 17 deletions

View File

@@ -48,19 +48,18 @@ $users = $userManager->getAllUserData();
<form action="./update.php" method="post">
<table class="userlist">
<tr><th>Brukernavn</th><th>Brukergrupper</th></tr>
<tr>
<th>Brukernavn</th>
<th>Brukergrupper</th>
</tr>
<?php
$users_value = '';
$users_to_update = array();
foreach($users as $i => $data){
$uname = $data['name'];
$groupFlag = $userManager->getUsergroups($uname);
if(!$users_value){
$users_value = $uname;
}else{
$users_value = $users_value . '_' . $uname;
}
array_push($users_to_update, $uname);
?>
<tr>
@@ -74,7 +73,10 @@ $users = $userManager->getAllUserData();
<?php
}
echo '<input type="hidden" name="users" value="' . $users_value . '" />';
foreach($users_to_update as $uname) {
echo '<input type="hidden" name="user_to_update" value="' . $uname . '" />';
}
?>
<tr class="newuserrow">