diff options
-rw-r--r-- | settings/templates/users.php | 15 | ||||
-rw-r--r-- | settings/users.php | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/settings/templates/users.php b/settings/templates/users.php index 9f246423d20..3e1eb9a0bbe 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -13,7 +13,9 @@ $items = array_flip($_['subadmingroups']); unset($items['admin']); $_['subadmingroups'] = array_flip($items); ?> - +<script> +var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>; +</script> <div id="controls"> <form id="newuser"> <input id="newusername" placeholder="<?php echo $l->t('Name')?>" /> <input @@ -32,7 +34,8 @@ $_['subadmingroups'] = array_flip($items); <div class="quota"> <span><?php echo $l->t('Default Quota');?>:</span> <div class="quota-select-wrapper"> - <select class='quota' <?php if(!(is_array($_['subadmins']) || $_['subadmins'])) echo 'disabled="disabled"'; ?>> + <?php if((bool) $_['isadmin']): ?> + <select class='quota'> <?php foreach($_['quota_preset'] as $preset):?> <?php if($preset!='default'):?> <option @@ -53,6 +56,14 @@ $_['subadmingroups'] = array_flip($items); ... </option> </select> <input class='quota-other'></input> + <?php endif; ?> + <?php if((bool) !$_['isadmin']): ?> + <select class='quota' disabled="disabled"> + <option selected="selected"> + <?php echo $_['default_quota'];?> + </option> + </select> + <?php endif; ?> </div> </div> </div> diff --git a/settings/users.php b/settings/users.php index 60ffc337a72..e88c4d1d9ce 100644 --- a/settings/users.php +++ b/settings/users.php @@ -55,7 +55,7 @@ if (\OC_App::isEnabled( "files_sharing" ) ) { $tmpl = new OC_Template( "settings", "users", "user" ); $tmpl->assign( "users", $users ); $tmpl->assign( "groups", $groups ); -$tmpl->assign( 'isadmin', $isadmin); +$tmpl->assign( 'isadmin', (int) $isadmin); $tmpl->assign( 'subadmins', $subadmins); $tmpl->assign( 'numofgroups', count($accessiblegroups)); $tmpl->assign( 'quota_preset', $quotaPreset); |