Clean code

This commit is contained in:
Laurent Destailleur 2021-03-18 12:21:35 +01:00
parent af340ec133
commit 03941a59af
5 changed files with 12 additions and 7 deletions

View File

@ -32,7 +32,9 @@ require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
if (empty($user->rights->opensurvey->read)) {
accessforbidden();
}
// Initialisation des variables
$action = GETPOST('action', 'aZ09');

View File

@ -40,7 +40,9 @@ $result = $object->fetch(0, $numsondage);
if ($result <= 0) dol_print_error('', 'Failed to get survey id '.$numsondage);
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
if (empty($user->rights->opensurvey->read)) {
accessforbidden();
}
/*

View File

@ -31,7 +31,6 @@
*/
function opensurvey_prepare_head(Opensurveysondage $object)
{
global $langs, $conf;
$h = 0;

View File

@ -31,7 +31,9 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
$langs->load("opensurvey");
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
if (empty($user->rights->opensurvey->read)) {
accessforbidden();
}
$hookmanager = new HookManager($db);

View File

@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
if (empty($user->rights->opensurvey->read)) {
accessforbidden();
}
// Init vars
$action = GETPOST('action', 'aZ09');