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