Nox1 Posted November 21, 2020 Share Posted November 21, 2020 Hi, I am running out of ideas right now on how to work with the LoginShare hook. In my scenario (and since users are now available) a client sends an invitation to his account. Once on the login page, the user enters username and password and with my LoginShare hook I am checking his credentials against my own database. This works well for existing customers. However, if the user does not exist I am trying to pass the "create" option with the return value: function loginshare_hook($vars) { $username = $vars['username']; $password = $vars['password']; // My code checking the password was removed to improve readability (and this part works though) //and now i am trying to return the user with the "create" flag: return array( 'email' => $username, 'create' => true, 'firstname' => 'Demo', 'lastname' => 'User', 'companyname' => 'Demo Company', 'address1' => '123 Demo Street', 'address2' => 'Sample', 'city' => 'Sample', 'state' => 'Sample', 'postcode' => 'XYZ123', 'country' => 'US', 'phonenumber' => '123456789', 'password' => 'abc123', ); } Using xdebug i get the following error: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email_preferences' in 'field list'" I have no idea what that could mean - however, when I checked the user table I saw that one user was created, however the login fails and I again see the restricted / login page. In addition to that users that are not associated with clients (linked to id 0 in the clientsuser table) are also unable to login using this method... Any help is really appreciated... Regards 0 Quote Link to comment Share on other sites More sharing options...
Nox1 Posted December 13, 2020 Author Share Posted December 13, 2020 How it was fixed: There were multiple columns in the tables missing - it seems like the upgrade script did not went through and failed (issues like strict mode on MySQL server etc. could have caused that) Regards 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.