Skip to content

Commit

Permalink
// Context part 31
Browse files Browse the repository at this point in the history
  • Loading branch information
tDidierjean committed Aug 17, 2011
1 parent a9a1706 commit 3d733ae
Show file tree
Hide file tree
Showing 57 changed files with 200 additions and 165 deletions.
2 changes: 1 addition & 1 deletion admin-dev/ajax-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
if ($adminObj = checkingTab($tab))
{
$isoUser = Language::getIsoById(intval($cookie->id_lang));
$isoUser = Context::getContext()->language->iso_code;

if (Validate::isLoadedObject($adminObj))
{
Expand Down
14 changes: 7 additions & 7 deletions admin-dev/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\
$result = array();

$protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http';
$isoUser = Language::getIsoById(intval($cookie->id_lang));
$isoCountry = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
$isoUser = Context::getContext()->language->iso_code;
$isoCountry = Context::getContext()->country->iso_code;
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));

// SCREENCAST
Expand All @@ -637,7 +637,7 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\
$result['screencast'] = 'NOK';

// PREACTIVATION
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
if (!$content)
$result['partner_preactivation'] = 'NOK';
else
Expand All @@ -663,15 +663,15 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\
}

// PREACTIVATION PAYPAL WARNING
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.Tools::strtolower(Language::getIsoById(intval($cookie->id_lang))).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext().'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = explode('|', $content);
if ($content[0] == 'OK')
Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', $content[1]);
else
Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', '');

// DISCOVER PRESTASHOP
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $stream_context);
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
if (!$content)
$result['discover_prestashop'] = 'NOK';
else
Expand All @@ -685,7 +685,7 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';

$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $stream_context);
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = explode('|', $content);
if ($content[0] == 'OK')
$result['discover_prestashop'] .= $content[1];
Expand All @@ -696,7 +696,7 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\

if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent'))
{
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat', array()), $cookie->id_lang);
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat', array()), Context::getContext()->language->id);
die(Tools::jsonEncode($children_categories));
}

Expand Down
2 changes: 1 addition & 1 deletion admin-dev/ajax_products_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
SELECT p.`id_product`, `reference`, pl.name
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product)
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\') AND pl.id_lang = '.(int)($cookie->id_lang).
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\') AND pl.id_lang = '.(int)Context::getContext()->language->id.
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
($excludeVirtuals ? 'AND p.id_product NOT IN (SELECT pd.id_product FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''));

Expand Down
6 changes: 2 additions & 4 deletions admin-dev/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@

include(PS_ADMIN_DIR.'/../config/config.inc.php');

/* Header can't be included, so cookie must be created here */
$cookie = new Cookie('psAdmin');
if (!$cookie->id_employee)
if (!Context::getContext()->employee->isLoggedBack())
Tools::redirectAdmin('login.php');

$tabAccess = Profile::getProfileAccess($cookie->profile, Tab::getIdFromClassName('AdminBackup'));
$tabAccess = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminBackup'));

if ($tabAccess['view'] !== '1')
die (Tools::displayError('You do not have permission to view here'));
Expand Down
3 changes: 1 addition & 2 deletions admin-dev/drawer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

define('PS_ADMIN_DIR', getcwd());
include_once(dirname(__FILE__).'/../config/config.inc.php');
$cookie = new Cookie('psAdmin');

$module = Tools::getValue('module');
$render = Tools::getValue('render');
Expand All @@ -39,7 +38,7 @@
$id_employee = Tools::getValue('id_employee');
$id_lang = Tools::getValue('id_lang');

if ($cookie->id_employee != $id_employee)
if (Context::getContext()->employee->id != $id_employee)
die;

if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/footer.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<span style="font-size:10px">'.translate('Load time:').' '.number_format(microtime(true) - $timerStart, 3, '.', '').'s</span>
</div>
<div style="float:right;height:40px;margin-right:10px;line-height:38px;vertical-align:middle">';
if (strtoupper(Language::getIsoById($cookie->id_lang)) == 'FR') echo '<span style="color: #812143; font-weight: bold;">Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h ';
if (strtoupper(Context::getContext()->language->iso_code) == 'FR') echo '<span style="color: #812143; font-weight: bold;">Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h ';

echo ' | <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">'.translate('Contact').'</a>
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">'.translate('Bug Tracker').'</a>
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/grider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* International Registered Trademark & Property of PrestaShop SA
*/

define('PS_ADMIN_DIR', getcwd());
include_once(dirname(__FILE__).'/../config/config.inc.php');
$cookie = new Cookie('psAdmin');

$module = Tools::getValue('module');
$render = Tools::getValue('render');
Expand All @@ -41,7 +41,7 @@
$id_employee = (int)(Tools::getValue('id_employee'));
$id_lang = (int)(Tools::getValue('id_lang'));

if ($cookie->id_employee != $id_employee)
if (Context::getContext()->employee->id != $id_employee)
die;

if (!Validate::isModuleName($module))
Expand Down
24 changes: 12 additions & 12 deletions admin-dev/header.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<link type="text/css" rel="stylesheet" href="'._PS_JS_DIR_.'jquery/datepicker/datepicker.css" />
<link type="text/css" rel="stylesheet" href="'._PS_CSS_DIR_.'admin.css" />
<link type="text/css" rel="stylesheet" href="'._PS_CSS_DIR_.'jquery.cluetip.css" />
<link type="text/css" rel="stylesheet" href="themes/'.$employee->bo_theme.'/admin.css" />
<link type="text/css" rel="stylesheet" href="themes/'.Context::getContext()->employee->bo_theme.'/admin.css" />
<title>PrestaShop&trade; - '.translate('Administration panel').'</title>
<script type="text/javascript">
var helpboxes = '.Configuration::get('PS_HELPBOX').';
Expand All @@ -61,20 +61,20 @@
<![endif]-->
<style type="text/css">
div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess {
color:'.(Tools::getBrightness(empty($employee->bo_color) ? '#FFFFFF' : $employee->bo_color) < 128 ? 'white' : '#383838').'
color:'.(Tools::getBrightness(empty(Context::getContext()->employee->bo_color) ? '#FFFFFF' : Context::getContext()->employee->bo_color) < 128 ? 'white' : '#383838').'
}
</style>
</head>
<body '.((!empty($employee->bo_color)) ? 'style="background:'.Tools::htmlentitiesUTF8($employee->bo_color).'"' : '').'>
<body '.((!empty(Context::getContext()->employee->bo_color)) ? 'style="background:'.Tools::htmlentitiesUTF8(Context::getContext()->employee->bo_color).'"' : '').'>
<div id="top_container">
<div id="container">
<div id="header_infos"><span>
<a id="header_shopname" href="index.php"><span>'.Configuration::get('PS_SHOP_NAME').'</span></a><br />
'.Tools::substr($employee->firstname, 0, 1).'.&nbsp;'.htmlentities($employee->lastname, ENT_COMPAT, 'UTF-8').'
'.Tools::substr(Context::getContext()->employee->firstname, 0, 1).'.&nbsp;'.htmlentities(Context::getContext()->employee->lastname, ENT_COMPAT, 'UTF-8').'
[ <a href="index.php?logout" id="header_logout"><span>'.translate('logout').'</span></a> ]';
if (Context::getContext()->shop->getBaseURL())
echo '- <a href="'.Context::getContext()->shop->getBaseURL().'" id="header_foaccess" target="_blank" title="'.translate('View my shop').'"><span>'.translate('View my shop').'</span></a>';
echo ' - <a href="index.php?tab=AdminEmployees&id_employee='.(int)$cookie->id_employee.'&updateemployee&token='.Tools::getAdminTokenLite('AdminEmployees').'" style="font-size: 10px;"><img src="../img/admin/employee.gif" alt="" /> '.translate('My preferences').'</a>
echo ' - <a href="index.php?tab=AdminEmployees&id_employee='.(int)Context::getContext()->employee->id.'&updateemployee&token='.Tools::getAdminTokenLite('AdminEmployees').'" style="font-size: 10px;"><img src="../img/admin/employee.gif" alt="" /> '.translate('My preferences').'</a>
</span></div>
<div id="header_search">
<form method="post" action="index.php?tab=AdminSearch&token='.Tools::getAdminTokenLite('AdminSearch').'">
Expand Down Expand Up @@ -105,14 +105,14 @@ function quickSelect(elt)
</script>
<select onchange="quickSelect(this);" id="quick_select">
<option value="0">'.translate('Quick Access').'</option>';
foreach (QuickAccess::getQuickAccesses((int)($cookie->id_lang)) AS $quick)
foreach (QuickAccess::getQuickAccesses(Context::getContext()->language->id) AS $quick)
{
preg_match('/tab=(.+)(&.+)?$/', $quick['link'], $adminTab);
if (isset($adminTab[1]))
{
if (strpos($adminTab[1], '&'))
$adminTab[1] = substr($adminTab[1], 0, strpos($adminTab[1], '&'));
$quick['link'] .= '&token='.Tools::getAdminToken($adminTab[1].(int)(Tab::getIdFromClassName($adminTab[1])).(int)($cookie->id_employee));
$quick['link'] .= '&token='.Tools::getAdminToken($adminTab[1].(int)(Tab::getIdFromClassName($adminTab[1])).(int)(Context::getContext()->employee->id));
}
echo '<option value="'.$quick['link'].($quick['new_window'] ? '_blank' : '').'">&gt; '.$quick['name'].'</option>';
}
Expand All @@ -130,23 +130,23 @@ function quickSelect(elt)
echo '<div class="mainsubtablist" style="display:none"></div>';

$id_parent_tab_current = (int)(Tab::getCurrentParentId());
$tabs = Tab::getTabs((int)$cookie->id_lang, 0);
$tabs = Tab::getTabs(Context::getContext()->language->id, 0);
$echoLis = '';
$mainsubtablist = '';
foreach ($tabs AS $t)
if (checkTabRights($t['id_tab']) === true)
{
$img = (Tools::file_exists_cache(_PS_ADMIN_DIR_.'/themes/'.$employee->bo_theme.'/img/t/'.$t['class_name'].'.gif') ? 'themes/'.$employee->bo_theme.'/img/' : _PS_IMG_).'t/'.$t['class_name'].'.gif';
$img = (Tools::file_exists_cache(_PS_ADMIN_DIR_.'/themes/'.Context::getContext()->employee->bo_theme.'/img/t/'.$t['class_name'].'.gif') ? 'themes/'.Context::getContext()->employee->bo_theme.'/img/' : _PS_IMG_).'t/'.$t['class_name'].'.gif';
if (trim($t['module']) != '')
$img = _MODULE_DIR_.$t['module'].'/'.$t['class_name'].'.gif';
$current = (($t['class_name'] == $tab) OR ($id_parent_tab_current == $t['id_tab']));
echo '<li class="submenu_size '.($current ? 'active' : '').'" id="maintab'.$t['id_tab'].'">
<a href="index.php?tab='.$t['class_name'].'&token='.Tools::getAdminToken($t['class_name'].(int)($t['id_tab']).(int)($cookie->id_employee)).'">
<a href="index.php?tab='.$t['class_name'].'&token='.Tools::getAdminToken($t['class_name'].(int)($t['id_tab']).(int)Context::getContext()->employee->id).'">
<img src="'.$img.'" alt="" /> '.$t['name'].'
</a>
</li>';
$echoLi = '';
$subTabs = Tab::getTabs((int)$cookie->id_lang, (int)$t['id_tab']);
$subTabs = Tab::getTabs(Context::getContext()->language->id, (int)$t['id_tab']);
foreach ($subTabs AS $t2)
if (checkTabRights($t2['id_tab']) === true)
$echoLi .= '<li><a href="index.php?tab='.$t2['class_name'].'&token='.Tools::getAdminTokenLite($t2['class_name']).'">'.$t2['name'].'</a></li>';
Expand All @@ -155,7 +155,7 @@ function quickSelect(elt)
$echoLis .= '<div id="tab'.(int)($t['id_tab']).'_subtabs" style="display:none">'.$echoLi.'</div>';
}
echo ' </ul>'.$echoLis;
if ($employee->bo_uimode == 'hover')
if (Context::getContext()->employee->bo_uimode == 'hover')
echo ' <script type="text/javascript">
$("#menu li").hoverIntent({over:hoverTabs,timeout:100,out:outTabs});
function outTabs(){}
Expand Down
8 changes: 4 additions & 4 deletions admin-dev/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

if ($adminObj = checkingTab($tab))
{
$isoUser = Language::getIsoById(intval($cookie->id_lang));
$isoUser = Context::getContext()->language->id;
$tabs = array();
$tabs = recursiveTab($adminObj->id, $tabs);
$tabs = array_reverse($tabs);
Expand All @@ -49,7 +49,7 @@
foreach ($tabs AS $key => $item)
$bread .= ' <img src="../img/admin/separator_breadcrum.png" style="margin-right:5px" alt="&gt;" />
'.((sizeof($tabs) - 1 > $key)
? '<a href="?tab='.$item['class_name'].'&token='.Tools::getAdminToken($item['class_name'].intval($item['id_tab']).intval($cookie->id_employee)).'">'
? '<a href="?tab='.$item['class_name'].'&token='.Tools::getAdminToken($item['class_name'].intval($item['id_tab']).(int)Context::getContext()->employee->id).'">'
: '').'
'.$item['name'].((sizeof($tabs) - 1 > $key) ? '</a>' : '');
// @TODO : a way to desactivate this feature
Expand All @@ -59,7 +59,7 @@
$.ajax({
type: \'POST\',
url: \'ajax.php\',
data: \'helpAccess=1&item='.$item['class_name'].'&isoUser='.$isoUser.'&country='.Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')).'&version='._PS_VERSION_.'\',
data: \'helpAccess=1&item='.$item['class_name'].'&isoUser='.$isoUser.'&country='.Context::getContext()->country->iso_code.'&version='._PS_VERSION_.'\',
async : true,
success: function(msg) {
$("#help-button").html(msg);
Expand All @@ -72,7 +72,7 @@
echo '<div class="path_bar">
<div id="help-button" class="floatr" style="display: none; font-family: Verdana; font-size: 10px; margin-right: 4px; margin-top: 4px;">
</div>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).intval($cookie->id_employee)).'">'.translate('Back Office').'</a>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.translate('Back Office').'</a>
'.$bread;
echo '
</div>';
Expand Down
20 changes: 9 additions & 11 deletions admin-dev/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@

$context = Context::getContext();
if (isset($_GET['logout']))
$cookie->logout();
$context->employee->logout();

if (!$cookie->isLoggedBack())
{
if (!$context->employee->isLoggedBack())
Tools::redirectAdmin('login.php?redirect='.$_SERVER['REQUEST_URI']);
}


// Set current index
$currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : '');
if ($back = Tools::getValue('back'))
$currentIndex .= '&back='.urlencode($back);
AdminTab::$currentIndex = $currentIndex;


$iso = $language->iso_code;
$iso = $context->language->iso_code;
include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php');
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
Expand All @@ -58,26 +56,26 @@
define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));

$path = dirname(__FILE__).'/themes/';
if (empty($employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css'))
if (empty($context->employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css'))
{
if (file_exists($path.'oldschool/admin.css'))
$employee->bo_theme = 'oldschool';
$context->employee->bo_theme = 'oldschool';
elseif (file_exists($path.'origins/admin.css'))
$employee->bo_theme = 'origins';
$context->employee->bo_theme = 'origins';
else
foreach (scandir($path) as $theme)
if ($theme[0] != '.' AND file_exists($path.$theme.'/admin.css'))
{
$employee->bo_theme = $theme;
break;
}
$employee->update();
$context->employee->update();
}

// Change shop context ?
if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false)
{
$cookie->shopContext = Tools::getValue('setShopContext');
$context->cookie->shopContext = Tools::getValue('setShopContext');
$url = parse_url($_SERVER['REQUEST_URI']);
$query = (isset($url['query'])) ? $url['query'] : '';
parse_str($query, $parseQuery);
Expand Down
8 changes: 4 additions & 4 deletions admin-dev/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@
{
/* Seeking for employee */
$employee = new Employee();
$employee = $employee->getByemail($email, $passwd);
if (!$employee)
if (!$employee->getByemail($email, $passwd))
{
$errors[] = Tools::displayError('Employee does not exist or password is incorrect.');
$cookie->logout();
$employee->logout();
}
else
{
$employee->remote_addr = ip2long(Tools::getRemoteAddr());
/* Creating cookie */
$cookie->id_employee = $employee->id;
$cookie->email = $employee->email;
$cookie->profile = $employee->id_profile;
$cookie->passwd = $employee->passwd;
$cookie->remote_addr = ip2long(Tools::getRemoteAddr());
$cookie->remote_addr = $employee->remote_addr;
$cookie->write();
/* Redirect to admin panel */
if (isset($_GET['redirect']))
Expand Down
2 changes: 0 additions & 2 deletions admin-dev/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
include(PS_ADMIN_DIR.'/../config/config.inc.php');
include(PS_ADMIN_DIR.'/functions.php');

$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));

$errors = array();

$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
Expand Down
Loading

0 comments on commit 3d733ae

Please sign in to comment.