source: trunk/jabberit_messenger/inc/class.uiconforganization.inc.php @ 519

Revision 519, 4.2 KB checked in by niltonneto, 16 years ago (diff)

Alterações do desenvolvedor, referente ao:

  • Atributo LDAP que será usado para autenticação.
  • Tela para incluir OUs que usam outro tipo de atributo (ex. mail) para autenticação.
  • Pacotes JAR assinados novamente.
Line 
1<?php
2
3  /***************************************************************************\
4  *  Expresso - Expresso Messenger                                            *
5  *     - Alexandre Correia / Rodrigo Souza                                                               *
6  * ------------------------------------------------------------------------- *
7  *  This program is free software; you can redistribute it and/or modify it  *
8  *  under the terms of the GNU General Public License as published by the    *
9  *  Free Software Foundation; either version 2 of the License, or (at your   *
10  *  option) any later version.                                               *
11  \***************************************************************************/
12
13require_once "class.ldap_im.inc.php";
14
15class uiconforganization
16{
17
18        private $bo;
19        private $ldap;
20
21        public $public_functions = array(
22                'backPage'  => True,
23                'edit_conf' => True,
24        );
25
26        final function __construct()
27        {
28                //$this->bo = new bomodule();   
29        }       
30       
31        public final function edit_conf()
32        {
33                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
34                {
35                        $GLOBALS['phpgw']->redirect_link('/index.php');
36                }               
37               
38                $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') .' - ' . 'Configurar o Atributo de Autenticação';
39               
40                //if(!@is_object($GLOBALS['phpgw']->js))
41                //{
42                //      $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
43                //}
44                       
45                $_SESSION['phpgwinfo']['db_host'] = $GLOBALS['phpgw_info']['server']['db_host'];
46        $_SESSION['phpgwinfo']['db_port'] = $GLOBALS['phpgw_info']['server']['db_port'];
47        $_SESSION['phpgwinfo']['db_name'] = $GLOBALS['phpgw_info']['server']['db_name'];
48        $_SESSION['phpgwinfo']['db_user'] = $GLOBALS['phpgw_info']['server']['db_user'];
49        $_SESSION['phpgwinfo']['db_pass'] = $GLOBALS['phpgw_info']['server']['db_pass'];
50        $_SESSION['phpgwinfo']['db_type'] = $GLOBALS['phpgw_info']['server']['db_type'];
51                       
52                $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
53                $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
54               
55                //$js = array('functions');
56                //foreach( $js as $tmp )
57                //      $GLOBALS['phpgw']->js->validate_file('',$tmp,'jabberit_messenger');
58
59                $GLOBALS['phpgw']->common->phpgw_header();
60                echo parse_navbar();
61
62                $options_attributes = array('uid','mail');
63                $attributes .= "<option value='-1'>-- ".lang('Choice attribute')." --</option>";
64                foreach($options_attributes as $tmp )
65                        $attributes .= "<option value='".$tmp."'>".$tmp."</option>";
66
67                $options_orgAttributes = explode(",",$GLOBALS['phpgw_info']['server']['attributes_org_ldap_jabberit']);
68                natcasesort($options_orgAttributes);
69               
70                foreach($options_orgAttributes as $key => $tmp)
71                {
72                        if( $tmp != "" )
73                        {
74                                $attr = explode(";", $tmp);
75                                $orgAttributes .= "<tr id='".$attr[0]."' style='width:40%' class='row_off'>";
76                                $orgAttributes .= "<td>".$attr[0]."</td>";
77                                $orgAttributes .= "<td>".$attr[1]."</td>";
78                                $orgAttributes .= "<td><a href=\"javascript:constructScript.removeOrg('".$attr[0]."');\">Excluir</a>";
79                                $orgAttributes .= "</td></tr>";
80                        }
81                }
82               
83                // Load Language;
84                require_once "load_lang.php";
85                               
86                $GLOBALS['phpgw']->template->set_file(array('jabberit_messenger'=>'confOrganization.tpl'));
87                $GLOBALS['phpgw']->template->set_block('jabberit_messenger','confOrg');
88                $GLOBALS['phpgw']->template->set_var(array(
89                                                                                'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uiconforganization.backPage'),
90                                                                                'attributes_list' => $attributes,                       
91                                                                                'lang_add' => 'Adicionar',
92                                                                                'lang_Attribute' => lang('Attribute'), 
93                                                                                'lang_Back' => 'Voltar',
94                                                                                'lang_cancel' => lang('Cancel'),
95                                                                                'lang_Delete' => lang('Delete'),                                                                               
96                                                                                'lang_save' => lang('Save'),
97                                                                                'lang_Organization' => lang('Organization'),
98                                                                                'organizations_attributes' => $orgAttributes,
99                                                                                ));
100       
101                $GLOBALS['phpgw']->template->pparse('out','confOrg');
102        }
103       
104        public final function backPage()
105        {
106                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
107                {
108                        $GLOBALS['phpgw']->redirect_link('/index.php');
109                }               
110               
111                if ($_POST['cancel'])
112                {
113                        $GLOBALS['phpgw']->redirect_link('/admin/index.php');
114                }
115
116                $GLOBALS['phpgw']->redirect_link('/admin/index.php');
117        }
118       
119}
120
121?>
Note: See TracBrowser for help on using the repository browser.