andrewappleseed Posted January 3, 2011 Share Posted January 3, 2011 Hi,Im wondering if i could add a field to Employee table.But after thatm, i can not login using my user. I guess this is due to how Prestashop process the tokens or encrypt the password. function getByemail($email, $passwd = NULL), seems not work,After alter the Table, and debug the function Tools::encrypt($passwd), i got a different MD5, so, the function can not find it.how could i solve this?getByemail:SELECT * FROM `'._DB_PREFIX_.'employee` WHERE `active` = 1 AND `email` = \''.pSQL($email).'\' '.($passwd ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '')); Link to comment Share on other sites More sharing options...
CYTechnologies Posted January 3, 2011 Share Posted January 3, 2011 If I'm not mistaken, prestashop simply md5's the password. If you need to reset the password of an employee account you can do it in phpmyadmin. However, I'm not sure how the password field effects an additional employee field? Link to comment Share on other sites More sharing options...
andrewappleseed Posted January 3, 2011 Author Share Posted January 3, 2011 Same here, i dont know why, to add a field to the Database can affect to the functionTools::encrypt($passwd)I add this new field to the model and i can display perfectly in the Back Office. After logout and try to log again, it does not work.If i drop the field in the table.. everthing seems ok again. Link to comment Share on other sites More sharing options...
CYTechnologies Posted January 3, 2011 Share Posted January 3, 2011 What is the field? Link to comment Share on other sites More sharing options...
andrewappleseed Posted January 3, 2011 Author Share Posted January 3, 2011 I add the integer field "designer" (employees from the profile designer.. each employee will access only to one specific group of manufacturers).It didnt work the login.Then, i drop the field, and everything goes normal.Md5 is checking table integrity? Link to comment Share on other sites More sharing options...
CYTechnologies Posted January 3, 2011 Share Posted January 3, 2011 That doesn't seem to add up though hrm... You get the error password is wrong? Or employee doesn't exist? What exactly is displayed back? Link to comment Share on other sites More sharing options...
andrewappleseed Posted January 3, 2011 Author Share Posted January 3, 2011 Hi, i got:'employee does not exist, or bad password'Debuging, i see here is the problem:/* Seeking for employee */ $employee = new Employee(); $employee = $employee->getByemail($email, $passwd); if (!$employee) { $errors[] = Tools::displayError('employee does not exist, or bad password'); $cookie->logout(); }I send a password to the method "getByemail(), but the password i got with the functionTools::encrypt($passwd).it does not match Link to comment Share on other sites More sharing options...
andrewappleseed Posted January 5, 2011 Author Share Posted January 5, 2011 Hi,I made a new install of Prestashop and clear cookies in the web brownser.Then i follow those steps:1. Add new field to Employee.2. Change employee class (add the field, add a new validation and display).3. Add this field to the Framework.4. Login with admin or another user, and works.This field is related to Manufacturer, so, the profile of employee "manufacturer" can only access to their products.Prestashop is cool!! (Best coding that Magento, Drupal.. etc). Link to comment Share on other sites More sharing options...
CYTechnologies Posted January 5, 2011 Share Posted January 5, 2011 Glad to see you worked it out, I was a bit stumped on this one as well hehe.Thank you for also posting a solution, to often people figure it out and do not post the results back. Link to comment Share on other sites More sharing options...
RapidFire Posted February 9, 2011 Share Posted February 9, 2011 Care to elaborate on how you did this, and what exact it does?I'm looking to create Employee logins for my suppliers so that they may log in and view their own products, but not the products of other suppliers.Did you accomplish this? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now