]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
theme 98: manageusers
authorBanana <mail@bananas-playground.net>
Sat, 29 Apr 2023 22:22:55 +0000 (00:22 +0200)
committerBanana <mail@bananas-playground.net>
Sat, 29 Apr 2023 22:22:55 +0000 (00:22 +0200)
webclient/view/98/manageusers/manageusers.html [new file with mode: 0644]

diff --git a/webclient/view/98/manageusers/manageusers.html b/webclient/view/98/manageusers/manageusers.html
new file mode 100644 (file)
index 0000000..74dc7e9
--- /dev/null
@@ -0,0 +1,101 @@
+<h3 class="uk-h3">User management</h3>
+<h4 class="uk-h4">Add or modify a user</h4>
+
+<form method="post">
+       <div class="field-row">
+               <label for="username">Username *</label>
+               <input id="username" type="text" autocomplete="off" name="fdata[username]"
+                       value="<?php echo Summoner::ifset($TemplateData['editData'], 'name'); ?>">
+       </div>
+       <div class="field-row">
+               <label for="login">Login *</label>
+               <input id="login" type="text" autocomplete="off" name="fdata[login]"
+                       value="<?php echo Summoner::ifset($TemplateData['editData'], 'login'); ?>">
+       </div>
+       <div class="field-row">
+               <label for="password">Password *</label>
+               <input id="password" type="password" autocomplete="off" name="fdata[password]">
+       </div>
+       <div class="field-row">
+               <label for="group">Main group *</label>
+               <select id="group" name="fdata[group]">
+                       <option value="">Please select</option>
+                       <?php foreach($TemplateData['existingGroups'] as $k=>$v) { ?>
+                       <option value="<?php echo $k; ?>"
+                               <?php if(Summoner::ifsetValue($TemplateData['editData'], 'baseGroupId',$k)) echo 'selected'; ?>
+                               ><?php echo $v['name']; ?> (<?php echo $v['description']; ?>)</option>
+                       <?php } ?>
+               </select>
+       </div>
+       <div class="field-row">
+               <label for="groups">Additional groups</label>
+               <select id="groups" name="fdata[groups][]" multiple="multiple"
+                       size="5">
+                       <option value="">None</option>
+                       <?php foreach($TemplateData['existingGroups'] as $k=>$v) { ?>
+                       <option value="<?php echo $k; ?>"
+                       <?php if(Summoner::ifset($TemplateData['editData']['groups'],$k)) echo 'selected'; ?>
+                       ><?php echo $v['name']; ?> (<?php echo $v['description']; ?>)</option>
+                       <?php } ?>
+               </select>
+       </div>
+       <div class="field-row">
+               <input id="active" type="checkbox" name="fdata[active]" value="1"
+                       <?php if(Summoner::ifset($TemplateData['editData'], 'active')) echo "checked"; ?>>
+               <label for="active">Can login</label>
+       </div>
+       <?php if(Summoner::ifset($TemplateData['editData'], 'name') && Summoner::ifsetValue($TemplateData['editData'], 'protected', '0')) { ?>
+       <div class="field-row">
+               <input id="delete" type="checkbox" name="fdata[doDelete]" value="1">
+               <label for="delete">Delete. Warning: Content owned by this user will not be deleted and thus only manageable by admin! Better disable the user if there is content.</label>
+       </div>
+       <div class="field-row">
+               <input id="refreshApiToken" type="checkbox" name="fdata[refreshApiToken]" value="1">
+               <label for="refreshApiToken">Create API Token Valid until:
+                       <?php echo Summoner::ifset($TemplateData['editData'], 'apiTokenValidDate'); ?>
+                       <?php echo Summoner::ifset($TemplateData['editData'], 'apiToken'); ?></label>
+       </div>
+       <?php } ?>
+       <div class="field-row">
+               <input type="submit" name="submitForm" value="Save">
+       </div>
+</form>
+
+
+<h4 class="uk-h4">Available users</h4>
+<div class="sunken-panel">
+       <table width="100%">
+               <thead>
+                       <tr>
+                               <th>Login</th>
+                               <th>Created</th>
+                               <th>Username</th>
+                               <th>Group(s)</th>
+                               <th>Status</th>
+                               <th></th>
+                       </tr>
+               </thead>
+               <tbody>
+               <?php foreach($TemplateData['existingUsers'] as $k=>$v) { ?>
+                       <tr>
+                               <td><?php echo $v['login']; ?></td>
+                               <td><?php echo $v['created']; ?></td>
+                               <td><?php echo $v['name']; ?></td>
+                               <td>
+                                       <ul>
+                                       <?php foreach($v['groups'] as $gk=>$gv) { ?>
+                                               <li style="<?php if($gk == $v['baseGroupId']) echo 'font-weight: bold;'; ?>">
+                                                       <?php echo $gv['groupName']; ?>
+                                               </li>
+                                       <?php } ?>
+                                       </ul>
+                               </td>
+                               <td><?php echo $v['active']; ?></td>
+                               <td>
+                                       <a href="index.php?p=manageusers&id=<?php echo $k; ?>">Edit</a>
+                               </td>
+                       </tr>
+               <?php } ?>
+               </tbody>
+       </table>
+</div>