Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
ede06796
Commit
ede06796
authored
13 years ago
by
Regis Houssin
Browse files
Options
Downloads
Plain Diff
Merge pull request #154 from simnandez/develop
Fix: Sanitize data
parents
b6242649
a8b04935
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/boutique/admin/boutique.php
+23
-22
23 additions, 22 deletions
htdocs/boutique/admin/boutique.php
htdocs/paybox/admin/paybox.php
+11
-11
11 additions, 11 deletions
htdocs/paybox/admin/paybox.php
htdocs/paypal/admin/paypal.php
+24
-24
24 additions, 24 deletions
htdocs/paypal/admin/paypal.php
with
58 additions
and
57 deletions
htdocs/boutique/admin/boutique.php
+
23
−
22
View file @
ede06796
...
...
@@ -3,6 +3,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
...
...
@@ -39,17 +40,17 @@ if (!$user->admin) accessforbidden();
* Actions
*/
if
(
$_
POST
[
"
save
"
]
)
if
(
GET
POST
(
'
save
'
,
'alpha'
)
)
{
$db
->
begin
();
$i
=
0
;
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_HOST'
,
trim
(
$_
POST
[
"
oscommerce_dbhost
"
]
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_NAME'
,
trim
(
$_
POST
[
"
oscommerce_dbname
"
]
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_USER'
,
trim
(
$_
POST
[
"
oscommerce_dbuser
"
]
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_PASS'
,
trim
(
$_
POST
[
"
oscommerce_dbpass
"
]
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_TABLE_PREFIX'
,
trim
(
$_
POST
[
"
oscommerce_db_table_prefix
"
]
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_HOST'
,
trim
(
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
)
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_NAME'
,
trim
(
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
)
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_USER'
,
trim
(
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_PASS'
,
trim
(
GET
POST
(
'
oscommerce_dbpass
'
,
'alpha'
)
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_DB_TABLE_PREFIX'
,
trim
(
GET
POST
(
'
oscommerce_db_table_prefix
'
,
'alpha'
)
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$i
+=
dolibarr_set_const
(
$db
,
'OSC_LANGUAGE_ID'
,
1
,
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
$i
>=
4
)
...
...
@@ -64,18 +65,18 @@ if ($_POST["save"])
exit
;
}
}
elseif
(
$_
POST
[
"
test
"
]
)
elseif
(
GET
POST
(
'
test
'
,
'alpha'
)
)
{
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
// Test de la connexion a la database webcalendar
$conf
->
oscommerce
->
db
->
type
=
$dolibarr_main_db_type
;
$conf
->
oscommerce
->
db
->
host
=
$_
POST
[
"
oscommerce_dbhost
"
]
;
$conf
->
oscommerce
->
db
->
port
=
$_
POST
[
"
oscommerce_dbport
"
]
;
$conf
->
oscommerce
->
db
->
name
=
$_
POST
[
"
oscommerce_dbname
"
]
;
$conf
->
oscommerce
->
db
->
user
=
$_
POST
[
"
oscommerce_dbuser
"
]
;
$conf
->
oscommerce
->
db
->
pass
=
$_
POST
[
"
oscommerce_dbpass
"
]
;
$conf
->
oscommerce
->
db
->
host
=
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
)
;
$conf
->
oscommerce
->
db
->
port
=
GET
POST
(
'
oscommerce_dbport
'
,
'alpha'
)
;
$conf
->
oscommerce
->
db
->
name
=
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
)
;
$conf
->
oscommerce
->
db
->
user
=
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
;
$conf
->
oscommerce
->
db
->
pass
=
GET
POST
(
'
oscommerce_dbpass
'
,
'alpha'
)
;
$oscommercedb
=
getDoliDBInstance
(
$conf
->
oscommerce
->
db
->
type
,
$conf
->
oscommerce
->
db
->
host
,
$conf
->
oscommerce
->
db
->
user
,
$conf
->
oscommerce
->
db
->
pass
,
$conf
->
oscommerce
->
db
->
name
,
$conf
->
oscommerce
->
db
->
port
);
...
...
@@ -87,11 +88,11 @@ elseif ($_POST["test"])
$sql
.
=
" WHERE configuration_key='STORE_NAME'"
;
$resql
=
$oscommercedb
->
query
(
$sql
);
if
(
$resql
)
{
$mesg
=
"<div class=
\"
ok
\"
>"
.
$langs
->
trans
(
"OSCommerceTestOk"
,
$_
POST
[
"
oscommerce_dbhost
"
],
$_
POST
[
"
oscommerce_dbname
"
],
$_
POST
[
"
oscommerce_dbuser
"
]
);
$mesg
=
"<div class=
\"
ok
\"
>"
.
$langs
->
trans
(
"OSCommerceTestOk"
,
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
),
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
),
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
);
$mesg
.
=
"</div>"
;
}
else
{
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceErrorConnectOkButWrongDatabase"
,
'STORE_NAME'
,
$_
POST
[
"
oscommerce_db_table_prefix
"
]
.
"configuration"
);
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceErrorConnectOkButWrongDatabase"
,
'STORE_NAME'
,
GET
POST
(
'
oscommerce_db_table_prefix
'
,
'alpha'
)
.
"configuration"
);
$mesg
.
=
"</div>"
;
}
...
...
@@ -99,14 +100,14 @@ elseif ($_POST["test"])
}
elseif
(
$oscommercedb
->
connected
==
1
&&
$oscommercedb
->
database_selected
!=
1
)
{
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceTestKo1"
,
$_
POST
[
"
oscommerce_dbhost
"
],
$_
POST
[
"
oscommerce_dbname
"
]
);
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceTestKo1"
,
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
),
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
)
);
$mesg
.
=
"<br>"
.
$oscommercedb
->
error
();
$mesg
.
=
"</div>"
;
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
}
else
{
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceTestKo2"
,
$_
POST
[
"
oscommerce_dbhost
"
],
$_
POST
[
"
oscommerce_dbuser
"
]
);
$mesg
=
"<div class=
\"
error
\"
>"
.
$langs
->
trans
(
"OSCommerceTestKo2"
,
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
),
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
);
$mesg
.
=
"<br>"
.
$oscommercedb
->
error
();
$mesg
.
=
"</div>"
;
}
...
...
@@ -142,7 +143,7 @@ print "</tr>";
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"OSCommerceServer"
)
.
"</td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbhost
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_dbhost
"
]
?
$_
POST
[
"
oscommerce_dbhost
"
]
:
$conf
->
global
->
OSC_DB_HOST
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbhost
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_dbhost
'
,
'alpha'
)
:
$conf
->
global
->
OSC_DB_HOST
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td>localhost"
;
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
print
"</td>"
;
...
...
@@ -150,7 +151,7 @@ print "</tr>";
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"OSCommerceDatabaseName"
)
.
"</td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbname
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_dbname
"
]
?
$_
POST
[
"
oscommerce_dbname
"
]
:
$conf
->
global
->
OSC_DB_NAME
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbname
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_dbname
'
,
'alpha'
)
:
$conf
->
global
->
OSC_DB_NAME
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td>oscommerce"
;
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
print
"</td>"
;
...
...
@@ -158,14 +159,14 @@ print "</tr>";
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"OSCommercePrefix"
)
.
"</td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_db_table_prefix
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_db_table_prefix
"
]
?
$_
POST
[
"
oscommerce_db_table_prefix
"
]
:
$conf
->
global
->
DB_TABLE_PREFIX
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_db_table_prefix
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_db_table_prefix
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_db_table_prefix
'
,
'alpha'
)
:
$conf
->
global
->
DB_TABLE_PREFIX
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td>osc_"
;
print
"</td>"
;
print
"</tr>"
;
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"OSCommerceUser"
)
.
"</td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbuser
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_dbuser
"
]
?
$_
POST
[
"
oscommerce_dbuser
"
]
:
$conf
->
global
->
OSC_DB_USER
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
text
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbuser
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_dbuser
'
,
'alpha'
)
:
$conf
->
global
->
OSC_DB_USER
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td>oscommerceuser"
;
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
print
"</td>"
;
...
...
@@ -173,7 +174,7 @@ print "</tr>";
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"Password"
)
.
"</td>"
;
print
"<td><input type=
\"
password
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbpass
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_dbpass
"
]
?
$_
POST
[
"
oscommerce_dbpass
"
]
:
$conf
->
global
->
OSC_DB_PASS
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
password
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbpass
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_dbpass
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_dbpass
'
,
'alpha'
)
:
$conf
->
global
->
OSC_DB_PASS
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
'<td>'
;
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
print
' </td>'
;
...
...
@@ -181,7 +182,7 @@ print "</tr>";
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$langs
->
trans
(
"PasswordRetype"
)
.
"</td>"
;
print
"<td><input type=
\"
password
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbpass2
\"
value=
\"
"
.
(
$_
POST
[
"
oscommerce_dbpass2
"
]
?
$_
POST
[
"
oscommerce_dbpass2
"
]
:
$conf
->
global
->
OSC_DB_PASS
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
"<td><input type=
\"
password
\"
class=
\"
flat
\"
name=
\"
oscommerce_dbpass2
\"
value=
\"
"
.
(
GET
POST
(
'
oscommerce_dbpass2
'
,
'alpha'
)
?
GET
POST
(
'
oscommerce_dbpass2
'
,
'alpha'
)
:
$conf
->
global
->
OSC_DB_PASS
)
.
"
\"
size=
\"
30
\"
></td>"
;
print
'<td>'
;
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
print
' </td>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/paybox/admin/paybox.php
+
11
−
11
View file @
ede06796
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011
Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011
-2012
Juanjo Menent <jmenent@2byte.es>
*
* 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
...
...
@@ -36,30 +36,30 @@ $langs->load("paybox");
if
(
!
$user
->
admin
)
accessforbidden
();
$action
=
GETPOST
(
"
action
"
);
$action
=
GETPOST
(
'
action
'
,
'alpha'
);
if
(
$action
==
'setvalue'
&&
$user
->
admin
)
{
$db
->
begin
();
//$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"],'chaine',0,'',$conf->entity);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CGI_URL_V1"
,
GETPOST
(
"
PAYBOX_CGI_URL_V1
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CGI_URL_V1"
,
GETPOST
(
'
PAYBOX_CGI_URL_V1
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CGI_URL_V2"
,
GETPOST
(
"
PAYBOX_CGI_URL_V2
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CGI_URL_V2"
,
GETPOST
(
'
PAYBOX_CGI_URL_V2
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_IBS_SITE"
,
GETPOST
(
"
PAYBOX_IBS_SITE
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_IBS_SITE"
,
GETPOST
(
'
PAYBOX_IBS_SITE
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_IBS_RANG"
,
GETPOST
(
"
PAYBOX_IBS_RANG
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_IBS_RANG"
,
GETPOST
(
'
PAYBOX_IBS_RANG
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_PBX_IDENTIFIANT"
,
GETPOST
(
"
PAYBOX_PBX_IDENTIFIANT
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_PBX_IDENTIFIANT"
,
GETPOST
(
'
PAYBOX_PBX_IDENTIFIANT
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CREDITOR"
,
GETPOST
(
"
PAYBOX_CREDITOR
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CREDITOR"
,
GETPOST
(
'
PAYBOX_CREDITOR
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CSS_URL"
,
GETPOST
(
"
PAYBOX_CSS_URL
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_CSS_URL"
,
GETPOST
(
'
PAYBOX_CSS_URL
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_MESSAGE_OK"
,
GETPOST
(
"
PAYBOX_MESSAGE_OK
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_MESSAGE_OK"
,
GETPOST
(
'
PAYBOX_MESSAGE_OK
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_MESSAGE_KO"
,
GETPOST
(
"
PAYBOX_MESSAGE_KO
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYBOX_MESSAGE_KO"
,
GETPOST
(
'
PAYBOX_MESSAGE_KO
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
if
(
!
$error
)
...
...
This diff is collapsed.
Click to expand it.
htdocs/paypal/admin/paypal.php
+
24
−
24
View file @
ede06796
...
...
@@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011
Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011
-2012
Juanjo Menent <jmenent@2byte.es>
*
* 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
...
...
@@ -39,34 +39,34 @@ $langs->load("paybox");
if
(
!
$user
->
admin
)
accessforbidden
();
$action
=
GETPOST
(
"
action
"
);
$action
=
GETPOST
(
'
action
'
,
'alpha'
);
if
(
$action
==
'setvalue'
&&
$user
->
admin
)
{
$db
->
begin
();
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_SANDBOX"
,
GETPOST
(
"
PAYPAL_API_SANDBOX
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_SANDBOX"
,
GETPOST
(
'
PAYPAL_API_SANDBOX
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_USER"
,
GETPOST
(
"
PAYPAL_API_USER
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_USER"
,
GETPOST
(
'
PAYPAL_API_USER
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_PASSWORD"
,
GETPOST
(
"
PAYPAL_API_PASSWORD
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_PASSWORD"
,
GETPOST
(
'
PAYPAL_API_PASSWORD
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_SIGNATURE"
,
GETPOST
(
"
PAYPAL_API_SIGNATURE
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_SIGNATURE"
,
GETPOST
(
'
PAYPAL_API_SIGNATURE
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_CREDITOR"
,
GETPOST
(
"
PAYPAL_CREDITOR
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_CREDITOR"
,
GETPOST
(
'
PAYPAL_CREDITOR
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_INTEGRAL_OR_PAYPALONLY"
,
GETPOST
(
"
PAYPAL_API_INTEGRAL_OR_PAYPALONLY
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_API_INTEGRAL_OR_PAYPALONLY"
,
GETPOST
(
'
PAYPAL_API_INTEGRAL_OR_PAYPALONLY
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_CSS_URL"
,
GETPOST
(
"
PAYPAL_CSS_URL
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_CSS_URL"
,
GETPOST
(
'
PAYPAL_CSS_URL
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_SECURITY_TOKEN"
,
GETPOST
(
"
PAYPAL_SECURITY_TOKEN
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_SECURITY_TOKEN"
,
GETPOST
(
'
PAYPAL_SECURITY_TOKEN
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_SECURITY_TOKEN_UNIQUE"
,
GETPOST
(
"
PAYPAL_SECURITY_TOKEN_UNIQUE
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_SECURITY_TOKEN_UNIQUE"
,
GETPOST
(
'
PAYPAL_SECURITY_TOKEN_UNIQUE
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_ADD_PAYMENT_URL"
,
GETPOST
(
"
PAYPAL_ADD_PAYMENT_URL
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_ADD_PAYMENT_URL"
,
GETPOST
(
'
PAYPAL_ADD_PAYMENT_URL
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_MESSAGE_OK"
,
GETPOST
(
"
PAYPAL_MESSAGE_OK
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_MESSAGE_OK"
,
GETPOST
(
'
PAYPAL_MESSAGE_OK
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_MESSAGE_KO"
,
GETPOST
(
"
PAYPAL_MESSAGE_KO
"
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
$result
=
dolibarr_set_const
(
$db
,
"PAYPAL_MESSAGE_KO"
,
GETPOST
(
'
PAYPAL_MESSAGE_KO
'
,
'alpha'
),
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
!
$result
>
0
)
$error
++
;
if
(
!
$error
)
...
...
@@ -286,12 +286,12 @@ if ($conf->commande->enabled)
$langs
->
load
(
"orders"
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
;
print
$langs
->
trans
(
"EnterRefToBuildUrl"
,
$langs
->
transnoentitiesnoconv
(
"Order"
))
.
': '
;
print
'<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'
.
GETPOST
(
'generate_order_ref'
)
.
'" size="10">'
;
print
'<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'
.
GETPOST
(
'generate_order_ref'
,
'alpha'
)
.
'" size="10">'
;
print
'<input type="submit" class="none" value="'
.
$langs
->
trans
(
"GetSecuredUrl"
)
.
'">'
;
if
(
GETPOST
(
'generate_order_ref'
))
if
(
GETPOST
(
'generate_order_ref'
,
'alpha'
))
{
print
'<br> -> <strong>'
;
$url
=
getPaypalPaymentUrl
(
0
,
'order'
,
GETPOST
(
'generate_order_ref'
));
$url
=
getPaypalPaymentUrl
(
0
,
'order'
,
GETPOST
(
'generate_order_ref'
,
'alpha'
));
print
$url
;
print
"</strong><br>
\n
"
;
}
...
...
@@ -308,12 +308,12 @@ if ($conf->facture->enabled)
$langs
->
load
(
"bills"
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
;
print
$langs
->
trans
(
"EnterRefToBuildUrl"
,
$langs
->
transnoentitiesnoconv
(
"Invoice"
))
.
': '
;
print
'<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'
.
GETPOST
(
'generate_invoice_ref'
)
.
'" size="10">'
;
print
'<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'
.
GETPOST
(
'generate_invoice_ref'
,
'alpha'
)
.
'" size="10">'
;
print
'<input type="submit" class="none" value="'
.
$langs
->
trans
(
"GetSecuredUrl"
)
.
'">'
;
if
(
GETPOST
(
'generate_invoice_ref'
))
if
(
GETPOST
(
'generate_invoice_ref'
,
'alpha'
))
{
print
'<br> -> <strong>'
;
$url
=
getPaypalPaymentUrl
(
0
,
'invoice'
,
GETPOST
(
'generate_invoice_ref'
));
$url
=
getPaypalPaymentUrl
(
0
,
'invoice'
,
GETPOST
(
'generate_invoice_ref'
,
'alpha'
));
print
$url
;
print
"</strong><br>
\n
"
;
}
...
...
@@ -330,12 +330,12 @@ if ($conf->contrat->enabled)
$langs
->
load
(
"contract"
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
;
print
$langs
->
trans
(
"EnterRefToBuildUrl"
,
$langs
->
transnoentitiesnoconv
(
"Contract"
))
.
': '
;
print
'<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'
.
GETPOST
(
'generate_contract_ref'
)
.
'" size="10">'
;
print
'<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'
.
GETPOST
(
'generate_contract_ref'
,
'alpha'
)
.
'" size="10">'
;
print
'<input type="submit" class="none" value="'
.
$langs
->
trans
(
"GetSecuredUrl"
)
.
'">'
;
if
(
GETPOST
(
'generate_contract_ref'
))
{
print
'<br> -> <strong>'
;
$url
=
getPaypalPaymentUrl
(
0
,
'contractline'
,
GETPOST
(
'generate_contract_ref'
));
$url
=
getPaypalPaymentUrl
(
0
,
'contractline'
,
GETPOST
(
'generate_contract_ref'
,
'alpha'
));
print
$url
;
print
"</strong><br>
\n
"
;
}
...
...
@@ -352,12 +352,12 @@ if ($conf->adherent->enabled)
$langs
->
load
(
"members"
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
;
print
$langs
->
trans
(
"EnterRefToBuildUrl"
,
$langs
->
transnoentitiesnoconv
(
"Member"
))
.
': '
;
print
'<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'
.
GETPOST
(
'generate_member_ref'
)
.
'" size="10">'
;
print
'<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'
.
GETPOST
(
'generate_member_ref'
,
'alpha'
)
.
'" size="10">'
;
print
'<input type="submit" class="none" value="'
.
$langs
->
trans
(
"GetSecuredUrl"
)
.
'">'
;
if
(
GETPOST
(
'generate_member_ref'
))
{
print
'<br> -> <strong>'
;
$url
=
getPaypalPaymentUrl
(
0
,
'membersubscription'
,
GETPOST
(
'generate_member_ref'
));
$url
=
getPaypalPaymentUrl
(
0
,
'membersubscription'
,
GETPOST
(
'generate_member_ref'
,
'alpha'
));
print
$url
;
print
"</strong><br>
\n
"
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment