29 lines
1.3 KiB
PHP
29 lines
1.3 KiB
PHP
<?php
|
|
$useSSL = TRUE;
|
|
require_once(dirname(__FILE__).'/../../config/config.inc.php');
|
|
require_once(dirname(__FILE__).'/../../init.php');
|
|
include(dirname(__FILE__).'/invite.php');
|
|
$controller->preProcess();
|
|
|
|
$id_customer = (int) Tools::getValue('id');
|
|
if($id_customer !== 0 && Tools::getValue('pending') && Tools::getValue('adtoken') === Tools::encrypt('InviteAdmFriendsPending'.$id_customer)) {
|
|
$invite = new Invite();
|
|
$smarty->assign(array(
|
|
'friends' => $invite->getPendingFriends($id_customer),
|
|
'askName' => (int) Configuration::get('INVITE_ASK_NAME'),
|
|
'pending' => TRUE,
|
|
));
|
|
echo $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/invite/ajax_friends.tpl')? '../../themes/'._THEME_NAME_.'/modules/invite/ajax_friends.tpl': 'ajax_friends.tpl', __FILE__);
|
|
exit;
|
|
} elseif($id_customer !== 0 && Tools::getValue('adtoken') === Tools::encrypt('InviteAdmFriends'.$id_customer)) {
|
|
$invite = new Invite();
|
|
$smarty->assign(array(
|
|
'friends' => $invite->getFriends($id_customer, 1000),
|
|
'nbDay' => 3,
|
|
'askName' => (int) Configuration::get('INVITE_ASK_NAME'),
|
|
));
|
|
echo $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/invite/ajax_friends.tpl')? '../../themes/'._THEME_NAME_.'/modules/invite/ajax_friends.tpl': 'ajax_friends.tpl', __FILE__);
|
|
exit;
|
|
}
|
|
Tools::redirect();
|