diff options
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -54,7 +54,9 @@ } $migrations = Config::get_migrations(); - $migrations->migrate(); + $rc = $migrations->migrate(); + + exit($rc ? 0 : 1); } else { Debug::log("Database schema is already at latest version."); @@ -66,7 +68,7 @@ $username = $options["user-del"]; $user = ORM::for_table('epube_users') - ->where('user', $username) + ->where('username', $username) ->find_one(); if ($user) { @@ -104,7 +106,7 @@ $pass_hash = 'SHA256:' . hash('sha256', "$username:" . trim($pass)); $user = ORM::for_table('epube_users') - ->where('user', $username) + ->where('username', $username) ->find_one(); if ($user) { @@ -114,7 +116,7 @@ } else { Debug::log("Adding user $username."); $user = ORM::for_table('epube_users')->create(); - $user->user = $username; + $user->username = $username; $user->pass = $pass_hash; $user->save(); } |