Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
efa60f1b
Verified
Commit
efa60f1b
authored
4 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #13671 TIME 0:30 Check if docservers already exist
parent
7937bcf2
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
src/app/user/controllers/UserController.php
+1
-1
1 addition, 1 deletion
src/app/user/controllers/UserController.php
src/core/controllers/InstallerController.php
+10
-2
10 additions, 2 deletions
src/core/controllers/InstallerController.php
with
11 additions
and
3 deletions
src/app/user/controllers/UserController.php
+
1
−
1
View file @
efa60f1b
...
...
@@ -1713,7 +1713,7 @@ class UserController
continue
;
}
$existingUser
=
UserModel
::
getByLogin
([
'login'
=>
strtolower
(
$user
[
'user_id'
]),
'select'
=>
[
'id'
,
'status'
,
'mail'
]]);
$existingUser
=
UserModel
::
getByLogin
([
'login'
=>
strtolower
(
$user
[
'user_id'
]),
'select'
=>
[
'id'
,
'status'
]]);
if
(
!
empty
(
$existingUser
)
&&
$existingUser
[
'status'
]
!=
'DEL'
)
{
$errors
[]
=
[
'error'
=>
"User already exists with login
{
$user
[
'user_id'
]
}
"
,
'index'
=>
$key
,
'lang'
=>
''
];
continue
;
...
...
This diff is collapsed.
Click to expand it.
src/core/controllers/InstallerController.php
+
10
−
2
View file @
efa60f1b
...
...
@@ -410,13 +410,21 @@ class InstallerController
];
foreach
(
$docservers
as
$docserver
)
{
if
(
!@
mkdir
(
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
,
0755
,
true
))
{
if
(
is_dir
(
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
))
{
if
(
!
is_readable
(
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
)
||
!
is_writable
(
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Docserver
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
is not readable or writable"
]);
}
}
elseif
(
!@
mkdir
(
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
,
0755
,
true
))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Docserver folder creation failed for path :
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/
{
$docserver
}
"
]);
}
}
$templatesPath
=
"
{
$body
[
'path'
]
}
/
{
$body
[
'customId'
]
}
/templates/0000"
;
if
(
!@
mkdir
(
$templatesPath
,
0755
,
true
))
{
if
(
is_dir
(
$templatesPath
))
{
if
(
!
is_readable
(
$templatesPath
)
||
!
is_writable
(
$templatesPath
))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Docserver
{
$templatesPath
}
is not readable or writable"
]);
}
}
elseif
(
!@
mkdir
(
$templatesPath
,
0755
,
true
))
{
return
$response
->
withJson
([
'success'
=>
"Docservers created but templates folder creation failed"
]);
}
...
...
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