[Kolab-devel] Patch add postfix_mynetworks to Server page

Stephan Buys s.buys at codefusion.co.za
Thu Jul 17 11:02:45 CEST 2003


Hi,

Here are two patches that adds Postfix_mynetwork support to the 
Kolab web interface. I have modified this myself a lot and seeing that
the query came through yesterday on the user list I decided to update 
the web interface.

Regards,
Stephan


Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/admin/server/index.php,v
retrieving revision 1.6
diff -u -p -r1.6 index.php
--- index.php   22 May 2003 17:50:35 -0000      1.6
+++ index.php   17 Jul 2003 08:58:40 -0000
@@ -26,6 +26,7 @@ $errors = array();
    
 $hostname = "";
 $mydomain = ""; 
+$mynetworks = ""; 
 $change = "";
 
 // print_r($HTTP_GET_VARS);
@@ -33,6 +34,8 @@ $change = "";
 if (isset($HTTP_GET_VARS['change'])) $change = trim(urldecode($HTTP_GET_VARS['change']));
 if (isset($HTTP_GET_VARS['hostname'])) $hostname = trim(urldecode($HTTP_GET_VARS['hostname']));
 if (isset($HTTP_GET_VARS['mydomain'])) $mydomain = trim(urldecode($HTTP_GET_VARS['mydomain']));
+if (isset($HTTP_GET_VARS['mynetworks'])) $mynetworks = trim(urldecode($HTTP_GET_VARS['mynetworks']));
+
 if (!($uid = $_SERVER["PHP_AUTH_USER"]) || 
     !($password=$_SERVER['PHP_AUTH_PW']) ||
     !($bind_dn = uid2dn($uid)) ||
@@ -99,6 +102,7 @@ if (!$errors) {
                 ldap_free_result($result);
              }
          }
+         if ($mynetworks) $attrs['postfix-mynetworks'][0] = $mynetworks; 
 
          if (!ldap_modify ($link,"k=kolab,".$_SESSION['base_dn'],$attrs)) 
             array_push($errors, "LDAP Error: failed to modify kolab config object ".ldap_error($link));
@@ -110,6 +114,7 @@ if (!$errors) {
        ($attrs = ldap_get_attributes($link, $entry))) {
       $hostname = $attrs['fqhostname'][0]; 
       $mydomain = $attrs['postfix-mydomain'][0];
+      $mynetworks = $attrs['postfix-mynetworks'][0];
       ldap_free_result($result);
    } else array_push($errors, "LDAP Error: could not kolab configuration object ".ldap_error($link));
 
@@ -124,6 +129,9 @@ if (!$errors) {
    print("<tr><td> E-Mail Domain</td>\n");
    print("<td><input type=\"text\" name=\"mydomain\" size=25 maxlength=80 value=\"$mydomain\"></td>\n");
    print("<td> Be advised that renaming the E-Mail Domain affects all E-Mail Addresses! </td></tr>\n");
+   print("<tr valign=\"top\"><td> Local Networks</td>\n");
+   print("<td><textarea name=\"mynetworks\" cols=\"20\" rows=\"4\">$mynetworks</textarea></td>\n");
+   print("<td> This determines the networks who are treated as authorised to postfix</td></tr>\n");
    print("</table>\n");
    print("<input type=\"hidden\" name=\"change\" value=\"change\">\n");

-------------- next part --------------
A non-text attachment was scrubbed...
Name: head_server_index.php.diff
Type: text/x-diff
Size: 4905 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20030717/146d3be5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1_0_server_index.php.diff
Type: text/x-diff
Size: 2406 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20030717/146d3be5/attachment-0001.bin>


More information about the devel mailing list