Пример #1
0
 if (isset($_GET['address'])) {
     $fAddress = escape_string($_GET['address']);
 }
 $fAddress = strtolower($fAddress);
 if (isset($_GET['domain'])) {
     $fDomain = escape_string($_GET['domain']);
 }
 if (isset($_POST['fGoto'])) {
     $fGoto = escape_string($_POST['fGoto']);
 }
 $fGoto = strtolower($fGoto);
 if (!(check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin'))) {
     $error = 1;
     $tGoto = $_POST['fGoto'];
     $tMessage = $PALANG['pEdit_alias_domain_error'] . "{$fDomain}</span>";
 } elseif (!check_alias_owner($SESSID_USERNAME, $fAddress)) {
     $error = 1;
     $tGoto = $fGoto;
     $tMessage = $PALANG['pEdit_alias_result_error'];
 }
 $goto = preg_replace('/\\\\r\\\\n/', ',', $fGoto);
 $goto = preg_replace('/\\r\\n/', ',', $goto);
 $goto = preg_replace('/[\\s]+/i', '', $goto);
 $goto = preg_replace('/,*$|^,*/', '', $goto);
 $goto = preg_replace('/,,*/', ',', $goto);
 if (empty($goto)) {
     $error = 1;
     $tGoto = $_POST['fGoto'];
     $tMessage = $PALANG['pEdit_alias_goto_text_error1'];
 }
 if ($error != 1) {
Пример #2
0
            }
            print "      <td>" . $tAlias[$i]['display_address'] . "</td>\n";
            if (stristr($tAlias[$i]['goto'], $fSearch)) {
                $new_goto = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" . $fSearch . "</span>", $tAlias[$i]['goto']);
                $tAlias[$i]['goto'] = $new_goto;
            }
            print "      <td>" . ereg_replace(",", "<br>", $tAlias[$i]['goto']) . "</td>\n";
            print "      <td>" . $tAlias[$i]['modified'] . "</td>\n";
            if ($CONF['special_alias_control'] == 'YES' || authentication_has_role('global-admin')) {
                $active = $tAlias[$i]['active'] == 1 ? $PALANG['YES'] : $PALANG['NO'];
                print "      <td><a href=\"edit-active.php?alias=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "&return=search.php?search=" . urlencode($fSearch) . "\">" . $active . "</a></td>\n";
                print "      <td><a href=\"edit-alias.php?address=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
                print "      <td><a href=\"delete.php?table=alias&";
                print "delete=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": " . $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
            } else {
                if (check_alias_owner($SESSID_USERNAME, $tAlias[$i]['address'])) {
                    $active = $tAlias[$i]['active'] == 1 ? $PALANG['YES'] : $PALANG['NO'];
                    print "      <td><a href=\"edit-active.php?alias=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "&return=search.php?search=" . urlencode($fSearch) . "\">" . $active . "</a></td>\n";
                    print "      <td><a href=\"edit-alias.php?address=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
                    print "      <td><a href=\"delete.php?delete=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": " . $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
                } else {
                    print "      <td>&nbsp;</td>\n";
                    print "      <td>&nbsp;</td>\n";
                }
            }
            print "   </tr>\n";
        }
    }
    print "</table>\n";
}
if (sizeof($tMailbox) > 0) {
Пример #3
0
    if ($CONF['vacation'] == "YES") {
        $result_vacation = db_delete($table_vacation, $fWhere, $fDelete);
    }
    $result_domain = db_delete($table_domain, $fWhere, $fDelete);
    if (!$result_domain || !domain_postdeletion($fDelete)) {
        $error = 1;
        $tMessage = $PALANG['pAdminDelete_domain_error'];
    } else {
        $url = "list-domain.php";
        header("Location: {$url}");
    }
} elseif ($fTable == "alias" or $fTable == "mailbox") {
    if (!check_owner($SESSID_USERNAME, $fDomain)) {
        $error = 1;
        $tMessage = $PALANG['pDelete_domain_error'] . "<b>{$fDomain}</b>!</span>";
    } elseif (!check_alias_owner($SESSID_USERNAME, $fDelete)) {
        $error = 1;
        $tMessage = $PALANG['pDelete_alias_error'] . "<b>{$fDelete}</b>!</span>";
    } else {
        if ($CONF['database_type'] == "pgsql") {
            db_query('BEGIN');
        }
        $result = db_query("DELETE FROM {$table_alias} WHERE address='{$fDelete}' AND domain='{$fDomain}'");
        if ($result['rows'] != 1) {
            $error = 1;
            $tMessage = $PALANG['pDelete_delete_error'] . "<b>{$fDelete}</b> (alias)!</span>";
        } else {
            db_log($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete);
        }
        if (!$error) {
            $result = db_query("SELECT * FROM {$table_mailbox} WHERE username='******' AND domain='{$fDomain}'");