users.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. /**
  3. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. $allGroups=array();
  8. foreach($_["groups"] as $group) {
  9. $allGroups[] = $group['name'];
  10. }
  11. $_['subadmingroups'] = $allGroups;
  12. $items = array_flip($_['subadmingroups']);
  13. unset($items['admin']);
  14. $_['subadmingroups'] = array_flip($items);
  15. ?>
  16. <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('isadmin');?>"></script>
  17. <div id="controls">
  18. <form id="newuser" autocomplete="off">
  19. <input id="newusername" type="text" placeholder="<?php echo $l->t('Login Name')?>" /> <input
  20. type="password" id="newuserpassword"
  21. placeholder="<?php echo $l->t('Password')?>" /> <select
  22. class="groupsselect"
  23. id="newusergroups" data-placeholder="groups"
  24. title="<?php echo $l->t('Groups')?>" multiple="multiple">
  25. <?php foreach($_["groups"] as $group): ?>
  26. <option value="<?php echo $group['name'];?>">
  27. <?php echo $group['name'];?>
  28. </option>
  29. <?php endforeach;?>
  30. </select> <input type="submit" value="<?php echo $l->t('Create')?>" />
  31. </form>
  32. <div class="quota">
  33. <span><?php echo $l->t('Default Storage');?></span>
  34. <div class="quota-select-wrapper">
  35. <?php if((bool) $_['isadmin']): ?>
  36. <select class='quota'>
  37. <option
  38. <?php if($_['default_quota']=='none') echo 'selected="selected"';?>
  39. value='none'>
  40. <?php echo $l->t('Unlimited');?>
  41. </option>
  42. <?php foreach($_['quota_preset'] as $preset):?>
  43. <?php if($preset!='default'):?>
  44. <option
  45. <?php if($_['default_quota']==$preset) echo 'selected="selected"';?>
  46. value='<?php echo $preset;?>'>
  47. <?php echo $preset;?>
  48. </option>
  49. <?php endif;?>
  50. <?php endforeach;?>
  51. <?php if($_['defaultQuotaIsUserDefined']):?>
  52. <option selected="selected"
  53. value='<?php echo $_['default_quota'];?>'>
  54. <?php echo $_['default_quota'];?>
  55. </option>
  56. <?php endif;?>
  57. <option value='other'>
  58. <?php echo $l->t('Other');?>
  59. ...
  60. </option>
  61. </select> <input class='quota-other'/>
  62. <?php endif; ?>
  63. <?php if((bool) !$_['isadmin']): ?>
  64. <select class='quota' disabled="disabled">
  65. <option selected="selected">
  66. <?php echo $_['default_quota'];?>
  67. </option>
  68. </select>
  69. <?php endif; ?>
  70. </div>
  71. </div>
  72. </div>
  73. <table class="hascontrols" data-groups="<?php echo implode(', ', $allGroups);?>">
  74. <thead>
  75. <tr>
  76. <th id='headerName'><?php echo $l->t('Login Name')?></th>
  77. <th id="headerDisplayName"><?php echo $l->t( 'Display Name' ); ?></th>
  78. <th id="headerPassword"><?php echo $l->t( 'Password' ); ?></th>
  79. <th id="headerGroups"><?php echo $l->t( 'Groups' ); ?></th>
  80. <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
  81. <th id="headerSubAdmins"><?php echo $l->t('Group Admin'); ?></th>
  82. <?php endif;?>
  83. <th id="headerQuota"><?php echo $l->t('Storage'); ?></th>
  84. <th id="headerRemove">&nbsp;</th>
  85. </tr>
  86. </thead>
  87. <tbody>
  88. <?php foreach($_["users"] as $user): ?>
  89. <tr data-uid="<?php echo $user["name"] ?>"
  90. data-displayName="<?php echo $user["displayName"] ?>">
  91. <td class="name"><?php echo $user["name"]; ?></td>
  92. <td class="displayName"><span><?php echo $user["displayName"]; ?></span> <img class="svg action"
  93. src="<?php echo image_path('core', 'actions/rename.svg')?>"
  94. alt="<?php echo $l->t("change display name")?>" title="<?php echo $l->t("change display name")?>"/>
  95. </td>
  96. <td class="password"><span>●●●●●●●</span> <img class="svg action"
  97. src="<?php echo image_path('core', 'actions/rename.svg')?>"
  98. alt="<?php echo $l->t("set new password")?>" title="<?php echo $l->t("set new password")?>"/>
  99. </td>
  100. <td class="groups"><select
  101. class="groupsselect"
  102. data-username="<?php echo $user['name'] ;?>"
  103. data-user-groups="<?php echo $user['groups'] ;?>"
  104. data-placeholder="groups" title="<?php echo $l->t('Groups')?>"
  105. multiple="multiple">
  106. <?php foreach($_["groups"] as $group): ?>
  107. <option value="<?php echo $group['name'];?>">
  108. <?php echo $group['name'];?>
  109. </option>
  110. <?php endforeach;?>
  111. </select>
  112. </td>
  113. <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
  114. <td class="subadmins"><select
  115. class="subadminsselect"
  116. data-username="<?php echo $user['name'] ;?>"
  117. data-subadmin="<?php echo $user['subadmin'] ;?>"
  118. data-placeholder="subadmins" title="<?php echo $l->t('Group Admin')?>"
  119. multiple="multiple">
  120. <?php foreach($_["subadmingroups"] as $group): ?>
  121. <option value="<?php echo $group;?>">
  122. <?php echo $group;?>
  123. </option>
  124. <?php endforeach;?>
  125. </select>
  126. </td>
  127. <?php endif;?>
  128. <td class="quota">
  129. <div class="quota-select-wrapper">
  130. <select class='quota-user'>
  131. <option
  132. <?php if($user['quota']=='default') echo 'selected="selected"';?>
  133. value='default'>
  134. <?php echo $l->t('Default');?>
  135. </option>
  136. <option
  137. <?php if($user['quota']=='none') echo 'selected="selected"';?>
  138. value='none'>
  139. <?php echo $l->t('Unlimited');?>
  140. </option>
  141. <?php foreach($_['quota_preset'] as $preset):?>
  142. <option
  143. <?php if($user['quota']==$preset) echo 'selected="selected"';?>
  144. value='<?php echo $preset;?>'>
  145. <?php echo $preset;?>
  146. </option>
  147. <?php endforeach;?>
  148. <?php if($user['isQuotaUserDefined']):?>
  149. <option selected="selected" value='<?php echo $user['quota'];?>'>
  150. <?php echo $user['quota'];?>
  151. </option>
  152. <?php endif;?>
  153. <option value='other'>
  154. <?php echo $l->t('Other');?>
  155. ...
  156. </option>
  157. </select> <input class='quota-other'/>
  158. </div>
  159. </td>
  160. <td class="remove">
  161. <?php if($user['name']!=OC_User::getUser()):?>
  162. <a href="#" class="action delete" original-title="<?php echo $l->t('Delete')?>">
  163. <img src="<?php echo image_path('core', 'actions/delete.svg') ?>" />
  164. </a>
  165. <?php endif;?>
  166. </td>
  167. </tr>
  168. <?php endforeach; ?>
  169. </tbody>
  170. </table>