* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <*****@*****.**>
*  @copyright 2007-2014 PrestaShop SA
*  @version  Release: 0.4.4
*  @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
require_once dirname(__FILE__) . '/../../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../../init.php';
$token = Tools::getValue('token');
$admin_token = Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) Tools::getValue('id_employee'));
if ($token != $admin_token) {
    exit;
}
try {
    $sc_options = array('connection_timeout' => 30);
    $soap_client = new SoapClient((string) Configuration::get('SEUR_URLWS_SP'), $sc_options);
    $data = array('in0' => Tools::getValue('user'), 'in1' => Tools::getValue('pass'));
    $response = $soap_client->validaUsuarioStr($data);
    echo $response->out;
} catch (SoapFault $fault) {
    $url = urlencode(Tools::getValue('back')) . '&token=' . urlencode(Tools::getValue('token')) . '&codigo=Error&error=' . urlencode($fault->getMessage());
    die(Tools::redirect($url));
}