Skip to content
Snippets Groups Projects
Commit 26ddd87f authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

upgrade all admins to hashed pass

parent e030f173
Branches
Tags
3 merge requests!2431Stable,!2424Sandbox user password hash,!2416Sandbox user password hash
Pipeline #2969 passed with stage
in 25 minutes and 30 seconds
<?php
foreach(Class_Users::findAllBy(['where' => 'role_level > 2']) as $user)
$user->save();
......@@ -1774,3 +1774,22 @@ class UpgradeDB_337_Test extends UpgradeDBTestCase {
$this->assertColumn('multimedia_device', 'note');
}
}
class UpgradeDB_338_Test extends UpgradeDBTestCase {
public function prepare() {
try {
$this->query('update bib_admin_users set password="pass" where id_user=1');
} catch(Exception $e) {}
}
/** @test */
public function adminPasswordShouldBeHashed() {
$datas = $this->query('select password from bib_admin_users where id_user=1')
->fetch();
$this->assertEquals('$2y$', substr($datas['password'], 0, 4));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment