* @license GNU GPL v2 or later. 
 * 
 * File: edit-active-domain.php 
 * Responsible for toggling the status of a domain
 * Template File: message.php
 *
 * Template Variables:
 *
 * tMessage
 *
 * Form POST \ GET Variables:
 *
 * fDomain
 */
require_once 'common.php';
authentication_require_role('global-admin');
if ($_SERVER['REQUEST_METHOD'] == "GET") {
    if (isset($_GET['domain'])) {
        $fDomain = escape_string($_GET['domain']);
    }
    $sqlSet = 'active=1-active';
    if ('pgsql' == $CONF['database_type']) {
        $sqlSet = 'active=NOT active';
    }
    $result = db_query("UPDATE {$table_domain} SET {$sqlSet},modified=NOW() WHERE domain='{$fDomain}'");
    if ($result['rows'] != 1) {
        $error = 1;
        $tMessage = $PALANG['pAdminEdit_domain_result_error'];
    }
    if ($error != 1) {
        header("Location: list-domain.php");
Пример #2
0
 * this package in the file LICENSE.TXT. 
 * 
 * Further details on the project are available at http://postfixadmin.sf.net 
 * 
 * @version $Id: main.php 1558 2013-11-10 15:57:32Z christian_boltz $ 
 * @license GNU GPL v2 or later. 
 * 
 * File: main.php
 * 'Home page' for logged in users.
 * Template File: main.php
 *
 * Template Variables:
 *
 * tummVacationtext
 *
 * Form POST \ GET Variables: -none-
 */
$rel_path = '../';
require_once '../common.php';
authentication_require_role('user');
$USERID_USERNAME = authentication_get_username();
$vh = new VacationHandler($USERID_USERNAME);
if ($vh->check_vacation()) {
    $tummVacationtext = $PALANG['pUsersMain_vacationSet'];
} else {
    $tummVacationtext = $PALANG['pUsersMain_vacation'];
}
$smarty->assign('tummVacationtext', $tummVacationtext);
$smarty->assign('smarty_template', 'users_main');
$smarty->display('index.tpl');
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
Пример #3
0
 * tQuota
 * tDomain
 *
 * Form POST \ GET Variables:
 *
 * fUsername
 * fPassword
 * fPassword2
 * fName
 * fQuota
 * fDomain
 * fActive
 * fMail
 */
require_once 'common.php';
authentication_require_role('admin');
$SESSID_USERNAME = authentication_get_username();
if (authentication_has_role('global-admin')) {
    $list_domains = list_domains();
} else {
    $list_domains = list_domains_for_admin($SESSID_USERNAME);
}
$pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text'];
$pCreate_mailbox_name_text = $PALANG['pCreate_mailbox_name_text'];
$pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text'];
if ($_SERVER['REQUEST_METHOD'] == "GET") {
    $fDomain = $list_domains[0];
    if (isset($_GET['domain'])) {
        $fDomain = escape_string($_GET['domain']);
    }
    if (!in_array($fDomain, $list_domains)) {
Пример #4
0
if (safeget('token') != $_SESSION['PFA_token']) {
    die('Invalid token!');
}
$username = authentication_get_username();
# enforce login
$id = safeget('delete');
$table = safeget('table');
$handlerclass = ucfirst($table) . 'Handler';
if (!preg_match('/^[a-z]+$/', $table) || !file_exists("model/{$handlerclass}.php")) {
    # validate $table
    die("Invalid table name given!");
}
$is_admin = authentication_has_role('admin');
$handler = new $handlerclass(0, $username, $is_admin);
$formconf = $handler->webformConfig();
if ($is_admin) {
    authentication_require_role($formconf['required_role']);
} else {
    if (empty($formconf['user_hardcoded_field'])) {
        die($handlerclass . ' is not available for users');
    }
}
if ($handler->init($id)) {
    # errors will be displayed as last step anyway, no need for duplicated code ;-)
    $handler->delete();
}
flash_error($handler->errormsg);
flash_info($handler->infomsg);
header("Location: " . $formconf['listview']);
exit;
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */