Fix: Bad alignement

This commit is contained in:
Laurent Destailleur 2011-09-05 11:16:01 +00:00
parent 78efe00c81
commit 02a94a0c82
4 changed files with 34 additions and 79 deletions

View File

@ -179,11 +179,6 @@ ProfId2PT=Núm seguretat social
ProfId3PT=Num reg. comercial ProfId3PT=Num reg. comercial
ProfId4PT=Conservatori ProfId4PT=Conservatori
ProfId5PT=- ProfId5PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
ProfId1SN=RC ProfId1SN=RC
ProfId2SN=NINEA ProfId2SN=NINEA
ProfId3SN=- ProfId3SN=-

View File

@ -179,11 +179,6 @@ ProfId2PT=Núm. seguridad social
ProfId3PT=Num reg. comercial ProfId3PT=Num reg. comercial
ProfId4PT=Conservatorio ProfId4PT=Conservatorio
ProfId5PT=- ProfId5PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
ProfId1SN=RC ProfId1SN=RC
ProfId2SN=NINEA ProfId2SN=NINEA
ProfId3SN=- ProfId3SN=-

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,12 +24,11 @@
/** /**
* Build a file from an array of events * Build a file from an array of events
* All input params and data must be encoded in $conf->charset_output * All input params and data must be encoded in $conf->charset_output
* * @param format 'vcal' or 'ical'
* @param string $format 'vcal' or 'ical' * @param title Title of export
* @param string $title Title of export * @param desc Description of export
* @param string $desc Description of export * @param events_array Array of events ('eid','startdate','duration','enddate','title','summary','category','email','url','desc','author')
* @param array $events_array Array of events ('eid','startdate','duration','enddate','title','summary','category','email','url','desc','author') * @param outputfile Output file
* @param string $outputfile Output file
* @return int <0 if ko, Nb of events in file if ok * @return int <0 if ko, Nb of events in file if ok
*/ */
function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile) function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile)
@ -280,16 +279,15 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile)
} }
/** /**
* Build a file from an array of events. * \brief Build a file from an array of events
* All input data must be encoded in $conf->charset_output * All input data must be encoded in $conf->charset_output
* * \param format 'rss'
* @param string $format 'rss' * \param title Title of export
* @param string $title Title of export * \param desc Description of export
* @param string $desc Description of export * \param events_array Array of events ('uid','startdate','summary','url','desc','author','category')
* @param array $events_array Array of events ('uid','startdate','summary','url','desc','author','category') * \param outputfile Output file
* @param string $outputfile Output file * \param filter Filter
* @param string $filter Filter * \return int <0 if ko, Nb of events in file if ok
* @return int <0 if ko, Nb of events in file if ok
*/ */
function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$filter='') function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$filter='')
{ {
@ -396,12 +394,11 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
/** /**
* Encode for cal export * \brief Encode for cal export
* string must be encoded in conf->file->character_set_client * \param format vcal or ical
* * \param string string to encode
* @param string $format vcal or ical * \return string string encoded
* @param string $string string to encode * \remarks string must be encoded in conf->file->character_set_client
* @return string string encoded
*/ */
function format_cal($format,$string) function format_cal($format,$string)
{ {
@ -431,8 +428,7 @@ function format_cal($format,$string)
/** /**
* Cut string after 75 chars. Add CRLF+Space. * Cut string after 75 chars. Add CRLF+Space.
* line must be encoded in UTF-8 * line must be encoded in UTF-8
* * @param line String to convert
* @param string $line String to convert
* @return string String converted * @return string String converted
*/ */
function CalEncode($line) function CalEncode($line)
@ -477,13 +473,6 @@ function CalEncode($line)
} }
/**
* Encode into vcal format
*
* @param string $str String to convert
* @param int forcal 1=For cal
* @return string String converted
*/
function QPEncode($str,$forcal=0) function QPEncode($str,$forcal=0)
{ {
$lines = preg_split("/\r\n/", $str); $lines = preg_split("/\r\n/", $str);
@ -514,12 +503,6 @@ function QPEncode($str,$forcal=0)
return trim ( $out ); return trim ( $out );
} }
/**
* Decode vcal format
*
* @param string $str String to convert
* @return string String converted
*/
function QPDecode( $str ) function QPDecode( $str )
{ {
$out = preg_replace('/=\r?\n/', '', $str); $out = preg_replace('/=\r?\n/', '', $str);

View File

@ -87,7 +87,7 @@ $SOURCE=GETPOST("source",'alpha');
$ref=$REF=GETPOST('ref','alpha'); $ref=$REF=GETPOST('ref','alpha');
$TAG=GETPOST("tag",'alpha'); $TAG=GETPOST("tag",'alpha');
$FULLTAG=GETPOST("fulltag",'alpha'); // fulltag is tag with more informations $FULLTAG=GETPOST("fulltag",'alpha'); // fulltag is tag with more informations
$SECUREKEY=GETPOST("securekey"); // Secure key $SECUREKEY=GETPOST("securekey",'alpha'); // Secure key
if (! empty($SOURCE)) if (! empty($SOURCE))
{ {
@ -138,35 +138,10 @@ if (empty($PAYPAL_API_SIGNATURE))
return -1; return -1;
} }
// Check security token
$valid=true;
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN))
{
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
{
if ($REF) $token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . $REF); // REF always defined if SOURCE is defined
else $token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN);
}
else
{
$token = $conf->global->PAYPAL_SECURITY_TOKEN;
}
if ($SECUREKEY != $token) $valid=false;
if (! $valid)
{
print '<div class="error">Bad value for key.</div>';
//print 'SECUREKEY='.$SECUREKEY.' token='.$token.' valid='.$valid;
exit;
}
}
/* /*
* Actions * Actions
*/ */
if (GETPOST("action") == 'dopayment') if (GETPOST("action") == 'dopayment')
{ {
$PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT'); $PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT');
@ -262,7 +237,6 @@ print '<input type="hidden" name="action" value="dopayment">'."\n";
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">'."\n"; print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">'."\n";
print '<input type="hidden" name="tag" value="'.GETPOST("tag",'alpha').'">'."\n"; print '<input type="hidden" name="tag" value="'.GETPOST("tag",'alpha').'">'."\n";
print '<input type="hidden" name="suffix" value="'.GETPOST("suffix",'alpha').'">'."\n"; print '<input type="hidden" name="suffix" value="'.GETPOST("suffix",'alpha').'">'."\n";
print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
print "\n"; print "\n";
print '<!-- Form to send a Paypal payment -->'."\n"; print '<!-- Form to send a Paypal payment -->'."\n";
print '<!-- PAYPAL_API_SANDBOX = '.$conf->global->PAYPAL_API_SANDBOX.' -->'."\n"; print '<!-- PAYPAL_API_SANDBOX = '.$conf->global->PAYPAL_API_SANDBOX.' -->'."\n";
@ -329,8 +303,16 @@ $found=false;
$error=0; $error=0;
$var=false; $var=false;
// Check security token
$valid=true;
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN) )
{
$token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . $SOURCE . $ref, 2);
if ($SECUREKEY != $token) $valid=false;
}
// Free payment // Free payment
if (! GETPOST("source") && $valid) if (! GETPOST("source"))
{ {
$found=true; $found=true;
$tag=GETPOST("tag"); $tag=GETPOST("tag");