source: sandbox/jabberit_messenger/trophy_expresso/inc/jabberit_acl.inc.php @ 2621

Revision 2621, 2.6 KB checked in by alexandrecorreia, 9 years ago (diff)

Ticket #986 - Correcao para compatibilizar o carregamento do script para o IE.

  • Property svn:executable set to *
Line 
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
15for( $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                $webserver_url = $webserver_url . 'jmessenger/';
43               
44                require_once PHPGW_SERVER_ROOT . '/jmessenger/inc/jabberit_sessions.inc.php';
45               
46                $_SESSION['phpgw_info']['jabberit_messenger']['webserver_url'] = $webserver_url;
47               
48                // Temas Expresso
49                $theme = "window_" . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . ".css";
50               
51                if( !file_exists('../jmessenger/templates/default/css/'.$theme) )
52                        $theme = "window_default.css";
53
54                // User
55                $fullName       = $_SESSION['phpgw_info']['jabberit_messenger']['fullname'];
56
57                $js  = "var path_jabberit='".$webserver_url."';";
58                $js .= "var theme_jabberit='".$theme."';";
59
60                echo "<script type='text/javascript'>".$js."</script>";
61                echo "<script type='text/javascript' src='".$webserver_url . "js/loadIM.js'></script>";
62                echo "<script type='text/javascript'> var loadIM = new LoadIM('".$fullName."'); </script>";
63
64                break;
65        }
66       
67}
68
69?>
Note: See TracBrowser for help on using the repository browser.