This commit is contained in:
Laurent Destailleur
2024-01-27 02:22:25 +01:00
parent 1514750fc7
commit 279f9e715a
3 changed files with 25 additions and 28 deletions

View File

@@ -64,11 +64,6 @@ $langs->loadLangs(array("admin", "mymodule@mymodule"));
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('mymodulesetup', 'globalsetup'));
// Access control
if (!$user->admin) {
accessforbidden();
}
// Parameters
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@@ -79,10 +74,15 @@ $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'myobject';
$error = 0;
$setupnotempty = 0;
// Access control
if (!$user->admin) {
accessforbidden();
}
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
$useFormSetup = 1;
@@ -91,6 +91,11 @@ if (!class_exists('FormSetup')) {
}
$formSetup = new FormSetup($db);
// Access control
if (!$user->admin) {
accessforbidden();
}
// Enter here all parameters in your setup page