You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

users.php 6.5KB

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