Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Augustus_Solo

Can't login to back office after migrating shop to another domain

Question

Hello,

I transfered my Thirty bees shop to another domain (atcdpharma.com). However, after migration when I tried to login I get an error: Emloyee doesn't exist or password invalid. I have tried to reset password several times using forgoten password but it didn't work. I have also tried to reset pasword manually from cpanel phpmyadminbut still can't login to the backoffice.

Please, somebody help!

I have read through all relevant threads on this forum and also on prestashop forum and haven't found the solution.

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Hmm did you move, then upgrade? Or did you have a working thirty bees shop, then move it?

Share this post


Link to post
Share on other sites
  • 0

Database password (in phpMyAdmin) and shop password are two distinct things. I'm not aware of a simple way to reset the shop password directly in the database, because the password is stored encrypted there.

As a stress relieve and if I forgot my password doesn't work, you can apply this patch to classes/Employee.php: ```diff @@ -390,11 +390,11 @@ class EmployeeCore extends ObjectModel if ($activeOnly) { $sql->where('active = 1'); }

     $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);

- if ($plainTextPassword && !passwordverify($plainTextPassword, $result['passwd'])) { + if (0 && $plainTextPassword && !passwordverify($plainTextPassword, $result['passwd'])) { $sql = new DbQuery(); $sql->select('*'); $sql->from('employee'); $sql->where('email = \''.pSQL($email).'\''); $sql->where('passwd = \''.md5(_COOKIE_KEY_.$plainTextPassword).'\''); ``` "Applying", like changing the red line to look like the green line by adding this 0 &&. It's line 395, method getByEmail(). Then you can login with any password as long as it's longer than 7 and shorter than 255 characters. Stored password no longer matters.

This should give you a chance to look at what's going on. While Backoffice should still work on a "wrong" domain, it's certainly a good idea to correct them in Backoffice -> Preferences -> SEO & URLs.

... and don't forget to revert the above change after setting a new password, of course.

Share this post


Link to post
Share on other sites
  • 0

@lesley

Did you change the url in the database in the tb_shop table?

Even a "wrong" domain there shouldn't stop one from logging into Backoffice.

Share this post


Link to post
Share on other sites
  • 0

I added *automatic* domains. Setting the domain to *automatic* means that not only Backoffice, but also Frontoffice works on any domain. See the help text in SEO & URLs.

Share this post


Link to post
Share on other sites
  • 0

Hello Traumflug,

I'm still finding it difficult to login to the backoffice. I was able to login when I applied the patch you gave me to classes/Employee.php. But after changing my BO passward and reverting the above change to classes/Employee, I still get the error "The Employee does not exist, or the password provided is incorrect."

Please, should I do?

Share this post


Link to post
Share on other sites
  • 0

To be honest, I currently can't imagine what might go wrong.

Nevertheless, here are some steps which might get more insight. Each step is a separate attempt, you can try one after another:

  • Using your browser, remove all cookies for that domain. Recently an issue with garbage in an old cookie was discovered (and fixed).

  • Try with a very simple password, like 1234567890. It might be an UTF-8 issue or something.

  • Try changing encryption algorithm in Backoffice -> Advanced Parameters -> Performance -> Ciphering. Default is Rijndael. Safest one is PHP Encryption library, Blowfish is for compatibility (I think).

  • Uninstall all modules not coming with thirty bees. Then look into /overrides and remove all files ending with .php, but not named index.php. Overrides are one of the most often seen causes for weird behavior. If you can log in then without the hack, add them back one by one; this will restore overrides; exercise logging out and in each time to find the nasty one.

Share this post


Link to post
Share on other sites
  • 0

@traumflug I also get a blank page appearing when I tried to set the Shop URL in the BO under Preferences /SEO & URLs . I'm not sure why, but I think it is connected to the login problem.

Share this post


Link to post
Share on other sites
  • 0

@augustus_solo

on ps you can change debug mode on file config / defines.inc.php. I do not know if it works with TB too. I have not tried that yet.

define('PSMODEDEV', false); to define('PSMODEDEV', true);

Share this post


Link to post
Share on other sites
  • 0

@zimmer-media When I enabled the Debug mode I got the following error:

[PrestaShopDatabaseException]

Unknown column 'lastconnectiondate' in 'where clause'

        UPDATE `ps_employee`
        SET `last_connection_date` = CURRENT_DATE()
        WHERE `id_employee` = 10 AND `last_connection_date`< CURRENT_DATE()

and this too at line 804 in file classes/db/Db.php

  1. if ($webserviceCall && $errno) {
  2. $dbg = debug_backtrace();
  3. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
  4. } elseif (PSDEBUGSQL && $errno && !defined('TBINSTALLATIONIN_PROGRESS')) {
  5. if ($sql) {
  6. throw new PrestaShopDatabaseException($this->getMsgError().'

    '.$sql.'
    ');
  7. }
  8. throw new PrestaShopDatabaseException($this->getMsgError());
  9. }
  10. }

Share this post


Link to post
Share on other sites
  • 0

Add this column to the ps_employee table, https://www.screencast.com/t/PEGlVZy31iKM

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...