Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
7e78f8e1
Commit
7e78f8e1
authored
12 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
moving logic from template to the 'controller'
THX @VicDeo
parent
24e0a2a3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
settings/templates/users.php
+2
-2
2 additions, 2 deletions
settings/templates/users.php
settings/users.php
+20
-11
20 additions, 11 deletions
settings/users.php
with
22 additions
and
13 deletions
settings/templates/users.php
+
2
−
2
View file @
7e78f8e1
...
...
@@ -50,7 +50,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
</option>
<?php
endif
;
?>
<?php
endforeach
;
?>
<?php
if
(
array_search
(
$_
[
'default
_q
uota
'
],
$_
[
'quota_preset'
])
===
false
&&
array_search
(
$_
[
'default_quota'
],
array
(
'none'
,
'default'
))
===
false
)
:
?>
<?php
if
(
$_
[
'default
Q
uota
IsUserDefined'
]
)
:
?>
<option
selected=
"selected"
value=
'
<?php
echo
$_
[
'default_quota'
];
?>
'
>
<?php
echo
$_
[
'default_quota'
];
?>
...
...
@@ -144,7 +144,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<?php
echo
$preset
;
?>
</option>
<?php
endforeach
;
?>
<?php
if
(
array_search
(
$user
[
'quota'
],
$_
[
'quota_preset'
])
===
false
&&
array_search
(
$user
[
'quota'
],
array
(
'none'
,
'default'
))
===
false
)
:
?>
<?php
if
(
$user
[
'isQuotaUserDefined'
]
)
:
?>
<option
selected=
"selected"
value=
'
<?php
echo
$user
[
'quota'
];
?>
'
>
<?php
echo
$user
[
'quota'
];
?>
</option>
...
...
This diff is collapsed.
Click to expand it.
settings/users.php
+
20
−
11
View file @
7e78f8e1
...
...
@@ -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
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment