/** * Check employee informations saved into cookie and return employee validity * * @return bool employee validity */ public function isLoggedBack() { if (!Cache::isStored('isLoggedBack' . $this->id)) { /* Employee is valid only if it can be load and if cookie password is the same as database one */ $result = $this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, Context::getContext()->cookie->passwd) && (!isset(Context::getContext()->cookie->remote_addr) || Context::getContext()->cookie->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')); Cache::store('isLoggedBack' . $this->id, $result); return $result; } return Cache::retrieve('isLoggedBack' . $this->id); }
/** * Check employee informations saved into cookie and return employee validity * * @deprecated as of version 1.5 use Employee::isLoggedBack() instead * @return boolean employee validity */ public function isLoggedBack() { Tools::displayAsDeprecated(); /* Employee is valid only if it can be load and if cookie password is the same as database one */ return $this->id_employee && Validate::isUnsignedId($this->id_employee) && Employee::checkPassword((int) $this->id_employee, $this->passwd) && (!isset($this->_content['remote_addr']) || $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')); }
protected function checkEnvironment() { $cookie = new Cookie('psAdmin', '', (int) Configuration::get('PS_COOKIE_LIFETIME_BO')); return isset($cookie->id_employee) && isset($cookie->passwd) && Employee::checkPassword($cookie->id_employee, $cookie->passwd); }
/** * Check employee informations saved into cookie and return employee validity * * @return boolean employee validity */ public function isLoggedBack() { /* Employee is valid only if it can be load and if cookie password is the same as database one */ return $this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, $this->passwd) && (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')); }
<?php include_once dirname(__FILE__) . "/../../config/config.php"; //init内需要完成后台验证,判断后台登录的用户类型给予用户相关权限. if (!$cookie->__isset('ad_id_employee') || !$cookie->__isset('ad_passwd')) { header('Location: login.php?logout'); } elseif (!Employee::checkPassword($cookie->ad_id_employee, $cookie->ad_passwd)) { header('Location: login.php?logout'); } //$admin_path = trim(str_replace(_TM_ROOT_DIR_,'',_TM_ADMIN_DIR_),'\\'); //define('_TM_ADMIN_URL',_TM_ROOT_URL_.$admin_path.'/');
/** * Check employee informations saved into cookie and return employee validity * * @return boolean employee validity */ function isLoggedBack() { /* Employee is valid only if it can be load and if cookie password is the same as database one */ if ($this->id_employee and Validate::isUnsignedId($this->id_employee) and Employee::checkPassword(intval($this->id_employee), $this->passwd)) { return true; } return false; }
/** * 2015 Mediafinanz * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to info@easymarketing.de so we can send you a copy immediately. * * @author silbersaiten www.silbersaiten.de <*****@*****.**> * @copyright 2015 Mediafinanz * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ require_once dirname(__FILE__) . '/../../config/config.inc.php'; require_once dirname(__FILE__) . '/../../init.php'; require_once _PS_MODULE_DIR_ . 'mediafinanz/classes/MediafinanzNewMessage.php'; if (Employee::checkPassword(Tools::getValue('iem'), Tools::getValue('iemp'))) { $context = Context::getContext(); $context->employee = new Employee(Tools::getValue('iem')); $context->cookie->passwd = Tools::getValue('iemp'); if (Tools::isSubmit('updateNewMessages')) { die(MediafinanzNewMessage::updateNewMessages()); } } else { die(Tools::displayError('Please log in first')); }
/** * Check employee informations saved into cookie and return employee validity * * @return boolean employee validity */ function isLoggedBack() { /* Employee is valid only if it can be load and if cookie password is the same as database one */ if ($this->id_employee and Validate::isUnsignedId($this->id_employee) and Employee::checkPassword(intval($this->id_employee), $this->passwd) and (!isset($this->_content['remote_addr']) or $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()))) { return true; } return false; }