From 4acb2f70e16b4510577b7344de5c7b6fd1bca035 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 14 Dec 2012 23:02:22 +0100 Subject: change technical expression 'Quota' to simpler 'Storage' --- settings/templates/users.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/settings/templates/users.php b/settings/templates/users.php index de7e50da8f3..4328bb459b1 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -32,7 +32,7 @@ var isadmin = ;
- t('Default Quota');?>: + t('Default Storage');?>
+ - + - + + + - + @@ -138,7 +153,7 @@ var isadmin = ; t('Other');?> ... - +
diff --git a/settings/users.php b/settings/users.php index 2fd10f1d6ec..3dee152bb15 100644 --- a/settings/users.php +++ b/settings/users.php @@ -30,10 +30,15 @@ if($isadmin) { } foreach($accessibleusers as $i) { + $quota=OC_Preferences::getValue($i, 'files', 'quota', 'default'); + // translation of old value 'none' to 'unlimited' + if ($quota=='none') + $quota='unlimited'; + $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'=>OC_Preferences::getValue($i, 'files', 'quota', 'default'), 'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i))); } @@ -41,13 +46,14 @@ foreach( $accessiblegroups as $i ) { // Do some more work here soon $groups[] = array( "name" => $i ); } -$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', 'Default, Unlimited, 1 GB, 5 GB, 10 GB'); +$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', 'Unlimited'); +$defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); $tmpl = new OC_Template( "settings", "users", "user" ); $tmpl->assign( "users", $users ); -- cgit v1.2.3 From 24e0a2a358c1febfe7b6fc46cb6e9f65df66fcdf Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 20 Dec 2012 15:45:10 +0100 Subject: remove unused code --- settings/users.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/settings/users.php b/settings/users.php index 3dee152bb15..ea740bfafc0 100644 --- a/settings/users.php +++ b/settings/users.php @@ -30,11 +30,6 @@ if($isadmin) { } foreach($accessibleusers as $i) { - $quota=OC_Preferences::getValue($i, 'files', 'quota', 'default'); - // translation of old value 'none' to 'unlimited' - if ($quota=='none') - $quota='unlimited'; - $users[] = array( "name" => $i, "groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/), -- cgit v1.2.3 From 7e78f8e15a536dc57b6fad959fce286b8fc5345c Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Fri, 21 Dec 2012 00:48:12 +0100 Subject: moving logic from template to the 'controller' THX @VicDeo --- settings/templates/users.php | 4 ++-- settings/users.php | 31 ++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/settings/templates/users.php b/settings/templates/users.php index 143dc52af5c..e8bf9edf604 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -50,7 +50,7 @@ var isadmin = ; - + - + diff --git a/settings/users.php b/settings/users.php index ea740bfafc0..26d1026e8c8 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($default_quota, $quotaPreset)===false && array_search($default_quota, 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,21 +57,14 @@ foreach( $accessiblegroups as $i ) { // Do some more work here soon $groups[] = array( "name" => $i ); } -$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'); $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(); -- cgit v1.2.3 From f922f836ce11b87192c1904e01da2f6f579cac41 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 28 Dec 2012 19:14:33 -0500 Subject: Change old variable name $default_quota to $defaultQuota --- settings/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/users.php b/settings/users.php index 26d1026e8c8..07a7620d3c0 100644 --- a/settings/users.php +++ b/settings/users.php @@ -38,7 +38,7 @@ foreach($quotaPreset as &$preset) { $quotaPreset=array_diff($quotaPreset, array('default', 'none')); $defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); -$defaultQuotaIsUserDefined=array_search($default_quota, $quotaPreset)===false && array_search($default_quota, array('none', 'default'))===false; +$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false && array_search($defaultQuota, array('none', 'default'))===false; // load users and quota foreach($accessibleusers as $i) { -- cgit v1.2.3