This commit is contained in:
rGaillard
2011-07-06 10:10:43 +00:00
parent 31d94236ac
commit d1a13007b9
4695 changed files with 0 additions and 339293 deletions
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>reverso</name>
<displayName>ReversoForm</displayName>
<version>1.0</version>
<description>Fill Authentication form with ReversoForm</description>
<author></author>
<tab>front_office_features</tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries>fr</limited_countries>
</module>
-16
View File
@@ -1,16 +0,0 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{reverso}prestashop>reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Füllen Sie das Authentifizierungsformular mit ReversoForm aus';
$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Konfiguration';
$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Seriennummer';
$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Webseiten-Adresse';
$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Aktualisierung';
$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Reverso Kontokonfiguration';
$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Sie haben noch kein ReversoForm-Konto?';
$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Jetzt anmelden!';
$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert';
$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Wir können diese Nummer nicht finden ';
$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Tragen Sie Ihre Telefonnummer automatisch in dieses Formular ein ';
-16
View File
@@ -1,16 +0,0 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{reverso}prestashop>reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Rellenar el formulario de autentificación con ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configuración';
$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Número de serie';
$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Dirección del sitio';
$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Actualizar';
$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configuración de la cuenta ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = '¿Aún no tiene una cuenta Reverso?';
$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Regístrese ahora';
$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados';
$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Imposible encontrar ese número';
$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Completar el formulario automáticamente con su número de teléfono';
-16
View File
@@ -1,16 +0,0 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{reverso}prestashop>reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Remplir le formulaire d\'authentification avec ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configuration';
$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Numéro de série';
$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Adresse du site';
$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Mettre à jour';
$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configuration compte Reverso';
$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Vous n\'avez pas de compte Reverso ?';
$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Enregistrez vous maintenant !';
$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour';
$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Impossible de trouver ce numéro';
$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Complétez automatiquement le formulaire avec votre numéro de téléphone';
-16
View File
@@ -1,16 +0,0 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{reverso}prestashop>reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Compila modulo di autenticazione con ReversoForm';
$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configurazione';
$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Numero di serie';
$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Indirizzo del sito';
$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Aggiornamento';
$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configurazione account Reverso';
$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Non hai ancora un account ReversoForm?';
$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Registrati ora!';
$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Le impostazioni sono aggiornate';
$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Non possiamo trovare questo numero';
$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Compilare automaticamente questo modulo con il tuo numero di telefono';
-26
View File
@@ -1,26 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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 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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");header("Cache-Control: no-store, no-cache, must-revalidate");header("Cache-Control: post-check=0, pre-check=0", false);header("Pragma: no-cache");header("Location: ../");exit;
-63
View File
@@ -1,63 +0,0 @@
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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 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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function updateAddress(phone)
{
$.ajax({
type: 'GET',
url: baseDir+'modules/reverso/reverso_check.php?phone=' + $('#reverso_form').val(),
async: true,
cache: false,
type: 'text',
success: function(data)
{
if (data == 0)
{
alert(unknown_number);
return false;
}
else if (data == 11)
{
return false;
}
var fields = data.split(',');
$(fields).each(function(){
var field = this.split(':');
$('form#account-creation_form input[name=\''+ field[0] +'\']').val(field[1]);
});
}
});
return false;
}
$(document).ready(function(){
$('#reverso_form').typeWatch({
callback:function(){ updateAddress();},
wait:800,
highlight:false,
enterkey:false
});
});
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1021 B

-168
View File
@@ -1,168 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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 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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_CAN_LOAD_FILES_'))
exit;
class Reverso extends Module
{
private $_html;
private $_api_url = 'http://api2.reversoform.com/includes/api.controler.reverso2.php?phone_number={ARG_PHONE}&serial={ARG_SERIAL}&remoteAddress={ARG_ADDRESS}';
function __construct()
{
$this->name = 'reverso';
$this->tab = 'front_office_features';
$this->version = '1.0';
// Iso code of countries where the module can be used, if none module available for all countries
$this->limited_countries = array('fr');
parent::__construct();
/* The parent construct is required for translations */
$this->displayName = $this->l('ReversoForm');
$this->description = $this->l('Fill Authentication form with ReversoForm');
}
public function install()
{
// Check if hook exists
$result = Db::getInstance()->getValue('
SELECT COUNT(*) AS total
FROM `'._DB_PREFIX_.'hook`
WHERE `name` = \'createAccountTop\'
');
if (!$result)
if(!Db::getInstance()->Execute('
INSERT INTO `'._DB_PREFIX_.'hook` (`name`, `title`, `description`, `position`)
VALUES (\'createAccountTop\', \'Block above the form for create an account\', NULL , \'1\');
'))
return false;
if (!parent::install())
return false;
if (!$this->registerHook('createAccountTop'))
return false;
return (Configuration::updateValue('REVERSO_SERIAL', '0123456789123') AND
Configuration::updateValue('REVERSO_BAD_NUMBER', 1) AND
Configuration::updateValue('REVERSO_UNKNOWN_NUMBER', 2) AND
Configuration::updateValue('REVERSO_ADDRESS', str_replace('http://', '', $_SERVER['HTTP_HOST'])));
}
private function _postProcess()
{
return (Configuration::updateValue('REVERSO_SERIAL', pSQL(Tools::getValue('reverso_serial'))) AND
Configuration::updateValue('REVERSO_ADDRESS', pSQL(Tools::getValue('reverso_address'))));
}
public function hookCreateAccountTop($params)
{
global $smarty;
$tag = '<img src='.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').'api.reversoform.com/includes/'.(Configuration::get('PS_SSL_ENABLED') ? 'www.reversoform.com/' : '').'js/trans.giff?d='.date('U').' with="0" height="0" />';
$smarty->assign(array('reverso_tag' => $tag));
return $this->display(__FILE__, 'reverso.tpl');
}
private function _displayForm()
{
$conf = Configuration::getMultiple(array('REVERSO_SERIAL', 'REVERSO_ADDRESS'));
$this->_html .=
'<br /><fieldset><legend>'.$this->l('Configuration').'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
<label for="serial">'.$this->l('Serial number').' :</label>
<div class="margin-form">
<input type="text" name="reverso_serial" value="'.$conf['REVERSO_SERIAL'].'" />
</div>
<label for="address">'.$this->l('Site address').': </label>
<div class="margin-form">
<input type="text" name="reverso_address" value="'.$conf['REVERSO_ADDRESS'].'" />
</div>
<input type="submit" name="submitReverso" class="button" value="'.$this->l('Update').'" />
</form></fieldset>';
}
public function getContent()
{
$this->_html .= '<h2>'.$this->l('Reverso account configuration').'</h2>
'.$this->l('You don\'t have a ReversoForm account yet?').' <a href="http://www.reversoform.com/api/">'.$this->l('Register now!').'</a>';
if (!empty($_POST))
{
if ($this->_postProcess())
$this->_html .= $this->displayConfirmation($this->l('Settings are updated').'<img src="http://www.prestashop.com/modules/reverso.png?serial='.urlencode(Tools::getValue('reverso_serial')).'" style="float:right" />');
}
else
$this->_html .= '<br />';
$this->_displayForm();
return $this->_html;
}
public function callReverso($phone = false)
{
if ($phone === false)
return false;
$conf = Configuration::getMultiple(array('REVERSO_SERIAL',
'REVERSO_ADDRESS',
'REVERSO_BAD_NUMBER',
'REVERSO_UNKNOWN_NUMBER'));
$phone = str_replace(array(' '), '', $phone);
if (strlen($phone) < 10)
return (int)($conf['REVERSO_BAD_NUMBER']);
$url_to_call = str_replace(array('{ARG_PHONE}', '{ARG_SERIAL}', '{ARG_ADDRESS}'), array($phone, $conf['REVERSO_SERIAL'], $conf['REVERSO_ADDRESS']), $this->_api_url);
$reverso = file_get_contents($url_to_call);
$address = Tools::jsonDecode($reverso, true);
if ($address == 'NULL')
return (int)($conf['REVERSO_BAD_NUMBER']);
$fields = array('last_name' => 'lastname',
'first_name' => 'firstname',
'zip' => 'postcode',
'city' => 'city',
'address' => 'address1',
'company' => 'company'
);
$to_presta = array();
foreach ($fields AS $k => $field)
if (array_key_exists($k, $address))
$to_presta[$field] = $address[$k];
$to_presta = '';
foreach ($fields AS $k => $field)
$to_presta .= (array_key_exists($k, $address) ? $field.':'.$address[$k].',' : '');
$to_presta .= 'customer_firstname:'.(array_key_exists('first_name', $address) ? $address['first_name'] : '').',customer_lastname:'.(array_key_exists('last_name', $address) ? $address['last_name'] : '');
return rtrim($to_presta, ',');
}
}
-39
View File
@@ -1,39 +0,0 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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 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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$reverso_tag}
<script type="text/javascript">
var unknown_number = '{l s='We can\'t find this number'}';
</script>
<script type="text/javascript" src="{$module_dir}js/reverso.js"></script>
<fieldset class="account_creation">
<p class="text">
<label for="reverso_form">{l s='Automatically fill this form with your phone number' mod='reverso'}*</label>
<input type="text" name="reverso_form" autocomplete="off" id="reverso_form" class="text" value="" maxlength="10" />
<span style="text-align:right;font-style:italic;font-size:7pt;">*reversoform powered</span>
</p>
</fieldset>
-41
View File
@@ -1,41 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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 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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/reverso.php');
if (!class_exists('Reverso'))
Tools::d(Tools::displayError('Error in loading Reverso'));
$reverso = new Reverso();
if (!Validate::isLoadedObject($reverso))
Tools::d(Tools::displayError('Error in loading Reverso'));
$reverso_result = $reverso->callReverso(pSQL(Tools::getValue('phone')));
echo $reverso_result;
exit;