diff --git a/settings/css/settings.css b/settings/css/settings.css index 3645748191..4d0f6efd2c 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -39,7 +39,7 @@ div.quota-select-wrapper { position: relative; } select.quota { position:absolute; left:0; top:0; width:10em; } select.quota-user { position:relative; left:0; top:0; width:10em; } input.quota-other { display:none; position:absolute; left:0.1em; top:0.1em; width:7em; border:none; box-shadow:none; } -div.quota>span { position:absolute; right:0em; white-space:nowrap; top: 0.7em } +div.quota>span { position:absolute; right:0; white-space:nowrap; top:.7em; color:#888; text-shadow:0 1px 0 #fff; } select.quota.active { background: #fff; } /* APPS */ diff --git a/settings/templates/users.php b/settings/templates/users.php index de7e50da8f..e8bf9edf60 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -32,10 +32,15 @@ var isadmin = ;
- t('Default Quota');?>: + t('Default Storage');?>
+ + + - + @@ -138,7 +153,7 @@ var isadmin = ; t('Other');?> ... - +
@@ -151,4 +166,4 @@ var isadmin = ; - \ No newline at end of file + diff --git a/settings/users.php b/settings/users.php index 93a259f1cd..07a7620d3c 100644 --- a/settings/users.php +++ b/settings/users.php @@ -29,11 +29,27 @@ if($isadmin) { $subadmins = false; } +// load preset quotas +$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB'); +$quotaPreset=explode(',', $quotaPreset); +foreach($quotaPreset as &$preset) { + $preset=trim($preset); +} +$quotaPreset=array_diff($quotaPreset, array('default', 'none')); + +$defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); +$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false && array_search($defaultQuota, array('none', 'default'))===false; + +// load users and quota foreach($accessibleusers as $i) { + $quota=OC_Preferences::getValue($i, 'files', 'quota', 'default'); + $isQuotaUserDefined=array_search($quota, $quotaPreset)===false && array_search($quota, array('none', 'default'))===false; + $users[] = array( "name" => $i, "groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/), - 'quota'=>OC_Preferences::getValue($i, 'files', 'quota', 'default'), + 'quota'=>$quota, + 'isQuotaUserDefined'=>$isQuotaUserDefined, 'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i))); } @@ -41,20 +57,14 @@ foreach( $accessiblegroups as $i ) { // Do some more work here soon $groups[] = array( "name" => $i ); } -$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', 'default,none,1 GB, 5 GB, 10 GB'); -$quotaPreset=explode(',', $quotaPreset); -foreach($quotaPreset as &$preset) { - $preset=trim($preset); -} - -$defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); $tmpl = new OC_Template( "settings", "users", "user" ); -$tmpl->assign( "users", $users ); -$tmpl->assign( "groups", $groups ); +$tmpl->assign( 'users', $users ); +$tmpl->assign( 'groups', $groups ); $tmpl->assign( 'isadmin', (int) $isadmin); $tmpl->assign( 'subadmins', $subadmins); $tmpl->assign( 'numofgroups', count($accessiblegroups)); $tmpl->assign( 'quota_preset', $quotaPreset); $tmpl->assign( 'default_quota', $defaultQuota); +$tmpl->assign( 'defaultQuotaIsUserDefined', $defaultQuotaIsUserDefined); $tmpl->printPage();