Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
236
Issues
236
List
Boards
Labels
Service Desk
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
59dedddb
Commit
59dedddb
authored
10 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint
parent
e9201b11
feat/cli-user-pw-reset-921
1 merge request
!351
[Sprint/OldfashionedOwl](feat): Reset password by CLI
Pipeline
#87122977
running with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Controllers/Cli/User.php
Controllers/Cli/User.php
+4
-3
No files found.
Controllers/Cli/User.php
View file @
59dedddb
...
...
@@ -54,11 +54,12 @@ class User extends Cli\Controller implements Interfaces\CliControllerInterface
/**
* Resets a users passwords.
* Requires username and password.
*
*
* Example call: php ./cli.php User password_reset --username=nemofin --password=password123
* @return void
*/
public
function
password_reset
()
{
public
function
password_reset
()
{
try
{
if
(
!
$this
->
getOpt
(
'username'
)
||
!
$this
->
getOpt
(
'password'
))
{
throw
new
Exceptions\CliException
(
'Missing username / password'
);
...
...
@@ -75,7 +76,7 @@ class User extends Cli\Controller implements Interfaces\CliControllerInterface
$user
->
save
();
$this
->
out
(
"Password changed successfuly for user "
.
$username
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$this
->
out
(
"An error has occured"
);
$this
->
out
(
$e
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment