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();