mirror of
https://github.com/grocy/grocy.git
synced 2025-04-28 17:23:56 +00: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…
x
Reference in New Issue
Block a user