Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect to 404.php #2

Closed
phploaded opened this issue Mar 30, 2014 · 16 comments
Closed

redirect to 404.php #2

phploaded opened this issue Mar 30, 2014 · 16 comments
Labels
confirmed bug Something isn't working

Comments

@phploaded
Copy link

Everything worked smooth until login. When i am trying to login with admin account i am always being redirected to 404.php. It says:

You're already logged in!
Oops, looks like our database encountered an error.
We couldn't load your account. We'll try to get this fixed right away!

Can you pinpoint what is wrong......?

@alexweissman
Copy link
Member

Do you have PHP 5.4+, and PDO enabled? Looks like you're probably encountering an error in load_current_user.php. Could you please check your php error log and tell me what it says?

@n30nh4ck3r
Copy link

i encountered an error during installation and the error i encountered goes like this 'call to a member function execute() on a non-object in C:\wamp\ufrost\install\install.php on line 291...php version is 5.4.16 and pdo for both msql and sqli are enabled...

@alexweissman
Copy link
Member

Oops, yeah there was a semicolon where there should have been a comma. Try now please!

@n30nh4ck3r
Copy link

Wow.Thanks...worked out fine...but there is still a little problem...you're logged in already-Oops,looks like our database encountered an error

@alexweissman
Copy link
Member

Hmm, that's the same error as phploaded got. What does your PHP error log say?

@n30nh4ck3r
Copy link

php fatal error:call to a member function execute() on a non-object in C:.../load_current_user.php on line 73:referer: http://localhost/ufrost/dashboard_admin.php

Php Stack trace:, referer:dashboard_admin.php

PHP 1. {main}() load_current_user.php:0,same referer(dashboard_admin)

@alexweissman
Copy link
Member

Ok, so it's clearly some sort of database error, when load_current_user.php tries to query the uc_users table. What actions lead to that error? Right when you try to log in? Can you look at your database and see if there is anything in the uc_users table?

@n30nh4ck3r
Copy link

Its there,an admin user plus 2 users and their details

@alexweissman
Copy link
Member

Ok, I've modified load_current_users.php and db_settings.php to provide more specific error messages for SQL. Can you please download those new files, try to log in again, and see if a more specific error appears in your php error log?

@n30nh4ck3r
Copy link

ooops,looks like our database encountered an error...

@alexweissman
Copy link
Member

Hmm, there are currently only two files where that error could be generated: load_current_user.php and admin_load_permissions.php. But admin_load_permissions.php is only accessed when you try to view the Users section. So, it must be a problem happening in load_current_user.php. There's no more specific error message in the php error log? Did you update both load_current_user.php AND models/db_settings.php?

models/db_settings.php needs to be updated because I added a line telling PDO to throw exceptions for database errors, which should then be logged in the php error log. Please check the timestamp of the error log to make sure that it's logging the most recent error.

@n30nh4ck3r
Copy link

SQLSTATE[42S02]: base table or view not found : 1146 Table 'userfrosting.uc_users' doesnt exist,referer:http://localhost/ufrost/dashboard_admin.php

@n30nh4ck3r
Copy link

i got the reason i think...now working perfectly...i changed the table prefix back to the default...thanks a lot for your time and i love this project...

@alexweissman
Copy link
Member

Sweet! You can always change the table prefix on line 37 of models/db_settings.php. Glad you like the project and good luck!

@alexweissman
Copy link
Member

I'm actually going to reopen this, because all DB queries should prepend the table prefix...load_current_users doesn't do that.

@alexweissman alexweissman reopened this Apr 10, 2014
@alexweissman alexweissman added bug and removed question labels Apr 10, 2014
@alexweissman
Copy link
Member

Fixed as of v0.1.5.

alexweissman pushed a commit that referenced this issue May 19, 2014
merging recent commits of UF into personal fork
alexweissman pushed a commit that referenced this issue May 19, 2014
alexweissman pushed a commit that referenced this issue May 29, 2014
alexweissman pushed a commit that referenced this issue Jun 11, 2014
fixed errors on my part from dev env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants