Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
Maarch
MaarchParapheur
Commits
b8785cf5
Verified
Commit
b8785cf5
authored
5 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #8805 User lang
parent
012f5f14
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sql/structure.sql
+1
-1
1 addition, 1 deletion
sql/structure.sql
src/app/user/controllers/UserController.php
+2
-1
2 additions, 1 deletion
src/app/user/controllers/UserController.php
with
3 additions
and
2 deletions
sql/structure.sql
+
1
−
1
View file @
b8785cf5
...
...
@@ -226,7 +226,7 @@ CREATE TABLE users
picture
text
,
enabled
boolean
DEFAULT
TRUE
,
mode
character
varying
(
50
)
NOT
NULL
,
preferences
jsonb
NOT
NULL
DEFAULT
'{"writingMode" : "direct", "writingSize" : 1, "writingColor" : "#000000", "notifications" : true}'
,
preferences
jsonb
NOT
NULL
DEFAULT
'{
"lang" : "fr",
"writingMode" : "direct", "writingSize" : 1, "writingColor" : "#000000", "notifications" : true}'
,
cookie_key
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
cookie_date
timestamp
without
time
zone
,
password_modification_date
timestamp
without
time
zone
DEFAULT
CURRENT_TIMESTAMP
,
...
...
This diff is collapsed.
Click to expand it.
src/app/user/controllers/UserController.php
+
2
−
1
View file @
b8785cf5
...
...
@@ -132,6 +132,7 @@ class UserController
}
$check
=
Validator
::
arrayType
()
->
notEmpty
()
->
validate
(
$body
[
'preferences'
]);
$check
=
$check
&&
Validator
::
stringType
()
->
notEmpty
()
->
validate
(
$body
[
'preferences'
][
'lang'
])
&&
in_array
(
$body
[
'preferences'
][
'lang'
],
[
'fr'
,
'en'
]);
$check
=
$check
&&
Validator
::
stringType
()
->
notEmpty
()
->
validate
(
$body
[
'preferences'
][
'writingMode'
]);
$check
=
$check
&&
Validator
::
intType
()
->
notEmpty
()
->
validate
(
$body
[
'preferences'
][
'writingSize'
]);
$check
=
$check
&&
Validator
::
stringType
()
->
notEmpty
()
->
validate
(
$body
[
'preferences'
][
'writingColor'
]);
...
...
@@ -362,7 +363,7 @@ class UserController
$user
[
'picture'
]
=
'data:image/png;base64,'
.
$user
[
'picture'
];
}
$user
[
'preferences'
]
=
(
array
)
json_decode
(
$user
[
'preferences'
]);
$user
[
'preferences'
]
=
json_decode
(
$user
[
'preferences'
]
,
true
);
$user
[
'canManageRestUsers'
]
=
UserController
::
hasPrivilege
([
'userId'
=>
$args
[
'id'
],
'privilege'
=>
'manage_rest_users'
]);
return
$user
;
...
...
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