Jump to content

[Solved] Error in BO after copy prestashop to other (root) directory


Recommended Posts

Hello.

I have copied my prestashop instalation directory ‘/shop’ from the server to my hard-disk with an ftp program.
Then I copied back all the contents of the prestashop directory that was installed in ‘/shop’ to ‘/’ in the server.
Then I have changed ‘/shop/’ in the settings.inc.php to ‘/’.
Everything works ok except the BO. When I put my username and password and hit the enter key I enter the BO, but I get this:
* copyright PrestaShop * license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 * version 0.8 * */ class Access extends ObjectModel { /** var integer / public $id_access; /* var integer */ public $id_profile; /** var integer / public $id_tab; /* var bool */ public $view; /** var bool / public $add; /* var bool */ public $edit; /** var bool / public $delete; /* var array tabs */ private $tabs; /** var array profiles / private $profiles; /* var array accesses */ private $accesses = array(); protected $fieldsRequired = array (); protected $fieldsValidate = array ('id_profile' => 'isUnsignedId', 'id_tab' => 'isUnsignedId', 'view' => 'isBool', 'add' => 'isBool', 'edit' => 'isBool', 'delete' => 'isBool'); protected $table = 'access'; protected $identifier = 'id_access'; public function getFields() { parent::validateFields(); $fields['id_profile'] = intval($this->id_profile); $fields['view'] = intval ($this->view); $fields['add'] = intval($this->add); $fields['edit'] = intval($this->edit); $fields['delete'] = intval($this->delete); return $fields; } /** * Initialize access (for a new tab for example) * param integer $id_tab Tab id * $return bool Succes / static public function initAccess($id_tab) { / Cookie’s loading / global $cookie; if (!is_object($cookie) OR !$cookie->profile) return false; / Profile selection / $profiles = Db::getInstance()->ExecuteS(‘SELECT `id_profile` FROM ‘.DB_PREFIX.‘profile’); if (!$profiles OR empty($profiles)) return false; / Query definition / $query = ‘INSERT INTO `’.DB_PREFIX.‘access` VALUES ‘; foreach ($profiles AS $profile) { $rights = ((intval($profile[‘id_profile’]) 1 OR intval($profile['id_profile']) $cookie->profile) ? 1 : 0); $query .= ($profile === $profiles0 ? ‘’ : ‘, ‘).’(NULL, ‘.$profile[‘id_profile’].’, ‘.$id_tab.’, ‘.$rights.’, ‘.$rights.’, ‘.$rights.’, ‘.$rights.’)’; } return Db::getInstance()->Execute($query); } /* * Remove access (for a deleted tab for example) * param integer $id_tab Tab id * $return bool Succes */ static public function removeAccess($id_tab) { return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'access WHERE `id_tab` = '.intval($id_tab)); } /** * Get Access for a profile and a specific tab * * param integer profile id * param integer tab id * return array accesses / public function getProfileAccess($id_profile, $id_tab) { / Accesses selection / $this->access = Db::getInstance()->getRow(’ SELECT `view`, `add`, `edit`, `delete` FROM `’.DB_PREFIX.‘access` WHERE `id_profile` = ‘.intval($id_profile).’ AND `id_tab` = ‘.intval($id_tab)); return $this->access; } /* * Get Accesses for a profile * * param string profile id * return array accesses / public function getProfileAccesses($id_profile) { / Accesses selection / $this->accesses = Db::getInstance()->ExecuteS(’ SELECT `id_access`, `id_tab`, `view`, `add`, `edit`, `delete` FROM `’.DB_PREFIX.‘access` WHERE `id_profile` = ‘.intval($id_profile)); $result = array(); / For each access / if (!$this->accesses) { $this->_error[] = ‘No access for this profile’; return false; } foreach($this->accesses AS $access) { / If it is the first time we meet this tab we prepare it */ if (!isset($result[$access[‘id_tab’]])) $result[$access[‘id_tab’]] = array(); $result[$access[‘id_tab’]] = $access; } return $result; } } ?>

Can someone help me.
Thanks.

Link to comment
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...