[382] | 1 | <?php |
---|
[417] | 2 | /***************************************************************************\ |
---|
| 3 | * Expresso - Expresso Messenger * |
---|
| 4 | * - Alexandre Correia / Rodrigo Souza * |
---|
| 5 | * - JETI - http://jeti-im.org/ * |
---|
| 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 | \***************************************************************************/ |
---|
[382] | 12 | |
---|
[417] | 13 | define('PHPGW_API_INC','../../phpgwapi/inc'); |
---|
| 14 | require_once(PHPGW_API_INC . '/class.Template.inc.php'); |
---|
| 15 | |
---|
[382] | 16 | if(isset($_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit'])) |
---|
| 17 | { |
---|
[551] | 18 | // Path Server |
---|
[382] | 19 | $path = $_SESSION['phpgw_info']['jabberit_messenger']['webserver_url']; |
---|
[459] | 20 | $SERVER_EXPRESSO = $_SERVER['HTTP_HOST'] . $path; |
---|
[551] | 21 | |
---|
| 22 | // Type Protocol http / https |
---|
| 23 | $protocol = trim("http"); |
---|
| 24 | if( $_SESSION['phpgw_info']['jabberit_messenger']['use_https'] === 2 ) |
---|
| 25 | $protocol = trim("https"); |
---|
[512] | 26 | |
---|
[551] | 27 | // Uid user |
---|
[512] | 28 | $uid = $_SESSION['phpgw_info']['jabberit_messenger']['user']; |
---|
| 29 | |
---|
[526] | 30 | $organization = explode(",", $_SESSION['phpgw_info']['jabberit_messenger']['attributes_org_ldap_jabberit']); |
---|
| 31 | |
---|
| 32 | $organization_user = $_SESSION['phpgw_info']['jabberit_messenger']['account_dn']; |
---|
| 33 | $organization_user = substr($organization_user, strpos($organization_user,"ou=") + 3 , strlen($organization_user)); |
---|
| 34 | $organization_user = substr($organization_user, 0, strpos($organization_user, ",")); |
---|
| 35 | |
---|
[551] | 36 | // FirstName |
---|
| 37 | $CnName = explode(" ",$_SESSION['phpgw_info']['jabberit_messenger']['fullname']); |
---|
| 38 | |
---|
[526] | 39 | if(is_array($organization)) |
---|
[512] | 40 | { |
---|
[526] | 41 | foreach($organization as $attr) |
---|
[512] | 42 | { |
---|
[526] | 43 | $tmp = explode(";",$attr); |
---|
| 44 | if( strtolower(trim($tmp[0])) == strtolower(trim($organization_user))) |
---|
| 45 | { |
---|
| 46 | switch(strtolower(trim($tmp[1]))) |
---|
| 47 | { |
---|
| 48 | case "mail" : |
---|
| 49 | $uid = $_SESSION['phpgw_info']['jabberit_messenger']['mail']; |
---|
| 50 | $uid = substr($uid,0,strpos($uid,"@")); |
---|
| 51 | break; |
---|
| 52 | |
---|
| 53 | case "description" : |
---|
| 54 | // SERPRO |
---|
| 55 | // parte antes do arroba; |
---|
| 56 | // Informe aqui a parte da sessão correspondente; |
---|
| 57 | $uid = "description"; |
---|
| 58 | break; |
---|
| 59 | } |
---|
| 60 | } |
---|
[512] | 61 | } |
---|
| 62 | } |
---|
[526] | 63 | |
---|
[494] | 64 | $template = new Template('templates/default'); |
---|
[417] | 65 | $template->set_var("path", $path); |
---|
| 66 | $template->set_var("file0", filemtime("applet.jar")); |
---|
| 67 | $template->set_var("file1", filemtime("plugins/groupchat.jar")); |
---|
| 68 | $template->set_var("file2", filemtime("plugins/sound.jar")); |
---|
| 69 | $template->set_var("file3", filemtime("plugins/xhtml.jar")); |
---|
| 70 | $template->set_var("value_server",$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']); |
---|
| 71 | $template->set_var("value_host",$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']); |
---|
| 72 | $template->set_var("value_port",$_SESSION['phpgw_info']['jabberit_messenger']['port_jabberit']); |
---|
| 73 | $template->set_var("value_resource",$_SESSION['phpgw_info']['jabberit_messenger']['resource_jabberit']); |
---|
[512] | 74 | $template->set_var("value_user",$uid); |
---|
[417] | 75 | $template->set_var("value_password",$_SESSION['phpgw_info']['jabberit_messenger']['passwd']); |
---|
| 76 | $template->set_var("value_ssl",$_SESSION['phpgw_info']['jabberit_messenger']['use_ssl_jabberit']); |
---|
| 77 | $template->set_var("value_hideloginstatus","TRUE"); |
---|
| 78 | $template->set_var("value_userproxy",$_SESSION['phpgw_info']['jabberit_messenger']['use_proxy_java']); |
---|
| 79 | $template->set_var("value_expresso",$SERVER_EXPRESSO); |
---|
[551] | 80 | $template->set_var("value_use_https", $protocol); |
---|
[466] | 81 | $template->set_var("value_company", $_SESSION['phpgw_info']['jabberit_messenger']['name_company']); |
---|
[551] | 82 | $template->set_var("value_cnname",$CnName[0]); |
---|
[417] | 83 | $template->set_file(Array('jabberit_messenger' => 'jabberIM.tpl')); |
---|
| 84 | $template->set_block('jabberit_messenger','index'); |
---|
| 85 | $template->pfp('out','index'); |
---|
| 86 | } |
---|
[382] | 87 | |
---|
[512] | 88 | ?> |
---|