phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] qmailldap/inc class.uiqmailldap.inc.php, 1.15 class.b


From: ceb
Subject: [Phpgroupware-cvs] qmailldap/inc class.uiqmailldap.inc.php, 1.15 class.boqmailldap.inc.php, 1.18 class.uiuserdata.inc.php, 1.8 class.soqmailldap.inc.php, 1.18 hook_admin.inc.php, 1.3 hook_preferences.inc.php, 1.6
Date: Thu, 24 Feb 2005 14:51:53 -0000

Update of qmailldap/inc

Modified Files:
     Branch: MAIN
            class.uiqmailldap.inc.php lines: +98 -85
            class.boqmailldap.inc.php lines: +52 -43
            class.uiuserdata.inc.php lines: +37 -31
            class.soqmailldap.inc.php lines: +111 -99
            hook_admin.inc.php lines: +2 -2
            hook_preferences.inc.php lines: +2 -1

Log Message:
16 to head

====================================================
Index: qmailldap/inc/class.uiqmailldap.inc.php
diff -u qmailldap/inc/class.uiqmailldap.inc.php:1.14 
qmailldap/inc/class.uiqmailldap.inc.php:1.15
--- qmailldap/inc/class.uiqmailldap.inc.php:1.14        Thu Dec 12 00:05:11 2002
+++ qmailldap/inc/class.uiqmailldap.inc.php     Mon Jan 17 14:36:54 2005
@@ -1,9 +1,9 @@
 <?php
        
/***************************************************************************\
-       * phpGroupWare - QMailLDAP                                              
    *
+       * phpGroupWare - Notes                                                  
    *
        * http://www.phpgroupware.org                                           
    *
-       * Written by : Lars Kneschke address@hidden                   *
-       * -------------------------------------------------                     
    *
+       * Written by: Lars Kneschke address@hidden                            *
+       * ----------------------------------------------                        
    *
        * This program is free software; you can redistribute it and/or modify 
it   *
        * under the terms of the GNU General Public License as published by the 
    *
        * Free Software Foundation; either version 2 of the License, or (at 
your    *
@@ -13,12 +13,6 @@

        class uiqmailldap
        {
-               #var $grants;
-               #var $cat_id;
-               #var $start;
-               #var $search;
-               #var $filter;
-
                var $public_functions = array
                (
                        'listServers'   => True,
@@ -32,13 +26,21 @@

                function uiqmailldap()
                {
-                       $this->cats                     = 
CreateObject('phpgwapi.categories');
-                       $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->boqmailldap      = 
CreateObject('qmailldap.boqmailldap');
-               }
+                       $this->cats                             = 
CreateObject('phpgwapi.categories');
+                       $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->boqmailldap              = 
CreateObject('qmailldap.boqmailldap');
+
+                       $this->rowColor[0]              = 
$GLOBALS['phpgw_info']['theme']['row_on'];
+                       $this->rowColor[1]              = 
$GLOBALS['phpgw_info']['theme']['row_off'];

+                       $this->dataRowColor[0]  = 
$GLOBALS['phpgw_info']['theme']['bg01'];
+                       $this->dataRowColor[1]  = 
$GLOBALS['phpgw_info']['theme']['bg02'];
+               }
+
                function addServer()
                {
+                       $this->display_app_header();
+
                        $GLOBALS['phpgw']->template->set_file(array('body' => 
'ldapsettings.tpl'));
                        $GLOBALS['phpgw']->template->set_block('body','main');
                        
$GLOBALS['phpgw']->template->set_block('body','menu_row');
@@ -46,37 +48,33 @@
                        
$GLOBALS['phpgw']->template->set_block('body','activation_row');

                        $this->translate();
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('qmailldap') . ': ' . lang('add server');

+                       
$GLOBALS['phpgw']->template->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
-                               'menuaction' => 
'qmailldap.uiqmailldap.listServers'
+                               'menuaction'    => 
'qmailldap.uiqmailldap.listServers'
                        );
                        
$GLOBALS['phpgw']->template->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));

-                       
$GLOBALS['phpgw']->template->set_var('qmail_servername',$values['qmail_servername']);
-                       
$GLOBALS['phpgw']->template->set_var('description',$values['description']);
-                       
$GLOBALS['phpgw']->template->set_var('qmail_dn',$values['qmail_dn']);
-
-                       
$GLOBALS['phpgw']->template->set_var('dirmaker',$values['dirmaker']);
-
-
                        $linkData = array
                        (
                                'menuaction' => 'qmailldap.uiqmailldap.save'
                        );
                        
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
-
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array
-                       (
-                               'body_data' => 
$GLOBALS['phpgw']->template->parse('out','main')
-                       ));
+
+                       $GLOBALS['phpgw']->template->pfp('out','main');
                }

                function addSmtpRoute()
                {
+                       $this->display_app_header();
+
                        $this->translate();
+
+                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
-
+
                function createMenu($_serverid, $_pagenumber, $_ldapData)
                {
                        $menu = array
@@ -117,10 +115,10 @@
                                (
                                        'menuaction'    => 
'qmailldap.uiqmailldap.editServer',
                                        'pagenumber'    => $key,
-                                       'serverid'      => $_serverid
+                                       'serverid'              => $_serverid
                                );
                                
$GLOBALS['phpgw']->template->set_var('menu_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
-
+                               
$GLOBALS['phpgw']->template->set_var('menu_row_color',$this->rowColor[$i%2]);
                                if ($_pagenumber == $key)
                                {
                                        
$GLOBALS['phpgw']->template->parse('menu_rows','menu_row_bold',True);
@@ -144,12 +142,14 @@
                                
$GLOBALS['phpgw']->template->set_var('activation_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                
$GLOBALS['phpgw']->template->parse('activation_rows','activation_row');
                        }
-
+
+                       
$GLOBALS['phpgw']->template->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
                                'menuaction' => 
'qmailldap.uiqmailldap.listServers',
                        );
                        
$GLOBALS['phpgw']->template->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
+
                }

                function deleteServer()
@@ -157,35 +157,44 @@
                        
$this->boqmailldap->deleteServer($GLOBALS['HTTP_GET_VARS']['serverid']);
                        $this->listServers();
                }
+
+               function display_app_header()
+               {
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       echo parse_navbar();
+               }

                function editServer($_serverid='', $_pagenumber='')
                {
-                       $serverid               = 
get_var('serverid',array('GET'));
-                       $pagenumber             = 
get_var('pagenumber',array('GET'));
-                       //$values                       = 
get_var('values',array('GET'));;
+                       $serverid               = 
get_var('serverid',array('POST','GET'));
+                       $HTTP_GET_VARS  = get_var('HTTP_GET_VARS',array('GET'));
+                       $pagenumber             = 
get_var('pagenumber',array('POST','GET'));

                        if(!empty($_serverid))
                        {
-                               $serverid=$_serverid;
+                               $serverid = $_serverid;
                        }
+
                        if(!empty($_pagenumber))
                        {
-                               $pagenumber=$_pagenumber;
+                               $pagenumber = $_pagenumber;
                        }

                        $ldapData = $this->boqmailldap->getLDAPData($serverid);
+
+                       $this->display_app_header();

                        $this->createMenu($serverid, $pagenumber, $ldapData);

                        $GLOBALS['phpgw']->template->set_block('body','main');
-
                        $this->translate();
-
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('qmailldap') . ': ' . lang('edit server');
+
                        $linkData = array
                        (
                                'menuaction'    => 'qmailldap.uiqmailldap.save',
                                'pagenumber'    => $pagenumber,
-                               'serverid'              => $serverid
+                               'serverid'      => $serverid
                        );
                        
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));

@@ -207,9 +216,10 @@
                                        else
                                        {
                                                
$GLOBALS['phpgw']->template->set_var('rcpt_selectbox',
-                                                       "<b>".lang("We don't 
accept any email!")."</b>");
+                                                       "<b>" . lang("We don't 
accept any email!") . "</b>");
                                        }

+
                                        if (count($ldapData['locals']) > 0)
                                        {
                                                $selectBox  = "<select 
size=\"10\" name=\"locals\">\n";
@@ -225,19 +235,21 @@
                                        else
                                        {
                                                
$GLOBALS['phpgw']->template->set_var('locals_selectbox',
-                                                       "<b>".lang("We don't 
deliver any email local!")."</b>");
+                                                       "<b>".lang('We do not 
deliver any email locally !')."</b>");
                                        }
                                        break;
                                case '15':
                                        
$GLOBALS['phpgw']->template->set_block('body','smtproute_row');
+
                                        if (count($ldapData['smtproutes']) > 0)
                                        {
                                                for ($i=0;$i < 
count($ldapData['smtproutes']); $i++)
                                                {
-                                                       $smtproute = 
explode(":",$ldapData['smtproutes'][$i]);
+                                                       $smtproute = 
explode(':',$ldapData['smtproutes'][$i]);
                                                        
$GLOBALS['phpgw']->template->set_var('domain_name',$smtproute[0]);
                                                        
$GLOBALS['phpgw']->template->set_var('remote_server',$smtproute[1]);
                                                        
$GLOBALS['phpgw']->template->set_var('remote_port',$smtproute[2]);
+                                                       
$GLOBALS['phpgw']->template->set_var('row_color',$this->dataRowColor[($i)%2]);
                                                        $linkData = array
                                                        (
                                                                'menuaction'    
=> 'qmailldap.uiqmailldap.save',
@@ -255,8 +267,9 @@
                                        (
                                                'menuaction'    => 
'qmailldap.uiqmailldap.addSmtpRoute',
                                                'pagenumber'    => 15,
-                                               'serverid'      => $serverid
+                                               'serverid'              => 
$serverid
                                        );
+                                       
$GLOBALS['phpgw']->template->set_var('last_row_color',$this->dataRowColor[($i)%2]);
                                        
$GLOBALS['phpgw']->template->set_var('add_route_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        break;
                                case '20':
@@ -273,22 +286,23 @@
                                        }
                                        break;
                        }
-
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array
-                       (
-                               'body_data' => 
$GLOBALS['phpgw']->template->parse('out','main')
-                       ));
+                       $GLOBALS['phpgw']->template->pfp('out','main');
                }

                function editSettings($_serverid='')
                {
-                       $serverid               = 
get_var('serverid',array('GET'));
-                       $HTTP_GET_VARS  = 
get_var('HTTP_GET_VARS',array('GET'));;
+                       $serverid               = 
get_var('serverid',array('POST','GET'));
+                       $HTTP_GET_VARS  = get_var('HTTP_GET_VARS',array('GET'));

-                       if(!empty($_serverid)) $serverid=$_serverid;
+                       if(!empty($_serverid))
+                       {
+                               $serverid = $_serverid;
+                       }

                        $ldapData = $this->boqmailldap->getLDAPData($serverid);

+                       $this->display_app_header();
+
                        $GLOBALS['phpgw']->template->set_file(array('body' => 
'ldapsettings.tpl'));
                        $GLOBALS['phpgw']->template->set_block('body','main');
                        
$GLOBALS['phpgw']->template->set_block('body','menu_row');
@@ -296,6 +310,7 @@
                        
$GLOBALS['phpgw']->template->set_block('body','activation_row');

                        $this->translate();
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('qmailldap') . ': ' . lang('edit settings');

                        if ($storageData = 
$this->boqmailldap->getLDAPStorageData($serverid))
                        {
@@ -304,36 +319,38 @@
                                
$GLOBALS['phpgw']->template->set_var('ldap_basedn',$storageData['ldap_basedn']);
                        }

+                       
$GLOBALS['phpgw']->template->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
                                'menuaction' => 
'qmailldap.uiqmailldap.listServers'
                        );
                        
$GLOBALS['phpgw']->template->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
-
+
                        $linkData = array
                        (
                                'menuaction'    => 'qmailldap.uiqmailldap.save',
                                'pagenumber'    => $pagenumber,
                                'serverid'      => $serverid
                        );
-
                        
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array
-                       (
-                               'body_data' => 
$GLOBALS['phpgw']->template->parse('out','main')
-                       ));
+
+                       $GLOBALS['phpgw']->template->pfp('out','main');
                }

                function listServers()
                {
+                       $this->display_app_header();
+
                        $GLOBALS['phpgw']->template->set_file(array('body' => 
'listservers.tpl'));
                        
$GLOBALS['phpgw']->template->set_block('body','main','main');
                        
$GLOBALS['phpgw']->template->set_block('body','row','row');

                        $this->translate();
-                       $serverList = $this->boqmailldap->getServerList();
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('qmailldap') . ': ' . lang('list servers');

-                       if (is_array($serverList))
+                       $serverList = $this->boqmailldap->getServerList();
+
+                       if ($serverList)
                        {
                                for ($i=0; $i < count($serverList); $i++)
                                {
@@ -342,60 +359,61 @@
                                        $linkData = array
                                        (
                                                'menuaction'    => 
'qmailldap.uiqmailldap.editServer',
-                                               'nocache'       => '1',
+                                               'nocache'               => '1',
                                                'pagenumber'    => '0',
-                                               'serverid'      => 
$serverList[$i]['id']
+                                               'serverid'              => 
$serverList[$i]['id']
                                        );
                                        
$GLOBALS['phpgw']->template->set_var('edit_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        $linkData = array
                                        (
                                                'menuaction'    => 
'qmailldap.uiqmailldap.editSettings',
-                                               'nocache'       => '1',
-                                               'serverid'      => 
$serverList[$i]['id']
+                                               'nocache'               => '1',
+                                               'serverid'              => 
$serverList[$i]['id']
                                        );
                                        
$GLOBALS['phpgw']->template->set_var('settings_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        $linkData = array
                                        (
                                                'menuaction'    => 
'qmailldap.uiqmailldap.deleteServer',
-                                               'serverid'      => 
$serverList[$i]['id']
+                                               'serverid'              => 
$serverList[$i]['id']
                                        );
                                        
$GLOBALS['phpgw']->template->set_var('delete_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
-                                       
$GLOBALS['phpgw']->template->parse('rows','row');
+                                       
$GLOBALS['phpgw']->template->set_var('row_color',$this->rowColor[$i%2]);
+                                       
$GLOBALS['phpgw']->template->parse('rows','row',True);
                                }
                        }
-                       else
-                       {
-                               $GLOBALS['phpgw']->template->set_var('rows','');
-                       }
-
+
                        $linkData = array
                        (
-                               'menuaction' => 
'qmailldap.uiqmailldap.addServer'
+                               'menuaction'    => 
'qmailldap.uiqmailldap.addServer'
                        );
                        
$GLOBALS['phpgw']->template->set_var('add_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array
-                       (
-                               'body_data' => 
$GLOBALS['phpgw']->template->parse('out','main')
-                       ));
+
+                       $GLOBALS['phpgw']->template->pfp('out','main');
                }

+
                function save()
                {
-                       $values = get_var('values',array('POST','GET'));
+                       $HTTP_POST_VARS = 
get_var('HTTP_POST_VARS',array('POST'));
+                       $HTTP_GET_VARS  = get_var('HTTP_GET_VARS',array('GET'));

-                       $this->boqmailldap->save($values);
-                       if ($values['bo_action'] == 'save_ldap')
+                       $this->boqmailldap->save($HTTP_POST_VARS, 
$HTTP_GET_VARS);
+                       if ($HTTP_POST_VARS['bo_action'] == 'save_ldap' || 
$HTTP_GET_VARS['bo_action'] == 'save_ldap')
                        {
                                $this->listServers();
                        }
                        else
                        {
-                               
$this->editServer($values['serverid'],$values['pagenumber']);
+                               
$this->editServer($HTTP_GET_VARS['serverid'],$HTTP_GET_VARS['pagenumber']);
                        }
                }

                function translate()
                {
+                       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+                       
$GLOBALS['phpgw']->template->set_var('bg_01',$GLOBALS['phpgw_info']['theme']['bg01']);
+                       
$GLOBALS['phpgw']->template->set_var('bg_02',$GLOBALS['phpgw_info']['theme']['bg02']);
+
                        
$GLOBALS['phpgw']->template->set_var('lang_server_list',lang('server list'));
                        
$GLOBALS['phpgw']->template->set_var('lang_server_name',lang('server name'));
                        
$GLOBALS['phpgw']->template->set_var('lang_server_description',lang('description'));
@@ -418,12 +436,7 @@
                        
$GLOBALS['phpgw']->template->set_var('lang_domain_name',lang('domainname'));
                        
$GLOBALS['phpgw']->template->set_var('lang_remote_server',lang('remote 
server'));
                        
$GLOBALS['phpgw']->template->set_var('lang_remote_port',lang('remote port'));
-
-                       
$GLOBALS['phpgw']->template->set_var('lang_qmail_settings',lang('qmail 
settings'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_ldap_base_settings',lang('ldap base 
settings'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_additional_settings_for_qmail',lang('additional
 settings for qmail'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_dirmaker_path',lang('absolute path 
to dirmaker script | application'));
-
+
                        
$GLOBALS['phpgw']->template->set_var('desc_ldaplocaldelivery',lang('To lookup 
the local passwd file if the LDAP lookup finds no match. This affects 
qmail-lspawn and auth_* if the LDAP lookup returns nothing.'));
                        
$GLOBALS['phpgw']->template->set_var('desc_ldapdefaultdotmode',lang('The 
default interpretation of .qmail files.<br><b>Note:</b> Works only for 
deliveries based on LDAP lookups. Local mails use dotonly like in normal 
qmail.'));
                        
$GLOBALS['phpgw']->template->set_var('desc_ldapbasedn',lang('The base DN from 
where the search in the LDAP tree begins.'));

====================================================
Index: qmailldap/inc/class.boqmailldap.inc.php
diff -u qmailldap/inc/class.boqmailldap.inc.php:1.17 
qmailldap/inc/class.boqmailldap.inc.php:1.18
--- qmailldap/inc/class.boqmailldap.inc.php:1.17        Thu Dec 12 00:05:11 2002
+++ qmailldap/inc/class.boqmailldap.inc.php     Mon Jan 17 14:36:54 2005
@@ -22,7 +22,8 @@
                        'getServerList'                 => True,
                        'getLocals'                             => True,
                        'getRcptHosts'                  => True,
-                       'getLDAPStorageData'    => True
+                       'getLDAPStorageData'    => True,
+                       'abcdefgh'                              => True
                );

                function boqmailldap()
@@ -30,7 +31,7 @@
                        $this->soqmailldap = 
CreateObject('qmailldap.soqmailldap');
                        $this->restoreSessionData();
                }
-
+
                function deleteServer($_serverid)
                {
                        $this->soqmailldap->deleteServer($_serverid);
@@ -38,20 +39,22 @@

                function getLDAPData($_serverid, $_nocache=0)
                {
-                       if ($GLOBALS['HTTP_GET_VARS']['nocache'] == '1' || 
$_nocache == '1')
+                       $HTTP_GET_VARS = get_var('HTTP_GET_VARS',array('GET'));
+
+                       if ($HTTP_GET_VARS['nocache'] == '1' || $_nocache == 
'1')
                        {
                                #print "option1<br>";
                                $LDAPData = 
$this->soqmailldap->getLDAPData($_serverid);
                                $this->sessionData[$_serverid] = $LDAPData;
                                
$this->sessionData[$_serverid]['needActivation'] = 0;
-
+
                                $this->saveSessionData();

                                #while(list($key, $value) = 
each($this->sessionData[$_serverid]['rcpthosts']))
                                #{
                                #       print "... $key: $value<br>";
                                #}
-
+
                                return $this->sessionData[$_serverid];
                        }
                        else
@@ -64,19 +67,19 @@
                                return $this->sessionData[$_serverid];
                        }
                }
-
+
                function getLDAPStorageData($_serverid)
                {
                        $storageData = 
$this->soqmailldap->getLDAPStorageData($_serverid);
                        return $storageData;
                }
-
+
                function getServerList()
                {
                        $serverList = $this->soqmailldap->getServerList();
                        return $serverList;
                }
-
+
                function getUserData($_accountID, $_usecache)
                {
                        if ($_usecache)
@@ -94,9 +97,9 @@

                function restoreSessionData()
                {
-                       $this->sessionData = 
$GLOBALS['phpgw']->session->appsession('session_data');
-                       $this->userSessionData = 
$GLOBALS['phpgw']->session->appsession('user_session_data');
-
+                       $this->sessionData              = 
$GLOBALS['phpgw']->session->appsession('session_data');
+                       $this->userSessionData  = 
$GLOBALS['phpgw']->session->appsession('user_session_data');
+
                        #while(list($key, $value) = each($this->sessionData))
                        #{
                        #       print "++ $key: $value<br>";
@@ -104,13 +107,17 @@
                        #print "restored Session<br>";
                }

-               function save($vars)
+               function save($_postVars, $_getVars)
                {
-                       $serverid = $vars['serverid'];
-
-                       if (isset($vars['bo_action']))
+                       $serverid = $_getVars['serverid'];
+
+                       if (isset($_postVars['bo_action']))
                        {
-                               $bo_action = $vars['bo_action'];
+                               $bo_action = $_postVars['bo_action'];
+                       }
+                       elseif (isset($_getVars['bo_action']))
+                       {
+                               $bo_action = $_getVars['bo_action'];
                        }
                        else
                        {
@@ -118,43 +125,46 @@
                        }

                        #print "bo_action: $bo_action<br>";
-
+
                        switch ($bo_action)
                        {
                                case 'add_locals':
                                        $count = 
count($this->sessionData[$serverid]['locals']);
-
-                                       
$this->sessionData[$serverid]['locals'][$count] = $vars['new_local'];
-
+                                       
$this->sessionData[$serverid]['locals'][$count] = $_postVars['new_local'];
                                        
$this->sessionData[$serverid]['needActivation'] = 1;
                                        $this->saveSessionData();
                                        break;
                                case 'add_rcpthosts':
                                        $count = 
count($this->sessionData[$serverid]['rcpthosts']);
-                                       
$this->sessionData[$serverid]['rcpthosts'][$count] = $vars['new_rcpthost'];
-                                       if ($vars['add_to_local'] == 'on')
+                                       
$this->sessionData[$serverid]['rcpthosts'][$count] = $_postVars['new_rcpthost'];
+                                       if ($_postVars['add_to_local'] == 'on')
                                        {
                                                $count = 
count($this->sessionData[$serverid]['locals']);
-                                               
$this->sessionData[$serverid]['locals'][$count] = $vars['new_rcpthost'];
+
+                                               
$this->sessionData[$serverid]['locals'][$count] = $_postVars['new_rcpthost'];
                                        }
                                        
$this->sessionData[$serverid]['needActivation'] = 1;
                                        $this->saveSessionData();
                                        break;
                                case 'add_smtproute':
                                        $count = 
count($this->sessionData[$serverid]['smtproutes']);
-                                       
$this->sessionData[$serverid]['smtproutes'][$count] = sprintf("%s:%s:%s",
-                                                                               
                                                                        
$vars['domain_name'],
-                                                                               
                                                                        
$vars['remote_server'],
-                                                                               
                                                                        
$vars['remote_port']);
+
+                                       
$this->sessionData[$serverid]['smtproutes'][$count] =
+                                               sprintf("%s:%s:%s",
+                                                       
$_postVars['domain_name'],
+                                                       
$_postVars['remote_server'],
+                                                       
$_postVars['remote_port']
+                                               );
                                        
$this->sessionData[$serverid]['needActivation'] = 1;
                                        $this->saveSessionData();
                                        break;
                                case 'remove_locals':
                                        $i=0;
+
                                        while(list($key, $value) = 
each($this->sessionData[$serverid]['locals']))
                                        {
                                                #print ".. $key: $value<br>";
-                                               if ($key != $vars['locals'])
+                                               if ($key != 
$_postVars['locals'])
                                                {
                                                        $newLocals[$i]=$value;
                                                        #print "!! $i: 
$value<br>";
@@ -167,10 +177,11 @@
                                        break;
                                case 'remove_rcpthosts':
                                        $i=0;
+
                                        while(list($key, $value) = 
each($this->sessionData[$serverid]['rcpthosts']))
                                        {
                                                #print ".. $key: $value<br>";
-                                               if ($key != $vars['rcpthosts'])
+                                               if ($key != 
$_postVars['rcpthosts'])
                                                {
                                                        
$newRcpthosts[$i]=$value;
                                                        #print "!! $i: 
$value<br>";
@@ -183,10 +194,11 @@
                                        break;
                                case 'remove_smtproute':
                                        $i=0;
+
                                        while(list($key, $value) = 
each($this->sessionData[$serverid]['smtproutes']))
                                        {
                                                #print ".. $key: $value : 
".$_getVars["smtproute_id"]."<br>";
-                                               if ($key != 
$vars['smtproute_id'])
+                                               if ($key != 
$_getVars['smtproute_id'])
                                                {
                                                        
$newSmtproutes[$i]=$value;
                                                        #print "!! $i: 
$value<br>";
@@ -201,14 +213,12 @@
                                        #print "hallo".$_getVars["serverid"]." 
".$_postVars["servername"]."<br>";
                                        $data = array
                                        (
-                                               'qmail_servername'      => 
$vars['qmail_servername'],
-                                               'description'           => 
$vars['description'],
-                                               'qmail_dn'                      
=> $vars['qmail_dn'],
-                                               'dirmaker'                      
=> $vars['dirmaker'],
-                                               'id'                            
=> $vars['serverid']
+                                               'qmail_servername'      => 
$_postVars['qmail_servername'],
+                                               'description'           => 
$_postVars['description'],
+                                               'ldap_basedn'           => 
$_postVars['ldap_basedn'],
+                                               'id'                            
=> $_getVars['serverid']
                                        );
-
-                                       if (!isset($vars['serverid']))
+                                       if (!isset($_getVars['serverid']))
                                        {
                                                
$this->soqmailldap->update('add_server',$data);
                                        }
@@ -216,7 +226,7 @@
                                        {
                                                
$this->soqmailldap->update('update_server',$data);
                                        }
-                                       $this->getLDAPData($vars['serverid'], 
'1');
+                                       
$this->getLDAPData($_getVars['serverid'],'1');
                                        break;
                                case 'write_to_ldap':
                                        
$this->soqmailldap->writeConfigData($this->sessionData[$serverid], $serverid);
@@ -239,7 +249,7 @@
                        
$this->userSessionData[$_accountID]['mailRoutingAddress']       = 
$_formData['mailRoutingAddress'];
                        $this->userSessionData[$_accountID]['qmailDotMode']     
        = $_formData['qmailDotMode'];
                        
$this->userSessionData[$_accountID]['deliveryProgramPath']      = 
$_formData['deliveryProgramPath'];
-
+
                        switch ($_boAction)
                        {
                                case 'add_mailAlternateAddress':
@@ -252,13 +262,12 @@
                                                $count = 0;
                                                
$this->userSessionData[$_accountID]['mailAlternateAddress'] = array();
                                        }
-                                       
$this->userSessionData[$_accountID]['mailAlternateAddress'][$count] =
-                                               
$_formData['add_mailAlternateAddress'];
-
+                                       
$this->userSessionData[$_accountID]['mailAlternateAddress'][$count] = 
$_formData['add_mailAlternateAddress'];
                                        $this->saveSessionData();
                                        break;
                                case 'remove_mailAlternateAddress':
                                        $i=0;
+
                                        while(list($key, $value) = 
each($this->userSessionData[$_accountID]['mailAlternateAddress']))
                                        {
                                                #print ".. $key: $value<br>";

====================================================
Index: qmailldap/inc/class.uiuserdata.inc.php
diff -u qmailldap/inc/class.uiuserdata.inc.php:1.7 
qmailldap/inc/class.uiuserdata.inc.php:1.8
--- qmailldap/inc/class.uiuserdata.inc.php:1.7  Sat Dec  7 02:54:43 2002
+++ qmailldap/inc/class.uiuserdata.inc.php      Mon Jan 17 14:36:54 2005
@@ -4,7 +4,7 @@
        * http://www.phpgroupware.org                                           
    *
        * http://www.linux-at-work.de                                           
    *
        * Written by : Lars Kneschke address@hidden                   *
-       * -------------------------------------------------                     
    *
+       * -------------------------------------------------------               
    *
        * This program is free software; you can redistribute it and/or modify 
it   *
        * under the terms of the GNU General Public License as published by the 
    *
        * Free Software Foundation; either version 2 of the License, or (at 
your    *
@@ -14,7 +14,6 @@

        class uiuserdata
        {
-
                var $public_functions = array
                (
                        'editUserData'  => True,
@@ -23,18 +22,35 @@

                function uiuserdata()
                {
-                       $this->boqmailldap = 
CreateObject('qmailldap.boqmailldap');
+                       $this->boqmailldap      = 
CreateObject('qmailldap.boqmailldap');
+
+                       $this->rowColor[0]      = 
$GLOBALS['phpgw_info']["theme"]["bg01"];
+                       $this->rowColor[1]      = 
$GLOBALS['phpgw_info']["theme"]["bg02"];
+
+               }
+
+               function display_app_header()
+               {
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       echo parse_navbar();
                }

                function editUserData($_useCache='0')
                {
-                       $accountID = get_var('account_id',array('GET'));
+                       $HTTP_GET_VARS = get_var('HTTP_GET_VARS',array('GET'));
+
+                       $accountID = $HTTP_GET_VARS['account_id'];
+
+                       $this->display_app_header();
+
                        $this->translate();
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('qmailldap') . ': ' . lang('edit user data');
+

                        
$GLOBALS['phpgw']->template->set_file(array('editUserData' => 
'edituserdata.tpl'));
                        
$GLOBALS['phpgw']->template->set_block('editUserData','form','form');
                        
$GLOBALS['phpgw']->template->set_block('editUserData','link_row','link_row');
-
+
                        
$GLOBALS['phpgw']->template->set_var('lang_email_config',lang('edit email 
settings'));
                        
$GLOBALS['phpgw']->template->set_var('lang_emailAddress',lang('email address'));
                        
$GLOBALS['phpgw']->template->set_var('lang_emailaccount_active',lang('email 
account active'));
@@ -43,17 +59,16 @@
                        
$GLOBALS['phpgw']->template->set_var('lang_forward_also_to',lang('forward also 
to'));
                        
$GLOBALS['phpgw']->template->set_var('lang_button',lang('save'));
                        
$GLOBALS['phpgw']->template->set_var('lang_deliver_extern',lang('deliver 
extern'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_deliver_extern',lang('deliver 
extern'));
                        
$GLOBALS['phpgw']->template->set_var('lang_edit_email_settings',lang('edit 
email settings'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_ready',lang("Done"));
+                       
$GLOBALS['phpgw']->template->set_var('lang_ready',lang('Done'));
                        
$GLOBALS['phpgw']->template->set_var('link_back',$GLOBALS['phpgw']->link('/admin/accounts.php'));
-
+
                        $linkData = array
                        (
                                'menuaction'    => 
'qmailldap.uiuserdata.saveUserData',
                                'account_id'    => $accountID
                        );
-                       $GLOBALS['phpgw']->template->set_var("form_action", 
$GLOBALS['phpgw']->link('/index.php',$linkData));
+                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));

                        // only when we show a existing user
                        if($userData = 
$this->boqmailldap->getUserData($accountID, $_useCache))
@@ -73,23 +88,19 @@
                                {
                                        $options_mailAlternateAddress = 
lang('no alternate email address');
                                }
-
+
                                
$GLOBALS['phpgw']->template->set_var('mailLocalAddress',$userData['mailLocalAddress']);
                                
$GLOBALS['phpgw']->template->set_var('mailAlternateAddress','');
                                
$GLOBALS['phpgw']->template->set_var('options_mailAlternateAddress',$options_mailAlternateAddress);
                                
$GLOBALS['phpgw']->template->set_var('mailRoutingAddress',$userData['mailRoutingAddress']);
                                
$GLOBALS['phpgw']->template->set_var('selected_'.$userData['qmailDotMode'],'selected');
-                               
$GLOBALS['phpgw']->template->set_var('deliveryProgramPath',$userData['deliveryProgramPath']);
+                               
$GLOBALS['phpgw']->template->set_var('deliveryProgramPath',$userData["deliveryProgramPath"]);

                                
$GLOBALS['phpgw']->template->set_var('uid',rawurlencode($_accountData['dn']));
-                               if ($userData["accountStatus"] == 'active')
-                               {
+                               if ($userData['accountStatus'] == 'active')
                                        
$GLOBALS['phpgw']->template->set_var('account_checked','checked');
-                               }
                                if ($_accountData['deliverExtern'] == 'active')
-                               {
                                        
$GLOBALS['phpgw']->template->set_var('deliver_checked','checked');
-                               }
                        }
                        else
                        {
@@ -104,13 +115,13 @@
                        $menuClass = CreateObject('admin.uimenuclass');
                        
$GLOBALS['phpgw']->template->set_var('rows',$menuClass->createHTMLCode('edit_user'));

-                       $GLOBALS['phpgw']->template->pparse("out","form");
+                       $GLOBALS['phpgw']->template->pfp('out','form');

                }

                function saveUserData()
                {
-                       $HTTP_POST_VARS = 
get_var('HTTP_POST_VARS',array('POST'));
+                       $HTTP_POST_VARS = 
get_var('HTTP_POST_VARS',array('POST'));
                        $HTTP_GET_VARS  = get_var('HTTP_GET_VARS',array('GET'));

                        if($HTTP_POST_VARS['accountStatus'] == 'on')
@@ -128,19 +139,11 @@
                                'deliveryProgramPath'                   => 
$HTTP_POST_VARS['deliveryProgramPath'],
                                'accountStatus'                                 
=> $accountStatus
                        );
+
+                       if($HTTP_POST_VARS['add_mailAlternateAddress']) 
$bo_action='add_mailAlternateAddress';
+                       if($HTTP_POST_VARS['remove_mailAlternateAddress']) 
$bo_action='remove_mailAlternateAddress';
+                       if($HTTP_POST_VARS['save']) $bo_action='save';

-                       if($HTTP_POST_VARS['add_mailAlternateAddress'])
-                       {
-                               $bo_action='add_mailAlternateAddress';
-                       }
-                       if($HTTP_POST_VARS['remove_mailAlternateAddress'])
-                       {
-                               $bo_action='remove_mailAlternateAddress';
-                       }
-                       if($HTTP_POST_VARS['save'])
-                       {
-                               $bo_action='save';
-                       }
                        
$this->boqmailldap->saveUserData($HTTP_GET_VARS['account_id'], $formData, 
$bo_action);

                        if ($bo_action == 'save')
@@ -157,6 +160,9 @@

                function translate()
                {
+                       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+                       
$GLOBALS['phpgw']->template->set_var('tr_color1',$GLOBALS['phpgw_info']['theme']['row_on']);
+                       
$GLOBALS['phpgw']->template->set_var('tr_color2',$GLOBALS['phpgw_info']['theme']['row_off']);
                        
$GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
                        
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
                        
$GLOBALS['phpgw']->template->set_var('lang_remove',lang('remove'));

====================================================
Index: qmailldap/inc/class.soqmailldap.inc.php
diff -u qmailldap/inc/class.soqmailldap.inc.php:1.17 
qmailldap/inc/class.soqmailldap.inc.php:1.18
--- qmailldap/inc/class.soqmailldap.inc.php:1.17        Thu Dec 12 00:05:11 2002
+++ qmailldap/inc/class.soqmailldap.inc.php     Mon Jan 17 14:36:54 2005
@@ -2,7 +2,8 @@
        
/***************************************************************************\
        * phpGroupWare - QMailLDAP                                              
    *
        * http://www.phpgroupware.org                                           
    *
-       * Written by : Lars Kneschke address@hidden                           *
+       * http://www.linux-at-work.de                                           
    *
+       * Written by : Lars Kneschke address@hidden                   *
        * -------------------------------------------------                     
    *
        * This program is free software; you can redistribute it and/or modify 
it   *
        * under the terms of the GNU General Public License as published by the 
    *
@@ -15,23 +16,20 @@
        {
                function soqmailldap()
                {
-                       $this->db                       = $GLOBALS['phpgw']->db;
-                       $this->ldap                     = 
$GLOBALS['phpgw']->common->ldapConnect();
-
-                       $config = CreateObject('phpgwapi.config','qmailldap');
+                       $this->db       = $GLOBALS['phpgw']->db;
+                       $config         = 
CreateObject('phpgwapi.config','qmailldap');
                        $config->read_repository();

                        if ($config->config_data)
-            {
-                $items = $config->config_data;
-
+                       {
+                               $items                                  = 
$config->config_data;
                                $this->mail_address             = 
$items['mail'];
                                $this->routing_address  = $items['routing'];
                        }
                        else
                        {
-                               $this->mail_address             = 
'maillocaladdress';
-                               $this->routing_address  = 'mailroutingaddress';
+                               $this->mail_address     = 'maillocaladdress';
+                               $this->routing_address  = 'mailroutingaddress';
                        }
                        unset($config);
                }
@@ -51,44 +49,48 @@
                        {
                                $storageData['qmail_servername']        = 
$this->db->f('qmail_servername');
                                $storageData['description']             = 
$this->db->f('description');
-                               $storageData['qmail_dn']                        
= $this->db->f('qmail_dn');
-
+                               $storageData['ldap_basedn']             = 
$this->db->f('ldap_basedn');
+
                                return $storageData;
                        }
                        else
                        {
-                               return False;
+                               return false;
                        }
                }
-
+
                function getLDAPData($_serverid)
                {
+                       global $phpgw;
+
                        $storageData = $this->getLDAPStorageData($_serverid);
-
+
+                       $ldap = $phpgw->common->ldapConnect();
                        $filter = "cn=".$storageData['qmail_servername'];
-
-                       $sri = 
@ldap_read($this->ldap,$storageData['qmail_dn'],$filter);
+
+                       $sri = 
@ldap_read($ldap,$storageData['ldap_basedn'],$filter);
                        if ($sri)
                        {
-                               $allValues = ldap_get_entries($this->ldap, 
$sri);
-
+                               $allValues = ldap_get_entries($ldap, $sri);
+
                                unset($allValues[0]['rcpthosts']['count']);
                                unset($allValues[0]['locals']['count']);
                                unset($allValues[0]['smtproutes']['count']);
-
+
                                $data = array
                                (
-                                       'rcpthosts'             => 
$allValues[0]['rcpthosts'],
-                                       'locals'                => 
$allValues[0]['locals'],
-                                       'smtproutes'    => 
$allValues[0]['smtproutes']
+                                       'rcpthosts'     => 
$allValues[0]['rcpthosts'],
+                                       'locals'        => 
$allValues[0]['locals'],
+                                       'smtproutes'    => 
$allValues[0]['smtproutes'],
+                                       'ldapbasedn'    => 
$allValues[0]['ldapbasedn'][0]
                                );
-
+
                                #$data['smtproutes'] = array
                                #(
                                #       '0'     => 
't-online.de:smtprelay.t-online.de:25',
                                #       '1'     => 
't-dialin.net:smtprelay.t-online.de:25'
                                #);
-
+
                                if 
(isset($allValues[0]['ldaplocaldelivery'][0]))
                                {
                                        $data['ldaplocaldelivery'] = 
$allValues[0]['ldaplocaldelivery'][0];
@@ -109,117 +111,120 @@
                                        $data['ldapdefaultdotmode'] = 
'ldaponly';
                                }

-                               if (isset($allValues[0]['dirmaker'][0]))
-                               {
-                                       $data['dirmaker'] = 
$allValues[0]['dirmaker'][0];
-                               }
                                return $data;
                        }
                        else
                        {
-                               return False;
+                               return false;
                        }
+
                }
-
+
                function getServerList()
                {
                        $query = "select id,qmail_servername,description from 
phpgw_qmailldap";
                        $this->db->query($query);
-
+
                        $i=0;
                        while ($this->db->next_record())
                        {
-                               $serverList[$i]['id']                           
= $this->db->f('id');
+                               $serverList[$i]['id']                   = 
$this->db->f('id');
                                $serverList[$i]['qmail_servername']     = 
$this->db->f('qmail_servername');
                                $serverList[$i]['description']          = 
$this->db->f('description');
                                $i++;
                        }
-
+
                        if ($i>0)
                        {
                                return $serverList;
                        }
                        else
                        {
-                               return False;
+                               return false;
                        }
                }

                function getUserData($_accountID)
                {
-                       $filter = "(&(uidnumber=$_accountID))";
+                       global $phpgw, $phpgw_info;

+                       $ldap = $phpgw->common->ldapConnect();
+                       $filter = "(&(uidnumber=$_accountID))";
+
                        $mail_address           = $this->mail_address;
                        $routing_address        = $this->routing_address;

-                       $sri = 
@ldap_search($this->ldap,$GLOBALS['phpgw_info']['server']['ldap_context'],$filter);
+                       $sri = 
@ldap_search($ldap,$phpgw_info['server']['ldap_context'],$filter);
                        if ($sri)
                        {
                                $allValues = ldap_get_entries($ldap, $sri);
                                if ($allValues['count'] > 0)
                                {
-                                       #print "found something<br>";
-                                       $userData['mailLocalAddress']           
= $allValues[0][$mail_address][0];
-                                       $userData['accountStatus']              
        = $allValues[0]['accountstatus'][0];
-                                       $userData['mailRoutingingAddress']      
= $allValues[0][$routing_address][0];
-                                       $userData['qmailDotMode']               
        = $allValues[0]['qmaildotmode'][0];
-                                       $userData['deliveryProgramPath']        
= $allValues[0]['deliveryprogrampath'][0];
-                                       $userData['mailAlternateAddress']       
= $allValues[0]['mailalternateaddress'];
-
-                                       if 
($userData['mailAlternateAddress']['count'] == 0)
+                                       //print "found something<br>";
+                                       $userData["mailLocalAddress"]           
= $allValues[0][$mail_address][0];
+                                       $userData["mailAlternateAddress"]       
= $allValues[0]["mailalternateaddress"];
+                                       $userData["accountStatus"]              
        = $allValues[0]["accountstatus"][0];
+                                       $userData["mailRoutingingAddress"]      
= $allValues[0][$routing_address][0];
+                                       $userData["qmailDotMode"]               
        = $allValues[0]["qmaildotmode"][0];
+                                       $userData["deliveryProgramPath"]        
= $allValues[0]["deliveryprogrampath"][0];
+                                       if 
($userData["mailAlternateAddress"]["count"] == 0)
                                        {
-                                               
$userData['mailAlternateAddress']='';
+                                               
$userData["mailAlternateAddress"]='';
                                        }
                                        else
                                        {
-                                               
unset($userData['mailAlternateAddress']['count']);
+                                               
unset($userData["mailAlternateAddress"]["count"]);
                                        }
                                        return $userData;
                                }
                        }
-
+
                        // if we did not return before, return false
-                       return False;
+                       return false;
                }

                function saveUserData($_accountID, $_accountData)
                {
+                       global $phpgw, $phpgw_info;
+
+                       $ldap = $phpgw->common->ldapConnect();
                        $filter = "uidnumber=$_accountID";
-
-                       $sri = 
@ldap_search($this->ldap,$GLOBALS['phpgw_info']['server']['ldap_context'],$filter);
+
+                       $sri = 
@ldap_search($ldap,$phpgw_info['server']['ldap_context'],$filter);
                        if ($sri)
                        {
-                               $allValues              = 
ldap_get_entries($ldap, $sri);
-                               $accountDN              = $allValues[0]['dn'];
-                               $uid                    = 
$allValues[0]['uid'][0];
-                               $homedirectory  = 
(isset($allValues[0]['homedirectory'][0])?$allValues[0]['homedirectory'][0]:'/home/'
 . $uid);
+                               $allValues      = ldap_get_entries($ldap, $sri);
+                               $accountDN      = $allValues[0]['dn'];
+                               $uid            = $allValues[0]['uid'][0];
+                               $homedirectory  = 
$allValues[0]['homedirectory'][0];
                        }
                        else
                        {
-                               return False;
+                               return false;
                        }
-
+
                        $mail_address           = $this->mail_address;
                        $routing_address        = $this->routing_address;

                        $newData = array
                        (
-                               $mail_address   => 
$_accountData['mailLocalAddress'],
-                               'objectclass'   => 'qmailUser'
+                               $mail_address   => 
$_accountData["mailLocalAddress"],
+                               'objectclass'   => "qmailUser"
                        );
-                       @ldap_mod_add($this->ldap, $accountDN, $newData);
+
+                       @ldap_mod_add($ldap, $accountDN, $newData);

                        if(empty($homedirectory))
                        {
-                               $homedirectory = '/home/' . $uid;
+                               $homedirectory = "/home/".$uid;
                        }

                        $newData = array
                        (
-                               $mail_address                   => 
(isset($_accountData['mailLocalAddress'])?$_accountData['mailLocalAddress']:$uid
 . '@localhost'),
-                               'homedirectory'                 => 
$homedirectory,
-                               'mailMessageStore'              => 
$homedirectory . '/Maildir/',
-                               'qmailDotMode'                  => 
(isset($_accountData['qmailDotMode'])?$_accountData['qmailDotMode']:'ldaponly')
+                               $mail_address           => 
(isset($_accountData['mailLocalAddress'])?$_accountData['mailLocalAddress']:$uid
 . '@localhost'),
+                'homeDirectory'     => $homedirectory,
+                'mailMessageStore'  => $homedirectory."/Maildir/",
+                'qmailDotMode'      => 
(isset($_accountData['qmailDotMode'])?$_accountData['qmailDotMode']:'ldaponly')
                        );

                        if ($_accountData['accountStatus'])
@@ -227,43 +232,50 @@
                                $newData['accountStatus'] = 
$_accountData['accountStatus'];
                        }

-                       if ($_accountData['mailAlternateAddress'])
+                       if ($_accountData["mailAlternateAddress"])
                        {
-                               $newData['mailAlternateAddress'] = 
$_accountData['mailAlternateAddress'];
+                               $newData['mailAlternateAddress'] = 
$_accountData["mailAlternateAddress"];
                        }

-                       if ($_accountData['mailRoutingAddress'])
+                       if ($_accountData["mailRoutingAddress"])
                        {
-                               $newData[$routing_address] = 
$_accountData['mailRoutingAddress'];
+                               $newData[$routing_address] = 
$_accountData["mailRoutingAddress"];
                        }

-                       if ($_accountData['deliveryProgramPath'])
+                       if ($_accountData["deliveryProgramPath"])
                        {
-                               $newData['deliveryProgramPath'] = 
$_accountData['deliveryProgramPath'];
+                               $newData['deliveryProgramPath'] = 
$_accountData["deliveryProgramPath"];
                        }

-                       ldap_mod_replace ($this->ldap, $accountDN, $newData);
+                       //_debug_array($newData);

-                       #print ldap_error($ldap);
+                       ldap_mod_replace ($ldap, $accountDN, $newData);
+
+                       //print ldap_error($ldap);
                }

                function update($_action, $_data)
                {
                        switch ($_action)
                        {
-                               case 'add_server':
-                                       $query = sprintf("insert into 
phpgw_qmailldap (description, qmail_dn, qmail_servername) values 
('%s','%s','%s')",
+                               case "add_server":
+                                       $query = sprintf("insert into 
phpgw_qmailldap (description, ldap_basedn, qmail_servername)
+                                                       values 
('%s','%s','%s')",
                                                        $_data['description'],
-                                                       $_data['qmail_dn'],
-                                                       
$_data['qmail_servername']);
+                                                       $_data['ldap_basedn'],
+                                                       
$_data["qmail_servername"]);
                                        $this->db->query($query);
                                        break;
-                               case 'update_server':
-                                       $query = sprintf("update 
phpgw_qmailldap set description='%s',qmail_dn='%s',qmail_servername='%s' where 
id='%s'",
+
+                               case "update_server":
+                                       $query = sprintf("update 
phpgw_qmailldap set
+                                                         description='%s',
+                                                         ldap_basedn='%s',
+                                                         qmail_servername='%s' 
where id='%s'",
                                                $_data['description'],
-                                               $_data['qmail_dn'],
-                                               $_data['qmail_servername'],
-                                               $_data['id']);
+                                               $_data['ldap_basedn'],
+                                               $_data["qmail_servername"],
+                                               $_data["id"]);
                                        $this->db->query($query);
                                        break;
                        }
@@ -271,29 +283,29 @@

                function writeConfigData($_data, $_serverid)
                {
+                       global $phpgw;
+
                        $storageData = $this->getLDAPStorageData($_serverid);
-
+
                        #print "write Data for 
".$storageData['qmail_servername']."<br>";
-
+
+                       $ds = $phpgw->common->ldapConnect();
+
                        // check if the DN exists, if not create it
                        $filter = "objectclass=*";
-                       @ldap_read($this->ldap,$storageData['qmail_dn'], 
$filter);
+                       @ldap_read($ds,$storageData['ldap_basedn'], $filter);
                        if (ldap_errno($ds) == 32)
                        {
-                               $ldapData['objectclass'][0]     = 
'qmailcontrol';
-                               $ldapData['cn']                         = 
$storageData['qmail_servername'];
-                               
ldap_add($this->ldap,$storageData['qmail_dn'],$ldapData);
+                               $ldapData["objectclass"][0]     = 
"qmailcontrol";
+                               $ldapData["cn"]                 = 
$storageData['qmail_servername'];
+                               
ldap_add($ds,$storageData['ldap_basedn'],$ldapData);
                        }
-
-                       $ldapData['rcpthosts']  = $_data['rcpthosts'];
+
+                       $ldapData['rcpthosts']          = $_data['rcpthosts'];
                        $ldapData['locals']             = $_data['locals'];
-                       $ldapData['smtproutes'] = $_data['smtproutes'];
-
-                       if (isset($_data['dirmaker']) && 
!empty($_data['dirmaker']))
-                       {
-                               $ldapData['dirMaker'] = $_data['dirmaker'];
-                       }
-                       
ldap_modify($this->ldap,$storageData['qmail_dn'],$ldapData);
+                       $ldapData['smtproutes']         = $_data['smtproutes'];
+
+                       ldap_modify($ds,$storageData['ldap_basedn'],$ldapData);
                }
        }
 ?>

====================================================
Index: qmailldap/inc/hook_admin.inc.php
diff -u qmailldap/inc/hook_admin.inc.php:1.2 
qmailldap/inc/hook_admin.inc.php:1.3
--- qmailldap/inc/hook_admin.inc.php:1.2        Sat Apr 19 23:28:02 2003
+++ qmailldap/inc/hook_admin.inc.php    Mon Jan 17 14:36:54 2005
@@ -18,6 +18,6 @@
                );

 //Do not modify below this line
-               $GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
+               display_section($appname,$appname,$file);
        }
 ?>

====================================================
Index: qmailldap/inc/hook_preferences.inc.php
diff -u qmailldap/inc/hook_preferences.inc.php:1.5 
qmailldap/inc/hook_preferences.inc.php:1.6
--- qmailldap/inc/hook_preferences.inc.php:1.5  Tue Dec 10 23:03:59 2002
+++ qmailldap/inc/hook_preferences.inc.php      Mon Jan 17 14:36:54 2005
@@ -13,12 +13,13 @@
        {
 // Only Modify the $file and $title variables.....

+               $title = $appname;
                $file = Array
                (
                        'Grant Access'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
                        'Edit categories' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=qmailldap&cats_level=True&global_cats=True')
                );
 //Do not modify below this line
-               display_section($appname,$file);
+               display_section($appname,$title,$file);
        }
 ?>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]