Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jul 1, 2024
2 parents 8e7c5ce + f78edba commit 52ba225
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions App/Commands/Ddevadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ public function config()

public function handle()
{
$user = $this->argument('user') ?: 41;
$u = $this->wire()->users->get("name|id=$user");
$user = $this->argument('user');
$u = $user
? $this->wire()->users->get("name=$user")
: $this->wire()->users->get('roles=superuser');

if ($u->id) {
$name = $u->name;
$u->setAndSave('name', 'ddevadmin');
$u->setAndSave('pass', 'ddevadmin');
$this->success("Reset user $u");
$url = $this->wire()->pages->get(2)->httpUrl();
$this->success("Reset user $name with ID $u");
$this->write(" New username: ddevadmin");
$this->write(" New password: ddevadmin");
$this->write(" Login url: $url");
} else {
$this->warn("User $user not found");
$users = $this->wire()->pages->find("include=all,template=user,sort=id,limit=50");
Expand Down
1 change: 1 addition & 0 deletions Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public function findCommandFiles()
if (strpos($filename, "/lib/")) continue;
if (strpos($filename, "/tracy-")) continue;
if (!strpos($filename, "/RockShell/")) continue;
if (strpos($filename, '/site/modules/.')) continue;

// if we find a new base command file we load it now
// see readme about adding new base-commands to your project
Expand Down

0 comments on commit 52ba225

Please sign in to comment.