[519] | 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 | |
---|
| 13 | require_once "class.ldap_im.inc.php"; |
---|
| 14 | |
---|
| 15 | class 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 | public final function edit_conf() |
---|
| 27 | { |
---|
| 28 | if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin')) |
---|
| 29 | { |
---|
| 30 | $GLOBALS['phpgw']->redirect_link('/index.php'); |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') .' - ' . 'Configurar o Atributo de Autenticação'; |
---|
| 34 | |
---|
| 35 | $_SESSION['phpgwinfo']['db_host'] = $GLOBALS['phpgw_info']['server']['db_host']; |
---|
| 36 | $_SESSION['phpgwinfo']['db_port'] = $GLOBALS['phpgw_info']['server']['db_port']; |
---|
| 37 | $_SESSION['phpgwinfo']['db_name'] = $GLOBALS['phpgw_info']['server']['db_name']; |
---|
| 38 | $_SESSION['phpgwinfo']['db_user'] = $GLOBALS['phpgw_info']['server']['db_user']; |
---|
| 39 | $_SESSION['phpgwinfo']['db_pass'] = $GLOBALS['phpgw_info']['server']['db_pass']; |
---|
| 40 | $_SESSION['phpgwinfo']['db_type'] = $GLOBALS['phpgw_info']['server']['db_type']; |
---|
| 41 | |
---|
| 42 | $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; |
---|
| 43 | $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; |
---|
| 44 | |
---|
| 45 | $GLOBALS['phpgw']->common->phpgw_header(); |
---|
| 46 | echo parse_navbar(); |
---|
| 47 | |
---|
[526] | 48 | $options_attributes = array('uid','mail','description'); |
---|
[519] | 49 | $attributes .= "<option value='-1'>-- ".lang('Choice attribute')." --</option>"; |
---|
| 50 | foreach($options_attributes as $tmp ) |
---|
| 51 | $attributes .= "<option value='".$tmp."'>".$tmp."</option>"; |
---|
| 52 | |
---|
| 53 | $options_orgAttributes = explode(",",$GLOBALS['phpgw_info']['server']['attributes_org_ldap_jabberit']); |
---|
| 54 | natcasesort($options_orgAttributes); |
---|
| 55 | |
---|
| 56 | foreach($options_orgAttributes as $key => $tmp) |
---|
| 57 | { |
---|
| 58 | if( $tmp != "" ) |
---|
| 59 | { |
---|
| 60 | $attr = explode(";", $tmp); |
---|
| 61 | $orgAttributes .= "<tr id='".$attr[0]."' style='width:40%' class='row_off'>"; |
---|
| 62 | $orgAttributes .= "<td>".$attr[0]."</td>"; |
---|
| 63 | $orgAttributes .= "<td>".$attr[1]."</td>"; |
---|
| 64 | $orgAttributes .= "<td><a href=\"javascript:constructScript.removeOrg('".$attr[0]."');\">Excluir</a>"; |
---|
| 65 | $orgAttributes .= "</td></tr>"; |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | // Load Language; |
---|
| 70 | require_once "load_lang.php"; |
---|
| 71 | |
---|
| 72 | $GLOBALS['phpgw']->template->set_file(array('jabberit_messenger'=>'confOrganization.tpl')); |
---|
| 73 | $GLOBALS['phpgw']->template->set_block('jabberit_messenger','confOrg'); |
---|
| 74 | $GLOBALS['phpgw']->template->set_var(array( |
---|
| 75 | 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uiconforganization.backPage'), |
---|
| 76 | 'attributes_list' => $attributes, |
---|
| 77 | 'lang_add' => 'Adicionar', |
---|
| 78 | 'lang_Attribute' => lang('Attribute'), |
---|
| 79 | 'lang_Back' => 'Voltar', |
---|
| 80 | 'lang_cancel' => lang('Cancel'), |
---|
| 81 | 'lang_Delete' => lang('Delete'), |
---|
| 82 | 'lang_save' => lang('Save'), |
---|
| 83 | 'lang_Organization' => lang('Organization'), |
---|
| 84 | 'organizations_attributes' => $orgAttributes, |
---|
| 85 | )); |
---|
| 86 | |
---|
| 87 | $GLOBALS['phpgw']->template->pparse('out','confOrg'); |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | public final function backPage() |
---|
| 91 | { |
---|
[1684] | 92 | if( !$GLOBALS['phpgw']->acl->check('run',1,'admin') ) |
---|
[519] | 93 | { |
---|
[1684] | 94 | $GLOBALS['phpgw']->redirect_link('/admin/index.php'); |
---|
[519] | 95 | } |
---|
| 96 | |
---|
| 97 | if ($_POST['cancel']) |
---|
| 98 | { |
---|
| 99 | $GLOBALS['phpgw']->redirect_link('/admin/index.php'); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | $GLOBALS['phpgw']->redirect_link('/admin/index.php'); |
---|
| 103 | } |
---|
| 104 | |
---|
| 105 | } |
---|
| 106 | |
---|
[1684] | 107 | ?> |
---|