function table_row_add_extra($row, $row_key, $data, $class = "")
 {
     global $sess, $auth, $perm, $Path;
     $db = new DB_postfix();
     echo "<td class='btable'>";
     echo " <a href=\"" . $sess->url('postfix_mailbox.php') . $sess->add_query(array("domain" => $data["domain"])) . "\">mailboxes";
     $db->query("select count(*) from postfix_mailbox where email like '%@" . $data["domain"] . "'");
     if ($db->next_record()) {
         echo "(" . $db->f(0) . ")";
     }
     echo "</a>";
     echo " <a href=\"" . $sess->url('postfix_virtual.php') . $sess->add_query(array("domain" => $data["domain"])) . "\">aliases";
     $db->query("select count(*) from postfix_virtual where email like '%@" . $data["domain"] . "'");
     if ($db->next_record()) {
         echo "(" . $db->f(0) . ")";
     }
     echo "</a>";
     if ($perm) {
         if ($perm->have_perm("admin")) {
             echo " <a href=\"" . $sess->url('postfix_virtual_domains.php') . $sess->add_query(array("cmd" => "Delete", "id" => $data["id"])) . "\">delete</a>";
         }
     }
     if ($this->edit) {
         echo "<input type='submit' value='Save' name='submit' class='ipeh'> ";
         echo "<input type='hidden' value='" . $data["id"] . "' name='id'> ";
     }
     echo "</td>";
 }
 case "View":
 case "Delete":
     $f->freeze();
 case "Add":
 case "Edit":
     echo "<font class=bigTextBold>{$cmd} postfix _sender _access</font>\n";
     $f->display();
     break;
 default:
     $cmd = "Query";
     $t = new postfix_sender_accessTable();
     $t->heading = 'on';
     $t->add_extra = 'on';
     $t->add_insert = 'my_postfix_sender_accessform';
     $t->edit = 'my_postfix_sender_accessform';
     $db = new DB_postfix();
     //echo "&nbsp<a href=\"".$sess->self_url()
     //	.$sess->add_query(array("cmd"=>"Add"))."\">Add postfix _sender _access</a>&nbsp\n";
     //echo "&nbsp<a href=\"".$sess->url("/index.php")."\">Home</a>&nbsp\n";
     echo "<br><font class=bigTextBold>Access Control by Sender (From) Email Address</font>\n";
     // These fields will be searchable and displayed in results.
     // Format is "RealFieldName"=>"Field Name Formatted For Display",
     $t->fields = array("address", "access", "level");
     $t->map_cols = array("address" => "address", "access" => "access", "level" => "level", "modified" => "modified", "notes" => "notes");
     // When we hit this page the first time,
     // there is no .
     if (!isset($q)) {
         $q = new postfix_sender_access_Sql_Query();
         // We make one
         $q->conditions = 1;
         // ... with a single condition (at first)
Ejemplo n.º 3
0
 {
     var $classname = "postfix_virtualTable";
     function table_row_add_extra($row, $row_key, $data, $class = "")
     {
         global $sess, $auth, $perm;
         echo "<td><a href=\"" . $sess->self_url() . $sess->add_query(array("cmd" => "View", "id" => $data["id"])) . "\">view</a></td>";
         echo "<td><a href=\"" . $sess->self_url() . $sess->add_query(array("cmd" => "Edit", "id" => $data["id"])) . "\">edit</a></td>";
         echo "<td><a href=\"" . $sess->self_url() . $sess->add_query(array("cmd" => "Delete", "id" => $data["id"])) . "\">delete</a></td>";
     }
 }
 $t = new postfix_virtualTable();
 $t->heading = 'on';
 $t->add_extra = 'on';
 $t->add_insert = 'my_postfix_virtualform';
 $t->edit = 'my_postfix_virtualform';
 $db = new DB_postfix();
 //echo "<br><a href=\"".$sess->self_url()
 //	.$sess->add_query(array("cmd"=>"Add"))."\">Add postfix _virtual</a>&nbsp\n";
 echo "<br><font class=bigTextBold>User Alias - email addresses that are forwarded to new destination(s)</font>\n";
 // These fields will be searchable and displayed in results.
 // Format is "RealFieldName"=>"Field Name Formatted For Display",
 $t->fields = array("email", "destination");
 $t->map_cols = array("email" => "email", "destination" => "destination", "modified" => "modified", "notes" => "notes");
 // When we hit this page the first time,
 // there is no .
 if (!isset($q)) {
     $q = new postfix_virtual_Sql_Query();
     // We make one
     $q->conditions = 1;
     // ... with a single condition (at first)
     $q->translate = "on";
Ejemplo n.º 4
0
function ListDomains($db, $sql, $title)
{
    global $sess;
    $db2 = new DB_postfix();
    $db->query($sql);
    echo "<tr><td colspan=4><h3>{$title}</h3></td></tr>\n";
    $count = 0;
    while ($db->next_record()) {
        if ($domain = $db->f(0)) {
            $count++;
            $db2->query("select count(*) from postfix_vacation where email like '%" . $domain . "'");
            $db2->next_record();
            $vacount = $db2->f(0);
            $db2->query("select count(*) from postfix_mailbox where domain='" . $domain . "'");
            $db2->next_record();
            $mbcount = $db2->f(0);
            $db2->query("select count(*) from postfix_virtual where email='@" . $domain . "'");
            $db2->next_record();
            $cacount = $db2->f(0);
            $db2->query("select count(*) from postfix_virtual where email like '%" . $domain . "'");
            $db2->next_record();
            $fwcount = $db2->f(0);
            $query = $sess->add_query(array("domain" => $domain));
            printf("<tr><td>%s</td><td><a href=%s%s>Mailboxes (%d)</a></td>" . "<td><a href=%s%s>Forwards (%d)</a></td><td><a href=%s%s>Vacation (%d)</a></td>\n", $domain, $sess->url("postfix_mailbox.php"), $query, $mbcount, $sess->url("postfix_virtual.php"), $query, $fwcount, $sess->url("Vacation.php"), $query, $vacount);
            printf("<td><a href=%s>Logs</a></td>", $sess->url("postfix_logs.php") . $sess->add_query(array("domain" => $domain)));
            if ($cacount) {
                printf("<td>&nbsp;&nbsp;<a href=%s>Recipient Access</a></td>", $sess->url("postfix_recip_access.php") . $sess->add_query(array("domain" => $domain)));
            }
            echo "</tr>\n";
        }
    }
}
Ejemplo n.º 5
0
<?php

include 'phplib/prepend.php';
page_open(array("sess" => "hotspot_Session", "auth" => "hotspot_Auth", "perm" => "hotspot_Perm"));
echo "<script language=JavaScript src=/js/currency.js></script>\n";
echo "<script language=JavaScript src=/js/datefunc.js>\n//Parts taken from ts_picker.js\n//Script by Denis Gritcyuk: tspicker@yahoo.com\n//Submitted to JavaScript Kit (http://javascriptkit.com)\n//Visit http://javascriptkit.com for this script\n</script>\n<script language=JavaScript>\nfunction SetFields(f) { \n    mailbox = f.mailbox.value;\n    domain = f.domain[f.domain.selectedIndex].value;\n    f.email.value = mailbox+'@'+domain;\n    f.maildir.value = domain+'/'+mailbox+'/Maildir/';\n    url = 'find.php?MailboxExists='+mailbox+'%40';\n    ajax(url,f.domain);\n}\nfunction DoCustomChecks(f) {\n        if (f.bulk.value) {\n                if (f.address.value=='') f.address.value=' ';\n                if (f.access.value=='') f.access.value=' ';\n        }\n        m = f.mailbox.value;\n        e = f.domain;\n        if (e.selectedIndex==0) {\n                alert('Please select domain');\n\t\te.focus();\n                return false;\n        }\n        d = e.options[e.selectedIndex].value;\n        if (m=='') {\n                alert('Please enter a value for mailbox part of the email address.');\n\t\tf.mailbox.focus();\n                return false;\n        } else {\n                f.email.value = m + '@' + d;\n        }\n        return true;\n}\n</script> \n";
include "postfix.inc";
class my_postfix_mailboxform extends postfix_mailboxform
{
    var $classname = "my_postfix_mailboxform";
}
$db = new DB_postfix();
$f = new my_postfix_mailboxform();
if ($submit) {
    switch ($submit) {
        case "Save":
            if ($id) {
                $submit = "Edit";
            } else {
                $submit = "Add";
            }
        case "Add":
        case "Edit":
            if (isset($auth)) {
                if (!$bulk and !$f->validate($result)) {
                    $cmd = $submit;
                    echo "<font class=bigTextBold>{$cmd} postfix _mailbox</font>\n";
                    $f->display();
                    page_close();
                    exit;
                } else {