edit.php:

- add user (non-admin) mode


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1717 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 10 years ago
parent e39d13aa52
commit 1edc38a798

@ -39,11 +39,18 @@ $edit = safepost('edit', safeget('edit'));
$new = 0;
if ($edit == "") $new = 1;
$handler = new $handlerclass($new, $username);
$is_admin = authentication_has_role('admin');
$handler = new $handlerclass($new, $username, $is_admin);
$formconf = $handler->webformConfig();
authentication_require_role($formconf['required_role']);
if ($is_admin) {
authentication_require_role($formconf['required_role']);
} else {
if (empty($formconf['user_hardcoded_field'])) {
die($handlerclass . ' is not available for users');
}
}
if ($new == 0 || $formconf['early_init']) {
if (!$handler->init($edit)) {

Loading…
Cancel
Save