Jason Brown_41238 Posted April 2, 2016 Posted April 2, 2016 Hi I'm trying to create an additional way for people to login using the "External Data" base under "Login Handlers" I filled out everything correct and matched it to the data base but now I am getting this error message. IPS\Db\Exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (1064) What I don't understand is if the problem is in IPB4 or something in the Actually MYSQL data base that i'm trying to reference. Any insight? I feel like I'm really close and this shouldn't be that hard.
Nathan Explosion Posted April 3, 2016 Posted April 3, 2016 Difficult to go on without you providing more detail on what you've actually done......what did you fill out? How did you fill it out? What have you matched to the database (which database?)? And what SQL query is also displayed along with the error message content?
Jason Brown_41238 Posted April 4, 2016 Author Posted April 4, 2016 @Nathan Explosion Right good questions. I uploaded pictures. In IPB4 I am logged in as an admin going to System>Settings>Login Handlers Under Longin Handlers section I am clicking on "external database" The external data base I want to use for people to login in is my Wordpress data base when people sign up as a user on my Wordpress site. I basically logged into my "Bluest" panel, wen to the MSQL data base and found all the necessary information and typed it into the screen shot below. Then I get the red error message
newbie LAC Posted April 4, 2016 Posted April 4, 2016 Hello, Report as a bug https://invisionpower.com/4bugtrack/ system/Login/External.php $result = $this->externalDb()->select( implode( ',', $select ), $this->settings['db_table'], array( $this->settings['db_extra'] ) )->first(); $this->settings['db_extra'] is empty Temporary solution Replace above line $result = $this->externalDb()->select( implode( ',', $select ), $this->settings['db_table'], $this->settings['db_extra'] ? array( $this->settings['db_extra'] ) : null )->first(); Or add 1=1 in Additional clause field
Jason Brown_41238 Posted April 4, 2016 Author Posted April 4, 2016 @newbie LAC I added 1 = 1 and it took. I will am going to add a user to the wordpress data base and test the login and see if it works. But I'm curious what does 1 = 1 mean, what did we just tell the system by typing 1 = 1?
Nathan Explosion Posted April 4, 2016 Posted April 4, 2016 The query is "SELECT user_pass,user_email FROM wp_gkeu_users WHERE" which fails because it has nothing after the WHERE. So you give it a 1 = 1 because 1 always equals 1. Effectively you've tricked the bug to do "SELECT user_pass,user_email FROM wp_gkeu_users"
Jason Brown_41238 Posted April 4, 2016 Author Posted April 4, 2016 @Nathan Explosion thanks for explaining that. There must be something minor not happening because interesting enough when I go to try and login with a test email and password it recognizes the email but not the password. I tested by trying a different email and it says "email address and password not found" but when I switch back and use the test email created it just says "password" incorrect. So something about that password is not pulling...... Arghhhhh so closeeeeeeeeeeeee
Recommended Posts
Archived
This topic is now archived and is closed to further replies.