Correct some missing properties and change the user_model to have a set function so the password is hashed as part of the model

This commit is contained in:
Tim Almdal
2008-11-11 20:02:43 +00:00
parent a15c7cb11f
commit f5d092b484
3 changed files with 39 additions and 2 deletions
+2 -2
View File
@@ -68,10 +68,10 @@ class user_installer {
$user = ORM::factory("user")->where("display_name", "admin")->find();
$user->name = "admin";
$user->display_name = "Gallery Administrator";
// @todo create a helper function to encrypt the password.
$user->password = user_password::hash_password("admin");
$user->password = "admin";
$user->save();
$id = $user->id;
$db->query("UPDATE `items` SET `owner_id` = $id WHERE `owner_id` IS NULL");
foreach (array("administrator", "registered") as $group_name) {