Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
d8fee28b
Commit
d8fee28b
authored
12 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
add switch to enable/disable the possibility to change the display name by the user
parent
1c56539c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/config.sample.php
+3
-0
3 additions, 0 deletions
config/config.sample.php
lib/user.php
+6
-4
6 additions, 4 deletions
lib/user.php
settings/ajax/changedisplayname.php
+4
-0
4 additions, 0 deletions
settings/ajax/changedisplayname.php
with
13 additions
and
4 deletions
config/config.sample.php
+
3
−
0
View file @
d8fee28b
...
...
@@ -114,6 +114,9 @@ $CONFIG = array(
/* How long should ownCloud keep deleted files in the trash bin, default value: 180 days */
'trashbin_retention_obligation'
=>
180
,
/* allow user to change his display name, if it is supported by the back-end */
'allow_user_to_change_display_name'
=>
true
,
/* Check 3rdparty apps for malicious code fragments */
"appcodechecker"
=>
""
,
...
...
This diff is collapsed.
Click to expand it.
lib/user.php
+
6
−
4
View file @
d8fee28b
...
...
@@ -445,10 +445,12 @@ class OC_User {
* Check whether a specified user can change his display name
*/
public
static
function
canUserChangeDisplayName
(
$uid
)
{
foreach
(
self
::
$_usedBackends
as
$backend
)
{
if
(
$backend
->
implementsActions
(
OC_USER_BACKEND_SET_DISPLAYNAME
))
{
if
(
$backend
->
userExists
(
$uid
))
{
return
true
;
if
(
OC_Config
::
getValue
(
'allow_user_to_change_display_name'
,
true
))
{
foreach
(
self
::
$_usedBackends
as
$backend
)
{
if
(
$backend
->
implementsActions
(
OC_USER_BACKEND_SET_DISPLAYNAME
))
{
if
(
$backend
->
userExists
(
$uid
))
{
return
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
settings/ajax/changedisplayname.php
+
4
−
0
View file @
d8fee28b
...
...
@@ -15,6 +15,10 @@ if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
$userstatus
=
'subadmin'
;
}
if
(
$username
==
OC_User
::
getUser
()
&&
OC_User
::
canUserChangeDisplayName
(
$username
))
{
$userstatus
=
'changeOwnDisplayName'
;
}
if
(
is_null
(
$userstatus
))
{
OC_JSON
::
error
(
array
(
"data"
=>
array
(
"message"
=>
$l
->
t
(
"Authentication error"
)
)));
exit
();
...
...
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