phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: qmailldap/inc class.boqmailldap.inc.php,1.14,1.1


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: qmailldap/inc class.boqmailldap.inc.php,1.14,1.15 class.uiqmailldap.inc.php,1.11,1.12 class.uiuserdata.inc.php,1.6,1.7
Date: Fri, 06 Dec 2002 21:54:45 -0500

Update of /cvsroot/phpgroupware/qmailldap/inc
In directory subversions:/tmp/cvs-serv27272/inc

Modified Files:
        class.boqmailldap.inc.php class.uiqmailldap.inc.php 
        class.uiuserdata.inc.php 
Log Message:
update

Index: class.boqmailldap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/qmailldap/inc/class.boqmailldap.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.boqmailldap.inc.php   7 Dec 2002 02:10:31 -0000       1.14
--- class.boqmailldap.inc.php   7 Dec 2002 02:54:43 -0000       1.15
***************
*** 20,28 ****
                var $public_functions = array
                (
!                       'getServerList'         => True,
!                       'getLocals'             => True,
!                       'getRcptHosts'          => True,
                        'getLDAPStorageData'    => True,
!                       'abcdefgh'              => True
                );
  
--- 20,28 ----
                var $public_functions = array
                (
!                       'getServerList'                 => True,
!                       'getLocals'                             => True,
!                       'getRcptHosts'                  => True,
                        'getLDAPStorageData'    => True,
!                       'abcdefgh'                              => True
                );
  

Index: class.uiqmailldap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/qmailldap/inc/class.uiqmailldap.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.uiqmailldap.inc.php   26 Oct 2001 14:28:55 -0000      1.11
--- class.uiqmailldap.inc.php   7 Dec 2002 02:54:43 -0000       1.12
***************
*** 1,5 ****
  <?php
        
/***************************************************************************\
!       * phpGroupWare - Notes                                                  
    *
        * http://www.phpgroupware.org                                           
    *
        * Written by : Lars Kneschke address@hidden                   *
--- 1,5 ----
  <?php
        
/***************************************************************************\
!       * phpGroupWare - QMailLDAP                                              
    *
        * http://www.phpgroupware.org                                           
    *
        * Written by : Lars Kneschke address@hidden                   *
***************
*** 23,97 ****
                (
                        'listServers'   => True,
!                       'addServer'     => True,
                        'deleteServer'  => True,
                        'editServer'    => True,
                        'editSettings'  => True,
                        'addSmtpRoute'  => True,
!                       'save'          => True
                );
  
                function uiqmailldap()
                {
-                       global $phpgw, $phpgw_info;
- 
                        $this->cats                     = 
CreateObject('phpgwapi.categories');
!                       $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
!                       #$this->account                 = 
$phpgw_info['user']['account_id'];
!                       $this->t                        = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!                       #$this->grants                  = 
$phpgw->acl->get_grants('notes');
!                       #$this->grants[$this->account]  = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
!                       $this->boqmailldap              = 
CreateObject('qmailldap.boqmailldap');
!                       
!                       $this->rowColor[0] = $phpgw_info["theme"]["row_on"];
!                       $this->rowColor[1] = $phpgw_info["theme"]["row_off"];
! 
!                       $this->dataRowColor[0] = $phpgw_info["theme"]["bg01"];
!                       $this->dataRowColor[1] = $phpgw_info["theme"]["bg02"];
!                                        
                }
!               
                function addServer()
                {
!                       $this->display_app_header();
!                       
!                       $this->t->set_file(array("body" => 'ldapsettings.tpl'));
!                       $this->t->set_block('body','main');
!                       $this->t->set_block('body','menu_row');
!                       $this->t->set_block('body','menu_row_bold');
!                       $this->t->set_block('body','activation_row');
!                       
                        $this->translate();
  
-                       
$this->t->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
!                               'menuaction'    => 
'qmailldap.uiqmailldap.listServers'
                        );
!                       
$this->t->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       
$this->t->set_var('th_bg',$GLOBALS['phpgw_info']["theme"]["th_bg"]);
!                       
$this->t->set_var('bg_01',$GLOBALS['phpgw_info']["theme"]["bg01"]);
!                       
$this->t->set_var('bg_02',$GLOBALS['phpgw_info']["theme"]["bg02"]);
  
                        $linkData = array
                        (
!                               'menuaction'    => 'qmailldap.uiqmailldap.save'
                        );
!                       
$this->t->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                                                                               
                                                                                
                                
!                       $this->t->parse("out","main");
!                       print $this->t->get('out','main');
!                       
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
!       
                function addSmtpRoute()
                {
-                       $this->display_app_header();
-                       
                        $this->translate();
-                       
-                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
!               
                function createMenu($_serverid, $_pagenumber, $_ldapData)
                {
--- 23,71 ----
                (
                        'listServers'   => True,
!                       'addServer'             => True,
                        'deleteServer'  => True,
                        'editServer'    => True,
                        'editSettings'  => True,
                        'addSmtpRoute'  => True,
!                       'save'                  => True
                );
  
                function uiqmailldap()
                {
                        $this->cats                     = 
CreateObject('phpgwapi.categories');
!                       $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
!                       $this->boqmailldap      = 
CreateObject('qmailldap.boqmailldap');
                }
! 
                function addServer()
                {
!                       $GLOBALS['phpgw']->template->set_file(array('body' => 
'ldapsettings.tpl'));
!                       $GLOBALS['phpgw']->template->set_block('body','main');
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row');
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row_bold');
!                       
$GLOBALS['phpgw']->template->set_block('body','activation_row');
! 
                        $this->translate();
  
                        $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'
                        );
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       $GLOBALS['phpgw']->template->parse('out','main');
!                       print $GLOBALS['phpgw']->template->get('out','main');
                }
! 
                function addSmtpRoute()
                {
                        $this->translate();
                }
! 
                function createMenu($_serverid, $_pagenumber, $_ldapData)
                {
***************
*** 120,127 ****
                        );
                        
!                       $this->t->set_file(array("body" => 
$menu[$_pagenumber]['template']));
!                       $this->t->set_block('body','menu_row');
!                       $this->t->set_block('body','menu_row_bold');
!                       $this->t->set_block('body','activation_row');
  
                        reset($menu);
--- 94,101 ----
                        );
                        
!                       $GLOBALS['phpgw']->template->set_file(array('body' => 
$menu[$_pagenumber]['template']));
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row');
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row_bold');
!                       
$GLOBALS['phpgw']->template->set_block('body','activation_row');
  
                        reset($menu);
***************
*** 129,133 ****
                        while (list($key,$value) = each($menu))
                        {
!                               
$this->t->set_var('menu_description',$value['name']);
                                $linkData = array
                                (
--- 103,107 ----
                        while (list($key,$value) = each($menu))
                        {
!                               
$GLOBALS['phpgw']->template->set_var('menu_description',$value['name']);
                                $linkData = array
                                (
***************
*** 136,148 ****
                                        'serverid'      => $_serverid
                                );
!                               
$this->t->set_var('menu_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                               
$this->t->set_var('menu_row_color',$this->rowColor[$i%2]);
                                if ($_pagenumber == $key)
                                {
!                                       
$this->t->parse('menu_rows','menu_row_bold',True);
                                }
                                else
                                {
!                                       
$this->t->parse('menu_rows','menu_row',True);
                                }
                                $i++;
--- 110,122 ----
                                        'serverid'      => $_serverid
                                );
!                               
$GLOBALS['phpgw']->template->set_var('menu_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
! 
                                if ($_pagenumber == $key)
                                {
!                                       
$GLOBALS['phpgw']->template->parse('menu_rows','menu_row_bold',True);
                                }
                                else
                                {
!                                       
$GLOBALS['phpgw']->template->parse('menu_rows','menu_row',True);
                                }
                                $i++;
***************
*** 155,172 ****
                                        'menuaction'    => 
'qmailldap.uiqmailldap.save',
                                        'pagenumber'    => $_pagenumber,
!                                       'serverid'      => $_serverid,
!                                       'bo_action'     => 'write_to_ldap'
                                );
!                               
$this->t->set_var('activation_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                               
$this->t->parse('activation_rows','activation_row');
                        }
!                       
!                       
$this->t->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
!                               'menuaction'    => 
'qmailldap.uiqmailldap.listServers',
                        );
!                       
$this->t->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       
                }
                
--- 129,144 ----
                                        'menuaction'    => 
'qmailldap.uiqmailldap.save',
                                        'pagenumber'    => $_pagenumber,
!                                       'serverid'              => $_serverid,
!                                       'bo_action'             => 
'write_to_ldap'
                                );
!                               
$GLOBALS['phpgw']->template->set_var('activation_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                               
$GLOBALS['phpgw']->template->parse('activation_rows','activation_row');
                        }
! 
                        $linkData = array
                        (
!                               'menuaction' => 
'qmailldap.uiqmailldap.listServers',
                        );
!                       
$GLOBALS['phpgw']->template->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                }
                
***************
*** 176,204 ****
                        $this->listServers();
                }
-               
-               function display_app_header()
-               {
-                       global $phpgw, $phpgw_info;
-                       
-                       $phpgw->common->phpgw_header();
-                       echo parse_navbar();
-                       
-               }
  
                function editServer($_serverid='', $_pagenumber='')
                {
!                       global $phpgw, $phpgw_info, $serverid, $pagenumber, 
$HTTP_GET_VARS;
!                       
                        if(!empty($_serverid)) $serverid=$_serverid;
                        if(!empty($_pagenumber)) $pagenumber=$_pagenumber;
-                       
-                       $ldapData = $this->boqmailldap->getLDAPData($serverid);
  
!                       $this->display_app_header();
                        
                        $this->createMenu($serverid, $pagenumber, $ldapData);
  
!                       $this->t->set_block('body','main');
!                       
                        $this->translate();
                        
--- 148,167 ----
                        $this->listServers();
                }
  
                function editServer($_serverid='', $_pagenumber='')
                {
!                       $serverid               = 
get_var('serverid',array('GET'));
!                       $pagenumber             = 
get_var('pagenumber',array('GET'));
!                       $HTTP_GET_VARS  = 
get_var('HTTP_GET_VARS',array('GET'));;
! 
                        if(!empty($_serverid)) $serverid=$_serverid;
                        if(!empty($_pagenumber)) $pagenumber=$_pagenumber;
  
!                       $ldapData = $this->boqmailldap->getLDAPData($serverid);
                        
                        $this->createMenu($serverid, $pagenumber, $ldapData);
  
!                       $GLOBALS['phpgw']->template->set_block('body','main');
! 
                        $this->translate();
                        
***************
*** 207,217 ****
                                'menuaction'    => 'qmailldap.uiqmailldap.save',
                                'pagenumber'    => $pagenumber,
!                               'serverid'      => $serverid
                        );
!                       
$this->t->set_var('form_action',$phpgw->link('/index.php',$linkData));
                        
                        switch($pagenumber)
                        {
!                               case "0":
                                        if (count($ldapData['rcpthosts']) > 0)
                                        {
--- 170,180 ----
                                'menuaction'    => 'qmailldap.uiqmailldap.save',
                                'pagenumber'    => $pagenumber,
!                               'serverid'              => $serverid
                        );
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
                        
                        switch($pagenumber)
                        {
!                               case '0':
                                        if (count($ldapData['rcpthosts']) > 0)
                                        {
***************
*** 224,236 ****
                                                }
                                                $selectBox .= "</select>\n";
!                                               
$this->t->set_var('rcpt_selectbox',$selectBox);
                                        }
                                        else
                                        {
!                                               
$this->t->set_var('rcpt_selectbox',
                                                        "<b>".lang("We don't 
accept any email!")."</b>");
                                        }
  
- 
                                        if (count($ldapData['locals']) > 0)
                                        {
--- 187,198 ----
                                                }
                                                $selectBox .= "</select>\n";
!                                               
$GLOBALS['phpgw']->template->set_var('rcpt_selectbox',$selectBox);
                                        }
                                        else
                                        {
!                                               
$GLOBALS['phpgw']->template->set_var('rcpt_selectbox',
                                                        "<b>".lang("We don't 
accept any email!")."</b>");
                                        }
  
                                        if (count($ldapData['locals']) > 0)
                                        {
***************
*** 243,260 ****
                                                }
                                                $selectBox .= "</select>\n";
!                                               
$this->t->set_var('locals_selectbox',$selectBox);
                                        }
                                        else
                                        {
!                                               
$this->t->set_var('locals_selectbox',
                                                        "<b>".lang("We don't 
deliver any email local!")."</b>");
                                        }
- 
- 
                                        break;
!                                       
!                               case "15":
!                                       
$this->t->set_block('body','smtproute_row');
!                                       
                                        if (count($ldapData['smtproutes']) > 0)
                                        {
--- 205,218 ----
                                                }
                                                $selectBox .= "</select>\n";
!                                               
$GLOBALS['phpgw']->template->set_var('locals_selectbox',$selectBox);
                                        }
                                        else
                                        {
!                                               
$GLOBALS['phpgw']->template->set_var('locals_selectbox',
                                                        "<b>".lang("We don't 
deliver any email local!")."</b>");
                                        }
                                        break;
!                               case '15':
!                                       
$GLOBALS['phpgw']->template->set_block('body','smtproute_row');
                                        if (count($ldapData['smtproutes']) > 0)
                                        {
***************
*** 262,279 ****
                                                {
                                                        $smtproute = 
explode(":",$ldapData['smtproutes'][$i]);
!                                                       
$this->t->set_var('domain_name',$smtproute[0]);
!                                                       
$this->t->set_var('remote_server',$smtproute[1]);
!                                                       
$this->t->set_var('remote_port',$smtproute[2]);
!                                                       
$this->t->set_var('row_color',$this->dataRowColor[($i)%2]);
                                                        $linkData = array
                                                        (
                                                                'menuaction'    
=> 'qmailldap.uiqmailldap.save',
!                                                               'bo_action'     
=> 'remove_smtproute',
                                                                'smtproute_id'  
=> $i,
                                                                'pagenumber'    
=> 15,
!                                                               'serverid'      
=> $serverid
                                                        );
!                                                       
$this->t->set_var('delete_route_link',$phpgw->link('/index.php',$linkData));
!                                                       
$this->t->parse('smtproute_rows','smtproute_row',True);
                                                }
                                        }
--- 220,236 ----
                                                {
                                                        $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]);
                                                        $linkData = array
                                                        (
                                                                'menuaction'    
=> 'qmailldap.uiqmailldap.save',
!                                                               'bo_action'     
        => 'remove_smtproute',
                                                                'smtproute_id'  
=> $i,
                                                                'pagenumber'    
=> 15,
!                                                               'serverid'      
        => $serverid
                                                        );
!                                                       
$GLOBALS['phpgw']->template->set_var('delete_route_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                                                       
$GLOBALS['phpgw']->template->parse('smtproute_rows','smtproute_row',True);
                                                }
                                        }
***************
*** 285,351 ****
                                                'serverid'      => $serverid
                                        );
!                                       
$this->t->set_var('last_row_color',$this->dataRowColor[($i)%2]);
!                                       
$this->t->set_var('add_route_link',$phpgw->link('/index.php',$linkData));
!                                       
                                        break;
!                               
!                               case "20":
!                                       
$this->t->set_var("ldaplocaldelivery_".$ldapData['ldaplocaldelivery'],'selected');
!                                       
$this->t->set_var("ldapdefaultdotmode_".$ldapData['ldapdefaultdotmode'],'selected');
!                                       
$this->t->set_var("ldapbasedn",$ldapData['ldapbasedn']);
!                               
                                        break;
!                                       
!                               case "99":
                                        if ($storageData = 
$this->boqmailldap->getLDAPStorageData($serverid))
                                        {
!                                               
$this->t->set_var('qmail_servername',$storageData['qmail_servername']);
!                                               
$this->t->set_var('description',$storageData['description']);
!                                               
$this->t->set_var('ldap_basedn',$storageData['ldap_basedn']);
                                        }
                                        break;
                        }
!                       
!                       $this->t->parse("out","main");
!                       print $this->t->get('out','main');
!                       
!                       $phpgw->common->phpgw_footer();
                }
                
                function editSettings($_serverid='')
                {
!                       global $phpgw, $phpgw_info, $serverid, $HTTP_GET_VARS;
!                       
                        if(!empty($_serverid)) $serverid=$_serverid;
!                       
                        $ldapData = $this->boqmailldap->getLDAPData($serverid);
  
!                       $this->display_app_header();
!                       
!                       $this->t->set_file(array("body" => 'ldapsettings.tpl'));
!                       $this->t->set_block('body','main');
!                       $this->t->set_block('body','menu_row');
!                       $this->t->set_block('body','menu_row_bold');
!                       $this->t->set_block('body','activation_row');
!                       
                        $this->translate();
  
                        if ($storageData = 
$this->boqmailldap->getLDAPStorageData($serverid))
                        {
!                               
$this->t->set_var('qmail_servername',$storageData['qmail_servername']);
!                               
$this->t->set_var('description',$storageData['description']);
!                               
$this->t->set_var('ldap_basedn',$storageData['ldap_basedn']);
                        }
  
-                       
$this->t->set_var('done_row_color',$this->rowColor[($i)%2]);
                        $linkData = array
                        (
!                               'menuaction'    => 
'qmailldap.uiqmailldap.listServers'
                        );
!                       
$this->t->set_var('done_link',$phpgw->link('/index.php',$linkData));
!                       
$this->t->set_var('th_bg',$phpgw_info["theme"]["th_bg"]);
!                       $this->t->set_var('bg_01',$phpgw_info["theme"]["bg01"]);
!                       $this->t->set_var('bg_02',$phpgw_info["theme"]["bg02"]);
!                       
                        $linkData = array
                        (
--- 242,296 ----
                                                'serverid'      => $serverid
                                        );
!                                       
$GLOBALS['phpgw']->template->set_var('add_route_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        break;
!                               case '20':
!                                       
$GLOBALS['phpgw']->template->set_var('ldaplocaldelivery_'.$ldapData['ldaplocaldelivery'],'selected');
!                                       
$GLOBALS['phpgw']->template->set_var('ldapdefaultdotmode_'.$ldapData['ldapdefaultdotmode'],'selected');
!                                       
$GLOBALS['phpgw']->template->set_var('ldapbasedn',$ldapData['ldapbasedn']);
                                        break;
!                               case '99':
                                        if ($storageData = 
$this->boqmailldap->getLDAPStorageData($serverid))
                                        {
!                                               
$GLOBALS['phpgw']->template->set_var('qmail_servername',$storageData['qmail_servername']);
!                                               
$GLOBALS['phpgw']->template->set_var('description',$storageData['description']);
!                                               
$GLOBALS['phpgw']->template->set_var('ldap_basedn',$storageData['ldap_basedn']);
                                        }
                                        break;
                        }
! 
!                       $GLOBALS['phpgw']->template->parse('out','main');
!                       print $GLOBALS['phpgw']->template->get('out','main');
                }
                
                function editSettings($_serverid='')
                {
!                       $serverid               = 
get_var('serverid',array('GET'));
!                       $HTTP_GET_VARS  = 
get_var('HTTP_GET_VARS',array('GET'));;
! 
                        if(!empty($_serverid)) $serverid=$_serverid;
! 
                        $ldapData = $this->boqmailldap->getLDAPData($serverid);
  
!                       $GLOBALS['phpgw']->template->set_file(array('body' => 
'ldapsettings.tpl'));
!                       $GLOBALS['phpgw']->template->set_block('body','main');
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row');
!                       
$GLOBALS['phpgw']->template->set_block('body','menu_row_bold');
!                       
$GLOBALS['phpgw']->template->set_block('body','activation_row');
! 
                        $this->translate();
  
                        if ($storageData = 
$this->boqmailldap->getLDAPStorageData($serverid))
                        {
!                               
$GLOBALS['phpgw']->template->set_var('qmail_servername',$storageData['qmail_servername']);
!                               
$GLOBALS['phpgw']->template->set_var('description',$storageData['description']);
!                               
$GLOBALS['phpgw']->template->set_var('ldap_basedn',$storageData['ldap_basedn']);
                        }
  
                        $linkData = array
                        (
!                               'menuaction' => 
'qmailldap.uiqmailldap.listServers'
                        );
!                       
$GLOBALS['phpgw']->template->set_var('done_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
! 
                        $linkData = array
                        (
***************
*** 354,385 ****
                                'serverid'      => $serverid
                        );
!                       
$this->t->set_var('form_action',$phpgw->link('/index.php',$linkData));
!                                                                               
                                                                                
                                
!                       $this->t->parse("out","main");
!                       print $this->t->get('out','main');
!                       
!                       $phpgw->common->phpgw_footer();
                }
                
                function listServers()
                {
!                       global $phpgw, $phpgw_info;
!                       
!                       $this->display_app_header();
!                       
!                       $this->t->set_file(array("body" => "listservers.tpl"));
!                       $this->t->set_block('body','main','main');
!                       $this->t->set_block('body','row','row');
                        
                        $this->translate();
- 
                        $serverList = $this->boqmailldap->getServerList();
!                       
                        if ($serverList)
                        {
                                for ($i=0; $i < count($serverList); $i++)
                                {
!                                       
$this->t->set_var('server_name',$serverList[$i]['qmail_servername']);
!                                       
$this->t->set_var('server_description',$serverList[$i]['description']);
                                        $linkData = array
                                        (
--- 299,323 ----
                                'serverid'      => $serverid
                        );
! 
!                       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       $GLOBALS['phpgw']->template->parse('out','main');
!                       print $GLOBALS['phpgw']->template->get('out','main');
                }
                
                function listServers()
                {
!                       $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();
! 
                        if ($serverList)
                        {
                                for ($i=0; $i < count($serverList); $i++)
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('server_name',$serverList[$i]['qmail_servername']);
!                                       
$GLOBALS['phpgw']->template->set_var('server_description',$serverList[$i]['description']);
                                        $linkData = array
                                        (
***************
*** 389,393 ****
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$this->t->set_var('edit_link',$phpgw->link('/index.php',$linkData));
                                        $linkData = array
                                        (
--- 327,331 ----
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$GLOBALS['phpgw']->template->set_var('edit_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        $linkData = array
                                        (
***************
*** 396,400 ****
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$this->t->set_var('settings_link',$phpgw->link('/index.php',$linkData));
                                        $linkData = array
                                        (
--- 334,338 ----
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$GLOBALS['phpgw']->template->set_var('settings_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                        $linkData = array
                                        (
***************
*** 402,431 ****
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$this->t->set_var('delete_link',$phpgw->link('/index.php',$linkData));
!                                       
$this->t->set_var('row_color',$this->rowColor[$i%2]);
!                                       $this->t->parse('rows','row',True);
                                }
                        }
!                       
                        $linkData = array
                        (
!                               'menuaction'    => 
'qmailldap.uiqmailldap.addServer'
                        );
!                       
$this->t->set_var('add_link',$phpgw->link('/index.php',$linkData));
!                       
!                       $this->t->parse("out","main");
!                       
!                       print $this->t->get('out','main');
!                       
!                       $phpgw->common->phpgw_footer();
                }
  
- 
                function save()
                {
!                       global $HTTP_POST_VARS, $HTTP_GET_VARS;
! 
!                       $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();
--- 340,361 ----
                                                'serverid'      => 
$serverList[$i]['id']
                                        );
!                                       
$GLOBALS['phpgw']->template->set_var('delete_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                                       
$GLOBALS['phpgw']->template->parse('rows','row',True);
                                }
                        }
! 
                        $linkData = array
                        (
!                               'menuaction' => 
'qmailldap.uiqmailldap.addServer'
                        );
!                       
$GLOBALS['phpgw']->template->set_var('add_link',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       $GLOBALS['phpgw']->template->parse('out','main');
!                       print $GLOBALS['phpgw']->template->get('out','main');
                }
  
                function save()
                {
!                       $this->boqmailldap->save($GLOBALS['HTTP_POST_VARS'], 
$GLOBALS['HTTP_GET_VARS']);
!                       if ($GLOBALS['HTTP_POST_VARS']['bo_action'] == 
'save_ldap' || $GLOBALS['HTTP_GET_VARS']['bo_action'] == 'save_ldap')
                        {
                                $this->listServers();
***************
*** 433,437 ****
                        else
                        {
!                               
$this->editServer($HTTP_GET_VARS["serverid"],$HTTP_GET_VARS["pagenumber"]);
                        }
                }
--- 363,367 ----
                        else
                        {
!                               
$this->editServer($GLOBALS['HTTP_GET_VARS']['serverid'],$GLOBALS['HTTP_GET_VARS']['pagenumber']);
                        }
                }
***************
*** 439,474 ****
                function translate()
                {
!                       global $phpgw_info;                     
! 
!                       
$this->t->set_var('th_bg',$phpgw_info["theme"]["th_bg"]);
!                       $this->t->set_var('bg_01',$phpgw_info["theme"]["bg01"]);
!                       $this->t->set_var('bg_02',$phpgw_info["theme"]["bg02"]);
! 
!                       $this->t->set_var('lang_server_list',lang('server 
list'));
!                       $this->t->set_var('lang_server_name',lang('server 
name'));
!                       
$this->t->set_var('lang_server_description',lang('description'));
!                       $this->t->set_var('lang_activate',lang('Activate'));
!                       $this->t->set_var('lang_edit',lang('edit'));
!                       $this->t->set_var('lang_save',lang('save'));
!                       $this->t->set_var('lang_delete',lang('delete'));
!                       $this->t->set_var('lang_disabled',lang('disabled'));
!                       $this->t->set_var('lang_enabled',lang('enabled'));
!                       $this->t->set_var('lang_add',lang('add'));
!                       $this->t->set_var('lang_done',lang('Done'));
!                       $this->t->set_var('lang_back',lang('back'));
!                       $this->t->set_var('lang_remove',lang('remove'));
!                       $this->t->set_var('lang_add_to_local',lang('add also to 
local domains'));
!                       $this->t->set_var('lang_ldap_server',lang('LDAP 
server'));
!                       $this->t->set_var('lang_ldap_basedn',lang('LDAP 
basedn'));
!                       $this->t->set_var('lang_ldap_server_admin',lang('admin 
dn'));
!                       
$this->t->set_var('lang_ldap_server_password',lang('admin password'));
!                       $this->t->set_var('lang_add_server',lang('add server'));
!                       
$this->t->set_var('lang_domain_name',lang('domainname'));
!                       $this->t->set_var('lang_remote_server',lang('remote 
server'));
!                       $this->t->set_var('lang_remote_port',lang('remote 
port'));
!                       
!                       $this->t->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.'));
!                       $this->t->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.'));
!                       $this->t->set_var('desc_ldapbasedn',lang('The base DN 
from where the search in the LDAP tree begins.'));
                }
        }
--- 369,398 ----
                function translate()
                {
!                       
$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'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_activate',lang('Activate'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_save',lang('save'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('delete'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_disabled',lang('disabled'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_enabled',lang('enabled'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_back',lang('back'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_remove',lang('remove'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_add_to_local',lang('add also to 
local domains'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_ldap_server',lang('LDAP server'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_ldap_basedn',lang('LDAP basedn'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_ldap_server_admin',lang('admin dn'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_ldap_server_password',lang('admin 
password'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_add_server',lang('add server'));
!                       
$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('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: class.uiuserdata.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/qmailldap/inc/class.uiuserdata.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uiuserdata.inc.php    4 Oct 2001 00:48:55 -0000       1.6
--- class.uiuserdata.inc.php    7 Dec 2002 02:54:43 -0000       1.7
***************
*** 24,75 ****
                function uiuserdata()
                {
!                       global $phpgw, $phpgw_info;
! 
!                       $this->t                        = 
CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('qmailldap'));
!                       $this->boqmailldap              = 
CreateObject('qmailldap.boqmailldap');
!                       
!                       $this->rowColor[0] = $phpgw_info["theme"]["bg01"];
!                       $this->rowColor[1] = $phpgw_info["theme"]["bg02"];
!                                        
!               }
!       
!               function display_app_header()
!               {
!                       global $phpgw, $phpgw_info;
!                       
!                       $phpgw->common->phpgw_header();
!                       echo parse_navbar();
!                       
                }
  
                function editUserData($_useCache='0')
                {
!                       global $phpgw, $phpgw_info, $HTTP_GET_VARS;
!                       
!                       $accountID = $HTTP_GET_VARS['account_id'];              
        
! 
!                       $this->display_app_header();
! 
                        $this->translate();
  
!                       $this->t->set_file(array("editUserData" => 
"edituserdata.tpl"));
!                       $this->t->set_block('editUserData','form','form');
!                       
$this->t->set_block('editUserData','link_row','link_row');
!                       
$this->t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
!                       
$this->t->set_var("tr_color1",$phpgw_info["theme"]["row_on"]);
!                       
$this->t->set_var("tr_color2",$phpgw_info["theme"]["row_off"]);
!                       
!                       $this->t->set_var("lang_email_config",lang("edit email 
settings"));
!                       $this->t->set_var("lang_emailAddress",lang("email 
address"));
!                       
$this->t->set_var("lang_emailaccount_active",lang("email account active"));
!                       
$this->t->set_var("lang_mailAlternateAddress",lang("alternate email address"));
!                       
$this->t->set_var("lang_mailRoutingAddress",lang("forward email's to"));
!                       $this->t->set_var("lang_forward_also_to",lang("forward 
also to"));
!                       $this->t->set_var("lang_button",lang("save"));
!                       $this->t->set_var("lang_deliver_extern",lang("deliver 
extern"));
!                       $this->t->set_var("lang_deliver_extern",lang("deliver 
extern"));
!                       $this->t->set_var("lang_edit_email_settings",lang("edit 
email settings"));
!                       $this->t->set_var("lang_ready",lang("Done"));
!                       
$this->t->set_var("link_back",$phpgw->link('/admin/accounts.php'));
                        
                        $linkData = array
--- 24,51 ----
                function uiuserdata()
                {
!                       $this->boqmailldap = 
CreateObject('qmailldap.boqmailldap');
                }
  
                function editUserData($_useCache='0')
                {
!                       $accountID = get_var('account_id',array('GET'));        
                
                        $this->translate();
  
!                       
$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'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_mailAlternateAddress',lang('alternate
 email address'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_mailRoutingAddress',lang('forward 
emails to'));
!                       
$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('link_back',$GLOBALS['phpgw']->link('/admin/accounts.php'));
                        
                        $linkData = array
***************
*** 78,82 ****
                                'account_id'    => $accountID
                        );
!                       $this->t->set_var("form_action", 
$phpgw->link('/index.php',$linkData));
                        
                        // only when we show a existing user
--- 54,58 ----
                                'account_id'    => $accountID
                        );
!                       $GLOBALS['phpgw']->template->set_var("form_action", 
$GLOBALS['phpgw']->link('/index.php',$linkData));
                        
                        // only when we show a existing user
***************
*** 98,129 ****
                                        $options_mailAlternateAddress = 
lang('no alternate email address');
                                }
!                       
!                               
$this->t->set_var("mailLocalAddress",$userData["mailLocalAddress"]);
!                               $this->t->set_var("mailAlternateAddress",'');
!                               
$this->t->set_var("options_mailAlternateAddress",$options_mailAlternateAddress);
!                               
$this->t->set_var("mailRoutingAddress",$userData["mailRoutingAddress"]);
!                               
$this->t->set_var("selected_".$userData["qmailDotMode"],'selected');
!                               
$this->t->set_var("deliveryProgramPath",$userData["deliveryProgramPath"]);
                                
!                               
$this->t->set_var("uid",rawurlencode($_accountData["dn"]));
!                               if ($userData["accountStatus"] == "active")
!                                       
$this->t->set_var("account_checked","checked");
!                               if ($_accountData["deliverExtern"] == "active")
!                                       
$this->t->set_var("deliver_checked","checked");
                        }
                        else
                        {
!                               $this->t->set_var("mailLocalAddress",'');
!                               $this->t->set_var("mailAlternateAddress",'');
!                               $this->t->set_var("mailRoutingAddress",'');
!                               
$this->t->set_var("options_mailAlternateAddress",lang('no alternate email 
address'));
!                               $this->t->set_var("account_checked",'');
                        }
                
                        // create the menu on the left, if needed               
                        $menuClass = CreateObject('admin.uimenuclass');
!                       
$this->t->set_var('rows',$menuClass->createHTMLCode('edit_user'));
  
!                       $this->t->pparse("out","form");
  
                }
--- 74,109 ----
                                        $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('uid',rawurlencode($_accountData['dn']));
!                               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
                        {
!                               
$GLOBALS['phpgw']->template->set_var('mailLocalAddress','');
!                               
$GLOBALS['phpgw']->template->set_var('mailAlternateAddress','');
!                               
$GLOBALS['phpgw']->template->set_var('mailRoutingAddress','');
!                               
$GLOBALS['phpgw']->template->set_var('options_mailAlternateAddress',lang('no 
alternate email address'));
!                               
$GLOBALS['phpgw']->template->set_var('account_checked','');
                        }
                
                        // create the menu on the left, if needed               
                        $menuClass = CreateObject('admin.uimenuclass');
!                       
$GLOBALS['phpgw']->template->set_var('rows',$menuClass->createHTMLCode('edit_user'));
  
!                       $GLOBALS['phpgw']->template->pparse("out","form");
  
                }
***************
*** 131,156 ****
                function saveUserData()
                {
!                       global $HTTP_POST_VARS, $HTTP_GET_VARS;
                        
!                       if($HTTP_POST_VARS["accountStatus"] == "on")
                        {
!                               $accountStatus = "active";
                        }
  
                        $formData = array
                        (
!                               'mailLocalAddress'              => 
$HTTP_POST_VARS["mailLocalAddress"],
!                               'mailRoutingAddress'            => 
$HTTP_POST_VARS["mailRoutingAddress"],
!                               'add_mailAlternateAddress'      => 
$HTTP_POST_VARS["mailAlternateAddressInput"],
!                               'remove_mailAlternateAddress'   => 
$HTTP_POST_VARS["mailAlternateAddress"],
!                               'qmailDotMode'                  => 
$HTTP_POST_VARS["qmailDotMode"],
!                               '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';
!                       
                        
$this->boqmailldap->saveUserData($HTTP_GET_VARS['account_id'], $formData, 
$bo_action);
  
--- 111,145 ----
                function saveUserData()
                {
!                       $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')
                        {
!                               $accountStatus = 'active';
                        }
  
                        $formData = array
                        (
!                               'mailLocalAddress'                              
=> $HTTP_POST_VARS['mailLocalAddress'],
!                               'mailRoutingAddress'                    => 
$HTTP_POST_VARS['mailRoutingAddress'],
!                               'add_mailAlternateAddress'              => 
$HTTP_POST_VARS['mailAlternateAddressInput'],
!                               'remove_mailAlternateAddress'   => 
$HTTP_POST_VARS['mailAlternateAddress'],
!                               'qmailDotMode'                                  
=> $HTTP_POST_VARS['qmailDotMode'],
!                               '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';
!                       }
                        
$this->boqmailldap->saveUserData($HTTP_GET_VARS['account_id'], $formData, 
$bo_action);
  
***************
*** 169,184 ****
                function translate()
                {
!                       global $phpgw_info;                     
! 
!                       
$this->t->set_var('th_bg',$phpgw_info['theme']['th_bg']);
! 
!                       $this->t->set_var('lang_add',lang('add'));
!                       $this->t->set_var('lang_done',lang('Done'));
!                       $this->t->set_var('lang_remove',lang('remove'));
!                       $this->t->set_var('lang_remove',lang('remove'));
!                       
$this->t->set_var('lang_advanced_options',lang('advanced options'));
!                       
$this->t->set_var('lang_qmaildotmode',lang('qmaildotmode'));
!                       $this->t->set_var('lang_default',lang('default'));
!                       
$this->t->set_var('lang_deliveryProgramPath',lang('deliveryProgramPath'));
                }
        }
--- 158,169 ----
                function translate()
                {
!                       
$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'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_remove',lang('remove'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_advanced_options',lang('advanced 
options'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_qmaildotmode',lang('qmaildotmode'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_default',lang('default'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_deliveryProgramPath',lang('deliveryProgramPath'));
                }
        }





reply via email to

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