users.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 print_unescaped(OC_Helper::linkToRoute('isadmin'));?>"></script>
  17. <div id="controls">
  18. <form id="newuser" autocomplete="off">
  19. <input id="newusername" type="text" placeholder="<?php p($l->t('Login Name'))?>" /> <input
  20. type="password" id="newuserpassword"
  21. placeholder="<?php p($l->t('Password'))?>" /> <select
  22. class="groupsselect"
  23. id="newusergroups" data-placeholder="groups"
  24. title="<?php p($l->t('Groups'))?>" multiple="multiple">
  25. <?php foreach($_["groups"] as $group): ?>
  26. <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
  27. <?php endforeach;?>
  28. </select> <input type="submit" value="<?php p($l->t('Create'))?>" />
  29. </form>
  30. <?php if((bool)$_['recoveryAdminEnabled']): ?>
  31. <div class="recoveryPassword">
  32. <input id="recoveryPassword"
  33. type="password"
  34. placeholder="<?php p($l->t('Admin Recovery Password'))?>"
  35. title="<?php p($l->t('Enter the recovery password in order to recover the users files during password change'))?>"
  36. alt="<?php p($l->t('Enter the recovery password in order to recover the users files during password change'))?>"/>
  37. </div>
  38. <?php endif; ?>
  39. <div class="quota">
  40. <span><?php p($l->t('Default Storage'));?></span>
  41. <?php if((bool) $_['isadmin']): ?>
  42. <select class='quota'>
  43. <option
  44. <?php if($_['default_quota'] === 'none') print_unescaped('selected="selected"');?>
  45. value='none'>
  46. <?php p($l->t('Unlimited'));?>
  47. </option>
  48. <?php foreach($_['quota_preset'] as $preset):?>
  49. <?php if($preset !== 'default'):?>
  50. <option
  51. <?php if($_['default_quota']==$preset) print_unescaped('selected="selected"');?>
  52. value='<?php p($preset);?>'>
  53. <?php p($preset);?>
  54. </option>
  55. <?php endif;?>
  56. <?php endforeach;?>
  57. <?php if($_['defaultQuotaIsUserDefined']):?>
  58. <option selected="selected"
  59. value='<?php p($_['default_quota']);?>'>
  60. <?php p($_['default_quota']);?>
  61. </option>
  62. <?php endif;?>
  63. <option data-new value='other'>
  64. <?php p($l->t('Other'));?>
  65. ...
  66. </option>
  67. </select>
  68. <?php endif; ?>
  69. <?php if((bool) !$_['isadmin']): ?>
  70. <select class='quota' disabled="disabled">
  71. <option selected="selected">
  72. <?php p($_['default_quota']);?>
  73. </option>
  74. </select>
  75. <?php endif; ?>
  76. </div>
  77. </div>
  78. <table class="hascontrols" data-groups="<?php p(json_encode($allGroups));?>">
  79. <thead>
  80. <tr>
  81. <?php if ($_['enableAvatars']): ?>
  82. <th id='headerAvatar'></th>
  83. <?php endif; ?>
  84. <th id='headerName'><?php p($l->t('Username'))?></th>
  85. <th id="headerDisplayName"><?php p($l->t( 'Display Name' )); ?></th>
  86. <th id="headerPassword"><?php p($l->t( 'Password' )); ?></th>
  87. <th id="headerGroups"><?php p($l->t( 'Groups' )); ?></th>
  88. <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
  89. <th id="headerSubAdmins"><?php p($l->t('Group Admin')); ?></th>
  90. <?php endif;?>
  91. <th id="headerQuota"><?php p($l->t('Storage')); ?></th>
  92. <th id="headerRemove">&nbsp;</th>
  93. </tr>
  94. </thead>
  95. <tbody>
  96. <?php foreach($_["users"] as $user): ?>
  97. <tr data-uid="<?php p($user["name"]) ?>"
  98. data-displayName="<?php p($user["displayName"]) ?>">
  99. <?php if ($_['enableAvatars']): ?>
  100. <td class="avatar"><div class="avatardiv"></div></td>
  101. <?php endif; ?>
  102. <td class="name"><?php p($user["name"]); ?></td>
  103. <td class="displayName"><span><?php p($user["displayName"]); ?></span> <img class="svg action"
  104. src="<?php p(image_path('core', 'actions/rename.svg'))?>"
  105. alt="<?php p($l->t("change display name"))?>" title="<?php p($l->t("change display name"))?>"/>
  106. </td>
  107. <td class="password"><span>●●●●●●●</span> <img class="svg action"
  108. src="<?php print_unescaped(image_path('core', 'actions/rename.svg'))?>"
  109. alt="<?php p($l->t("set new password"))?>" title="<?php p($l->t("set new password"))?>"/>
  110. </td>
  111. <td class="groups"><select
  112. class="groupsselect"
  113. data-username="<?php p($user['name']) ;?>"
  114. data-user-groups="<?php p(json_encode($user['groups'])) ;?>"
  115. data-placeholder="groups" title="<?php p($l->t('Groups'))?>"
  116. multiple="multiple">
  117. <?php foreach($_["groups"] as $group): ?>
  118. <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
  119. <?php endforeach;?>
  120. </select>
  121. </td>
  122. <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
  123. <td class="subadmins"><select
  124. class="subadminsselect"
  125. data-username="<?php p($user['name']) ;?>"
  126. data-subadmin="<?php p(json_encode($user['subadmin']));?>"
  127. data-placeholder="subadmins" title="<?php p($l->t('Group Admin'))?>"
  128. multiple="multiple">
  129. <?php foreach($_["subadmingroups"] as $group): ?>
  130. <option value="<?php p($group);?>"><?php p($group);?></option>
  131. <?php endforeach;?>
  132. </select>
  133. </td>
  134. <?php endif;?>
  135. <td class="quota">
  136. <select class='quota-user'>
  137. <option
  138. <?php if($user['quota'] === 'default') print_unescaped('selected="selected"');?>
  139. value='default'>
  140. <?php p($l->t('Default'));?>
  141. </option>
  142. <option
  143. <?php if($user['quota'] === 'none') print_unescaped('selected="selected"');?>
  144. value='none'>
  145. <?php p($l->t('Unlimited'));?>
  146. </option>
  147. <?php foreach($_['quota_preset'] as $preset):?>
  148. <option
  149. <?php if($user['quota']==$preset) print_unescaped('selected="selected"');?>
  150. value='<?php p($preset);?>'>
  151. <?php p($preset);?>
  152. </option>
  153. <?php endforeach;?>
  154. <?php if($user['isQuotaUserDefined']):?>
  155. <option selected="selected" value='<?php p($user['quota']);?>'>
  156. <?php p($user['quota']);?>
  157. </option>
  158. <?php endif;?>
  159. <option value='other' data-new>
  160. <?php p($l->t('Other'));?>
  161. ...
  162. </option>
  163. </select>
  164. </td>
  165. <td class="remove">
  166. <?php if($user['name']!=OC_User::getUser()):?>
  167. <a href="#" class="action delete" original-title="<?php p($l->t('Delete'))?>">
  168. <img src="<?php print_unescaped(image_path('core', 'actions/delete.svg')) ?>" class="svg" />
  169. </a>
  170. <?php endif;?>
  171. </td>
  172. </tr>
  173. <?php endforeach; ?>
  174. </tbody>
  175. </table>