mirror of
https://github.com/grocy/grocy.git
synced 2026-04-03 03:19:26 +02:00
Added new .devtools script
This commit is contained in:
parent
79590cd5ac
commit
337cbb73ee
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// This is executed inside DatabaseMigrationService class/context
|
||||||
|
|
||||||
|
$db = $this->getDatabaseService()->GetDbConnection();
|
||||||
|
|
||||||
|
// Reset the password of the user "admin" to "admin"
|
||||||
|
$adminUserRow = $db->users()->where('username', 'admin')->fetch();
|
||||||
|
|
||||||
|
if ($adminUserRow == null)
|
||||||
|
{
|
||||||
|
$adminUserRow = $db->users()->createRow([
|
||||||
|
'username' => 'admin'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$adminUserRow->update([
|
||||||
|
'password' => password_hash('admin', PASSWORD_DEFAULT)
|
||||||
|
]);
|
||||||
Loading…
Reference in New Issue
Block a user