Files
postfixadmin/public/editactive.php
T
Jan Kruis e279c77ca5 languages/nl.lang translation from english for new function such as dkim and password
public/editactive.php			edit wrong description text it said this module is used for deleting admin domains mailbos etc
					modify templates that it is used

public/list-virtual.php			modify templates that it is used
					modify the remarks behind arguments and internal , the texteditor thought the text after this was still remark text untl is see */

public/vacation.php and
model/VacantionHandel.php		adjust date string actionFrom and activeUntil these are written in the database as e.g. 2020-10-01 15:14:00 and 2020-10-30-15:14:00
					this should be 2020-10-01 00:00:00 and 2020-10-30 23:59:59 so that it contains all day, this happens if no holiday has been set for the account yet
					when adjusting the dates, the seconds of until are set to 00 instead of 59. When the holiday is canceled and then action is taken again, the from time
					to the time when the setting is made.

templates/editform.tpl			remove blank space

templates/list-virtual_mailbox.tpl	remove indent tabs
2022-10-12 17:46:15 +02:00

77 lines
2.0 KiB
PHP

<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT
*
* Further details on the project are available at http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: editactive.php
* Used to switch active status for admins, domains, mailboxes, aliases and aliasdomains, etc.
*
* Template File:
* list-virutal.tpl
* list-virutal-alias.tpl which incl list-virutal.tpl
* list-virutal-alias_domains.tpl which incl list-virutal.tpl
* list-virutal_mailbox.tpl
*/
require_once('common.php');
if (safeget('token') != $_SESSION['PFA_token']) {
die('Invalid token!');
}
$username = authentication_get_username(); # enforce login
$id = safeget('id');
$table = safeget('table');
$active = safeget('active');
if (empty($table)) {
die("Invalid table name given");
}
$handlerclass = ucfirst($table) . 'Handler';
if (!preg_match('/^[a-z]+$/', $table) || !file_exists(dirname(__FILE__) . "/../model/$handlerclass.php")) { # validate $table
die("Invalid table name given!");
}
$handler = new $handlerclass(0, $username);
$formconf = $handler->webformConfig();
authentication_require_role($formconf['required_role']);
if ($handler->init($id)) { # errors will be displayed as last step anyway, no need for duplicated code ;-)
if ($active != '0' && $active != '1') {
die(Config::Lang('invalid_parameter'));
}
if ($handler->set(array('active' => $active))) {
$handler->save();
}
}
flash_error($handler->errormsg);
flash_info($handler->infomsg);
if ($formconf['listview'] == 'list-virtual.php') {
$bits = [];
$bits['domain'] = $_SESSION['list-virtual:domain'] ?? null;
$bits['limit'] = $_SESSION['list-virtual:limit'] ?? null;
header("Location: " . $formconf['listview'] . '?' . http_build_query(array_filter($bits)));
exit(0);
}
header("Location: " . $formconf['listview']);
exit;
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */