Works on paypal module

Fix: access right
This commit is contained in:
Regis Houssin 2011-05-22 19:17:52 +00:00
parent 6d56cc196b
commit c1b1e88f17
4 changed files with 4 additions and 11 deletions

View File

@ -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__);

View File

@ -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);

View File

@ -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.)

View File

@ -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');