YellowAfterlife
- Posts: 3
- Topic Created: Thu Feb 2 20:36:54 2012 +0100
- Topic Updated: Thu Feb 2 20:39:46 2012 +0100
Hello there.
I have a small Chyrp-powered website (yellow.indieis.me), and all was good, until few days ago.
Now, on attempt to log in, a "Database error" page appears, saying about:
SELECT OLD_PASSWORD('{ password }') FROM users WHERE is_approved = 1
Array
(
[:pass] => { password }
)
#0 { chyrp url }/includes/class/SQL.php(222): Query->__construct(Object(SQL), 'SELECT OLD_PASS...', Array, false)
#1 { chyrp url }/includes/model/User.php(67): SQL->query('SELECT OLD_PASS...', Array)
#2 { chyrp url }/includes/controller/Main.php(573): User::authenticate('YellowAfterlife', '{ password }')
#3 [internal function]: MainController->login()
#4 { chyrp url }/includes/class/Route.php(115): call_user_func_array(Array, Array)
#5 { chyrp url }/index.php(22): Route->init()
#6 {main}
Where { password } is password entered, and { chyrp url } is url to Chyrp installation.
Other content (pages & posts) works as intended.
Is it possible to fix this without re-installing Chyrp entirely (and if so, how)?
I already have bad experience with .atom content import\export, and would rather not risk breaking hierarchy of all content or re-creating all pages and posts manually while loosing original links.
Have a nice day.
jack
have you applied any upgrades?
YellowAfterlife
No - installation is 2.5b1, without any modifications of core being done.
jack
could you make me an account so I can test? email jack period lightbody@gmail period com.
YellowAfterlife
How would I? I cannot log in myself, thus cannot access administrator panel, thus can't really do something about that.
If you'd like to see error message yourself, try logging in at http://www.yellow.indieis.me/login/ with login "YellowAfterlife" and any password (it errors no matter if password is right or not).
jack
thats strange. The error relates to the users database table having been deleted. To make your site work again, place this code in root/includes/controller/main.php in the display function, about line 755.
Sql::current->query("CREATE TABLE IF NOT EXISTS __users (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
login VARCHAR(64) DEFAULT '',
password VARCHAR(60) DEFAULT '',
full_name VARCHAR(250) DEFAULT '',
email VARCHAR(128) DEFAULT '',
website VARCHAR(128) DEFAULT '',
group_id INTEGER DEFAULT 0,
is_approved int(2) DEFAULT 1,
joined_at DATETIME DEFAULT NULL,
UNIQUE (login)
) DEFAULT CHARSET=utf8");
User::add('admin','password','email@email.com');
then after load a page on your site, go back to root/includes/controllers/main.php and delete the lines you just added. you should then be able to log in to your site with the username admin and the password password. once logged in you can change you password and email.
YellowAfterlife
Mentioned code works, but had to change start to "SQL::current()->" for it to run.
Also found source of problem - it is third branch in function authenticate in "includes/model/User.php". So if a password is mis-typed and site works with MySQL, Chyrp crashes with error mentioned in first post. I don't know how these things work.
Anyway, I can log in now, so - thank you :)