From c1b1e88f1731516be8c2460e412b5503c773e680 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 22 May 2011 19:17:52 +0000 Subject: [PATCH] Works on paypal module Fix: access right --- htdocs/includes/menus/init_menu_auguria.sql | 2 +- htdocs/includes/menus/standard/eldy.lib.php | 2 +- htdocs/paypal/ajaxtransaction.php | 9 --------- htdocs/paypal/transaction.php | 2 ++ 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index 3f3451b20a0..a4993687190 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -220,7 +220,7 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/virement.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__); -- Paypal -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->paypal->enabled', __HANDLER__, 'left', 6000__+MAX_llx_menu__, 'accountancy', '', 14__+MAX_llx_menu__, '/paypal/transaction.php?leftmenu=paypal&mainmenu=bank', 'PaypalAccount', 0, 'paypal', '$user->rights->paypal->transaction->read', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->paypal->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT', __HANDLER__, 'left', 6000__+MAX_llx_menu__, 'accountancy', '', 14__+MAX_llx_menu__, '/paypal/transaction.php?leftmenu=paypal&mainmenu=bank', 'PaypalAccount', 0, 'paypal', '$user->rights->paypal->transaction->read', '', 0, 1, __ENTITY__); -- Project insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/fiche.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); diff --git a/htdocs/includes/menus/standard/eldy.lib.php b/htdocs/includes/menus/standard/eldy.lib.php index edd044e2af2..c865e25da21 100644 --- a/htdocs/includes/menus/standard/eldy.lib.php +++ b/htdocs/includes/menus/standard/eldy.lib.php @@ -1021,7 +1021,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Paypal - if ($conf->paypal->enabled) + if ($conf->paypal->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT) { $langs->load("paypal"); $newmenu->add("/paypal/transaction.php?leftmenu=paypal&mainmenu=bank",$langs->trans("PaypalAccount"),0,$user->rights->paypal->transaction->read); diff --git a/htdocs/paypal/ajaxtransaction.php b/htdocs/paypal/ajaxtransaction.php index 7623cee1515..81304cae8c3 100644 --- a/htdocs/paypal/ajaxtransaction.php +++ b/htdocs/paypal/ajaxtransaction.php @@ -133,15 +133,6 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti $return_arr['error'] = 'Societe::create '.$langs->trans($soc->error); $error++; } - - if (! $error) - { - $db->commit(); - } - else - { - $db->rollback(); - } } // Add element (order, bill, etc.) diff --git a/htdocs/paypal/transaction.php b/htdocs/paypal/transaction.php index 0d318e29c12..517df2caa59 100644 --- a/htdocs/paypal/transaction.php +++ b/htdocs/paypal/transaction.php @@ -32,6 +32,8 @@ $langs->load("paypal"); $langs->load("paybox"); $langs->load("companies"); +if (! $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT) accessforbidden(); + // Security check $result=restrictedArea($user,'paypal','','','transaction');