users.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php /**
  2. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  3. * This file is licensed under the Affero General Public License version 3 or later.
  4. * See the COPYING-README file.
  5. */
  6. $allGroups=array();
  7. foreach($_["groups"] as $group) {
  8. $allGroups[]=$group['name'];
  9. }
  10. ?>
  11. <div id="controls">
  12. <form id="newuser">
  13. <th class="name"><input id="newusername" placeholder="<?php echo $l->t('Name')?>" /></th>
  14. <th class="password"><input type="password" id="newuserpassword" placeholder="<?php echo $l->t('Password')?>" /></th>
  15. <th class="groups"><select id="newusergroups" data-placeholder="groups" title="<?php echo $l->t('Groups')?>" multiple="multiple">
  16. <?php foreach($_["groups"] as $group): ?>
  17. <option value="<?php echo $group['name'];?>"><?php echo $group['name'];?></option>
  18. <?php endforeach;?>
  19. </select></th>
  20. <th class="quota"></th>
  21. <th><input type="submit" value="<?php echo $l->t('Create')?>" /></th>
  22. </form>
  23. </div>
  24. <table data-groups="<?php echo implode(', ',$allGroups);?>">
  25. <thead>
  26. <tr>
  27. <th id='headerName'><?php echo $l->t('Name')?></th>
  28. <th id="headerPassword"><?php echo $l->t( 'Password' ); ?></th>
  29. <th id="headerGroups"><?php echo $l->t( 'Groups' ); ?></th>
  30. <th id="headerQuota"><?php echo $l->t( 'Quota' ); ?></th>
  31. <th id="headerRemove">&nbsp;</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. <?php foreach($_["users"] as $user): ?>
  36. <tr data-uid="<?php echo $user["name"] ?>">
  37. <td class="name"><?php echo $user["name"]; ?></td>
  38. <td class="password">
  39. <span>●●●●●●●</span>
  40. <img class="svg action" src="<?php echo image_path('core','actions/rename.svg')?>" alt="set new password" title="set new password" />
  41. </td>
  42. <td class="groups">
  43. <select data-username="<?php echo $user['name'] ;?>" data-user-groups="<?php echo $user['groups'] ;?>" data-placeholder="groups" title="<?php echo $l->t('Groups')?>" multiple="multiple">
  44. <?php foreach($_["groups"] as $group): ?>
  45. <option value="<?php echo $group['name'];?>"><?php echo $group['name'];?></option>
  46. <?php endforeach;?>
  47. </select>
  48. </td>
  49. <td class="quota" data-quota="<?php echo $user['quota']?>">
  50. <span><?php echo ($user['quota']>0)?$user['quota']:'None';?></span>
  51. <img class="svg action" src="<?php echo image_path('core','actions/rename.svg')?>" alt="set new password" title="set quota" />
  52. </td>
  53. <td class="remove">
  54. <?php if($user['name']!=OC_User::getUser()):?>
  55. <img alt="Delete" title="<?php echo $l->t('Delete')?>" class="svg action" src="<?php echo image_path('core','actions/delete.svg') ?>" />
  56. <?php endif;?>
  57. </td>
  58. </tr>
  59. <?php endforeach; ?>
  60. </tbody>
  61. </table>