[3102] | 1 | <?php |
---|
| 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 | \***************************************************************************/ |
---|
| 12 | |
---|
| 13 | $size_of_acl = sizeof($GLOBALS['phpgw_info']['user']['acl']); |
---|
| 14 | |
---|
| 15 | for( $i = 0; $i < $size_of_acl && $GLOBALS['phpgw_info']['user']['acl'] != "jabberit_messenger"; $i++ ) |
---|
| 16 | { |
---|
| 17 | $apps = unserialize($GLOBALS['phpgw_info']['server']['apps_jabberit']); |
---|
| 18 | $flag = false; |
---|
| 19 | |
---|
| 20 | if( is_array($apps) ) |
---|
| 21 | { |
---|
| 22 | foreach($apps as $tmp) |
---|
| 23 | { |
---|
| 24 | $app_enabled = substr($tmp,0,strpos($tmp,";")); |
---|
| 25 | if( $GLOBALS['phpgw_info']['flags']['currentapp'] == $app_enabled ) |
---|
| 26 | $flag = true; |
---|
| 27 | } |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'jabberit_messenger' && ( $flag || $GLOBALS['phpgw_info']['flags']['currentapp'] == 'jabberit_messenger' )) |
---|
| 31 | { |
---|
| 32 | |
---|
| 33 | $ldapManager = CreateObject('contactcenter.bo_ldap_manager'); |
---|
| 34 | $_SESSION['phpgw_info']['jabberit_messenger']['ldapManager'] = $ldapManager->srcs[1]; |
---|
| 35 | |
---|
| 36 | $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; |
---|
| 37 | $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; |
---|
| 38 | |
---|
| 39 | if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1)) |
---|
| 40 | $webserver_url .= '/'; |
---|
| 41 | |
---|
| 42 | $help_expresso = $webserver_url .'help'; |
---|
| 43 | $webserver_url = $webserver_url . 'jabberit_messenger/jmessenger/'; |
---|
| 44 | |
---|
| 45 | require_once PHPGW_SERVER_ROOT . '/jabberit_messenger/jmessenger/inc/jabberit_sessions.inc.php'; |
---|
| 46 | |
---|
| 47 | $_SESSION['phpgw_info']['jabberit_messenger']['webserver_url'] = $webserver_url; |
---|
| 48 | |
---|
| 49 | // Temas Expresso |
---|
| 50 | $theme = "window_" . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . ".css"; |
---|
| 51 | |
---|
| 52 | if( !file_exists('../jabberit_messenger/jmessenger/templates/default/css/'.$theme) ) |
---|
| 53 | $theme = "window_default.css"; |
---|
| 54 | |
---|
| 55 | // User |
---|
| 56 | $fullName = $_SESSION['phpgw_info']['jabberit_messenger']['fullname']; |
---|
| 57 | |
---|
| 58 | $js = "var path_jabberit ='".$webserver_url."';"; |
---|
| 59 | $js .= "var theme_jabberit ='".$theme."';"; |
---|
| 60 | $js .= "var help_expresso ='".$help_expresso."';"; |
---|
| 61 | |
---|
| 62 | // Preferences User |
---|
| 63 | require_once PHPGW_SERVER_ROOT . '/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php'; |
---|
| 64 | |
---|
| 65 | $_DbIM = new DataBaseIM(); |
---|
| 66 | $preferences = $_DbIM->getPreferences(); |
---|
| 67 | |
---|
| 68 | echo "<script type='text/javascript'>".$js."</script>"; |
---|
[3261] | 69 | echo "<script type='text/javascript' src='".$webserver_url . "js/strophe.mini.js'></script>"; |
---|
| 70 | echo "<script type='text/javascript' src='".$webserver_url . "js/SnifferBrowser.mini.js'></script>"; |
---|
[3127] | 71 | echo "<script type='text/javascript' src='".$webserver_url . "js/jscode/loadIM.mini.js'></script>"; |
---|
| 72 | echo "<script type='text/javascript' src='".$webserver_url . "js/connector.mini.js'></script>"; |
---|
| 73 | echo "<script type='text/javascript' src='".$webserver_url . "js/xtools.mini.js'></script>"; |
---|
| 74 | echo "<script type='text/javascript' src='".$webserver_url . "js/lang/i18n_pt_Br.mini.js'></script>"; |
---|
| 75 | echo "<script type='text/javascript' src='".$webserver_url . "js/dragdrop.mini.js'></script>"; |
---|
| 76 | echo "<script type='text/javascript' src='".$webserver_url . "js/makeW.mini.js'></script>"; |
---|
| 77 | echo "<script type='text/javascript' src='".$webserver_url . "js/show_hidden.mini.js'></script>"; |
---|
| 78 | echo "<script type='text/javascript' src='".$webserver_url . "js/trophyim_constants.js'></script>"; |
---|
| 79 | echo "<script type='text/javascript' src='".$webserver_url . "js/trophyim.mini.js'></script>"; |
---|
| 80 | echo "<script type='text/javascript' src='".$webserver_url . "js/AddUser.mini.js'></script>"; |
---|
[3102] | 81 | echo "<script type='text/javascript' src='".$webserver_url . "js/json2.js'></script>"; |
---|
[3127] | 82 | echo "<script type='text/javascript' src='".$webserver_url . "js/SelectEditable.mini.js'></script>"; |
---|
[3102] | 83 | echo "<script type='text/javascript'> var loadscript = new LoadIM('".$fullName."','".$preferences."'); </script>"; |
---|
| 84 | |
---|
| 85 | break; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | ?> |
---|