source: branches/2.2/phpgwapi/templates/default/login_default.php @ 3480

Revision 3480, 21.6 KB checked in by rafaelraymundo, 13 years ago (diff)

Ticket #1344 - Informar na tela de login uma identificação da versão/revisao distribuida

  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare login                                                         *
4        * http://www.egroupware.org                                                *
5        * Originaly written by Dan Kuykendall <seek3r@phpgroupware.org>            *
6        *                      Joseph Engo    <jengo@phpgroupware.org>             *
7        * Updated by Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br>      *
8        *  This program is free software; you can redistribute it and/or modify it *
9        *  under the terms of the GNU General Public License as published by the   *
10        *  Free Software Foundation; either version 2 of the License, or (at your  *
11        *  option) any later version.                                              *
12        \**************************************************************************/
13
14function check_logoutcode($code)
15        {
16                switch($code)
17                {
18                        case 1:
19                                return lang('You have been successfully logged out');
20                               
21                        case 2:
22                                return lang('Sorry, your login has expired');
23                               
24                        case 4:
25                                return lang('Cookies are required to login to this site.');
26                               
27                        case 5:
28                                return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
29
30                        case 6:
31                                return '<font color="FF0000">' . lang('Your password has expired, and you do not have access to change it') . '</font>';
32                               
33                        case 98:
34                                return '<font color="FF0000">' . lang('Account is expired') . '</font>';
35                               
36                        case 99:
37                                return '<font color="FF0000">' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '</font>';
38                        case 200:
39                            //return '<font color="FF0000">' . lang('Invalid code') . '</font>';
40                            return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
41                            break;
42                        case 10:
43                                $GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
44                                $GLOBALS['phpgw']->session->phpgw_setcookie('kp3');
45                                $GLOBALS['phpgw']->session->phpgw_setcookie('domain');
46
47                                //fix for bug php4 expired sessions bug
48                                if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4')
49                                {
50                                        $GLOBALS['phpgw']->session->phpgw_setcookie(PHPGW_PHPSESSID);
51                                }
52
53                                return '<font color="#FF0000">' . lang('Your session could not be verified.') . '</font>';
54                               
55                        default:
56                                return '';
57                }
58        }
59       
60        /* Program starts here */
61
62        if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER']))
63        {
64                $submit = True;
65                $login  = $_SERVER['PHP_AUTH_USER'];
66                $passwd = $_SERVER['PHP_AUTH_PW'];
67                $passwd_type = 'text';
68        }
69        else
70        {
71                $passwd = $_POST['passwd'];
72                $passwd_type = $_POST['passwd_type'];
73        }
74
75        # Apache + mod_ssl style SSL certificate authentication
76        # Certificate (chain) verification occurs inside mod_ssl
77        if($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd']))
78        {
79                # an X.509 subject looks like:
80                # /CN=john.doe/OU=Department/O=Company/C=xx/Email=john@comapy.tld/L=City/
81                # the username is deliberately lowercase, to ease LDAP integration
82                $sslattribs = explode('/',$_SERVER['SSL_CLIENT_S_DN']);
83                # skip the part in front of the first '/' (nothing)
84                while($sslattrib = next($sslattribs))
85                {
86                        list($key,$val) = explode('=',$sslattrib);
87                        $sslattributes[$key] = $val;
88                }
89
90                if(isset($sslattributes['Email']))
91                {
92                        $submit = True;
93
94                        # login will be set here if the user logged out and uses a different username with
95                        # the same SSL-certificate.
96                        if(!isset($_POST['login'])&&isset($sslattributes['Email']))
97                        {
98                                $login = $sslattributes['Email'];
99                                # not checked against the database, but delivered to authentication module
100                                $passwd = $_SERVER['SSL_CLIENT_S_DN'];
101                        }
102                }
103                unset($key);
104                unset($val);
105                unset($sslattributes);
106        }
107
108        if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) )
109        {
110            $_SESSION['contador'] = 0;
111        }
112
113        if(isset($passwd_type) || $_POST['submitit_x'] || $_POST['submitit_y'] || $submit)
114        {
115       
116            // Primeiro testa o captcha....se houver......
117            if($GLOBALS['phpgw_info']['server']['captcha']==1)
118              {
119                if($_SESSION['contador'] > $GLOBALS['phpgw_info']['server']['num_badlogin'])
120                    {
121                        if ($_SESSION['CAPTCHAString'] != trim(strtoupper($_POST['codigo'])))
122                                {
123                                        if(!$_GET['cd'])
124                                        {
125                                            $_GET['cd'] = '200';
126                                        }
127                                }
128                        unset($_SESSION['CAPTCHAString']);
129                    }
130              }
131                if($_POST['user']) {
132                        if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) {
133                                $common = CreateObject('phpgwapi.common');
134                                $ldap_conn = $common->ldapConnect();
135                                $justthese = array("uid");
136                                $filter="(&(phpgwAccountType=u)(uid=".$_POST['user']."))";
137                                $ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
138                                $ldap_info       = ldap_get_entries($ldap_conn, $ldap_search);
139                                ldap_close($ldap_conn);
140                                if ($ldap_info['count'] != 0) {
141                                        $_POST['login'] = $_POST['user'];
142                                }
143                        }
144                        else
145                                $_POST['login'] = $_POST['user'];
146                }
147                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' &&
148                        !isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN']))
149                {
150                        if(!$_GET['cd'])
151                            {
152                                $_GET['cd'] = '5';
153                            }
154                }
155               
156                // don't get login data again when $submit is true
157                if($submit == false)
158                {
159                        $login = $_POST['login'];
160                }
161               
162                if(strstr($login,'@') === False && isset($_POST['logindomain']))
163                {
164                        $login .= '@' . $_POST['logindomain'];
165                }
166                elseif(!isset($GLOBALS['phpgw_domain'][$GLOBALS['phpgw_info']['user']['domain']]))
167                {
168                        $login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain'];
169                }
170                If(!$_GET['cd'])
171                $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u');
172
173                if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
174                {
175
176                       If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason;
177                }
178                else
179                {
180                        if ($_POST['lang'] && preg_match('/^[a-z]{2}(-[a-z]{2}){0,1}$/',$_POST['lang']) &&
181                            $_POST['lang'] != $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
182                        {
183                                $GLOBALS['phpgw']->preferences->add('common','lang',$_POST['lang'],'session');
184                        }
185
186                        if(!$GLOBALS['phpgw_info']['server']['disable_autoload_langfiles'])
187                        {
188                                $GLOBALS['phpgw']->translation->autoload_changed_langfiles();
189                        }
190                        $forward = isset($_GET['phpgw_forward']) ? urldecode($_GET['phpgw_forward']) : @$_POST['phpgw_forward'];
191                        if (!$forward)
192                        {
193                                $extra_vars['cd'] = 'yes';
194                                $forward = '/home.php';
195                        }
196                        else
197                        {
198                                list($forward,$extra_vars) = explode('?',$forward,2);
199                        }
200                        if ($GLOBALS['phpgw_info']['server']['use_https'] != 2)
201                        {
202                                $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes'));
203                                echo "<script language='Javascript1.3'>location.href='".$forward."'</script>";
204                        }
205                        else
206                        {
207                                $GLOBALS['phpgw']->redirect_link($forward,$extra_vars);
208                        }
209                }
210        }
211        //else   // =================================================================================
212        //{
213            $valor_contador = $_SESSION['contador'];
214            $valor_contador = $valor_contador + 1;
215            $_SESSION['contador'] = $valor_contador;
216                // !!! DONT CHANGE THESE LINES !!!
217                // If there is something wrong with this code TELL ME!
218                // Commenting out the code will not fix it. (jengo)
219                if(isset($_COOKIE['last_loginid']))
220                {
221                        $accounts = CreateObject('phpgwapi.accounts');
222                        $prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid']));
223
224                        if($prefs->account_id)
225                        {
226                                $GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository();
227                        }
228                }
229               
230                $_GET['lang'] = addslashes($_GET['lang']);
231                if ($_GET['lang'])
232                {
233                        $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $_GET['lang'];
234                }
235                elseif(!isset($_COOKIE['last_loginid']) || !$prefs->account_id)
236                {
237                        // If the lastloginid cookies isn't set, we will default to the first language,
238                        // the users browser accepts.
239                        list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
240                        /*
241                        if(strlen($lang) > 2)
242                        {
243                                $lang = substr($lang,0,2);
244                        }
245                        */
246                        $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
247                }
248                #print 'LANG:' . $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '<br>';
249
250                $GLOBALS['phpgw']->translation->init(); // this will set the language according to the (new) set prefs
251                $GLOBALS['phpgw']->translation->add_app('login');
252                $GLOBALS['phpgw']->translation->add_app('loginscreen');
253                if(lang('loginscreen_message') == 'loginscreen_message*')
254                {
255                        $GLOBALS['phpgw']->translation->add_app('loginscreen','en');    // trying the en one
256                }
257                if(lang('loginscreen_message') != 'loginscreen_message*')
258                {
259                        $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));
260                }
261        //}
262
263        if($GLOBALS['phpgw_info']['server']['use_prefix_organization'])
264        {
265                $obj_organization = CreateObject('phpgwapi.sector_search_ldap');
266                $organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
267               
268                for ($i=0; $i<count($organizations); $i++)
269                {
270                        $tmp_array[strtolower($organizations[$i])] = $organizations[$i];       
271                }
272               
273                $arrayOrganization = $tmp_array;               
274                ksort($arrayOrganization);
275               
276                foreach($arrayOrganization
277                         as $organization_name => $organization_vars)
278                {
279                        $organization_select .= '<option value="' . $organization_name . '"';
280
281                        if($organization_name == $_COOKIE['last_organization'])
282                        {
283                                $organization_select .= ' selected';
284                        }
285                        $organization_select .= '>' . $organization_vars . "</option>\n";
286                }
287                $organization_select =  '<div class="login_label"><label>'.lang("organization")
288                                                        .'</label><br><select name="organization">'
289                                                        .$organization_select.'</select></div>';
290                $tmpl->set_var('select_organization',$organization_select);
291        }
292               
293        $domain_select = '&nbsp;';
294        $last_loginid = $_COOKIE['last_loginid'];
295        if($GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
296        {
297                $domain_select = "<select name=\"logindomain\">\n";
298                foreach($GLOBALS['phpgw_domain'] as $domain_name => $domain_vars)
299                {
300                        $domain_select .= '<option value="' . $domain_name . '"';
301
302                        if($domain_name == $_COOKIE['last_domain'])
303                        {
304                                $domain_select .= ' selected';
305                        }
306                        $domain_select .= '>' . $domain_name . "</option>\n";
307                }
308                $domain_select .= "</select>\n";
309        }
310        elseif($last_loginid !== '')
311        {
312                reset($GLOBALS['phpgw_domain']);
313                list($default_domain) = each($GLOBALS['phpgw_domain']);
314
315                if($_COOKIE['last_domain'] != $default_domain && !empty($_COOKIE['last_domain']))
316                {
317                        $last_loginid .= '@' . $_COOKIE['last_domain'];
318                }
319        }
320        $tmpl->set_var('select_domain',$domain_select);
321
322        foreach($_GET as $name => $value)
323        {
324                if(ereg('phpgw_',$name))
325                {
326                        $extra_vars .= '&' . $name . '=' . urlencode($value);
327                }
328        }
329
330        if ( is_string( $extra_vars ) )
331        {
332                $extra_vars = '?' . substr($extra_vars,1);
333        }
334
335        /********************************************************\
336        * Check is the registration app is installed, activated  *
337        * And if the register link must be placed                *
338        \********************************************************/
339       
340        $cnf_reg = createobject('phpgwapi.config','registration');
341        $cnf_reg->read_repository();
342        $config_reg = $cnf_reg->config_data;
343
344        if($config_reg[enable_registration]=='True' && $config_reg[register_link]=='True')
345        {
346                $reg_link='&nbsp;<a href="registration/">'.lang('Not a user yet? Register now').'</a><br/>';
347        }
348
349        $GLOBALS['phpgw_info']['server']['template_set'] = $GLOBALS['phpgw_info']['login_template_set'];
350
351        $tmpl->set_var('register_link',$reg_link);
352        $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset());
353        $tmpl->set_var('login_url', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php' . $extra_vars);
354        $tmpl->set_var('registration_url',$GLOBALS['phpgw_info']['server']['webserver_url'] . '/registration/');
355        $tmpl->set_var('version',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
356        $tmpl->set_var('cd',check_logoutcode($_GET['cd']));
357        $tmpl->set_var('cookie',$last_loginid);
358
359        $tmpl->set_var('lang_username',lang('username'));
360        $tmpl->set_var('lang_password',lang('password'));
361        $tmpl->set_var('lang_login',lang('login'));
362
363        $tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']);
364        $tmpl->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']);
365
366        include_once(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php');
367        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao);
368
369        $GLOBALS['phpgw']->translation->add_app('loginhelp',$_GET['lang']);
370
371        if(lang('loginhelp_message') != 'loginhelp_message*' && trim(lang('loginhelp_message')) != ""){                                 
372                $tmpl->set_var('lang_help',lang("Help"));       
373        }
374        else
375                $tmpl->set_var('display_help','none');
376
377        $tmpl->set_var('bg_color',($GLOBALS['phpgw_info']['server']['login_bg_color']?$GLOBALS['phpgw_info']['server']['login_bg_color']:'FFFFFF'));
378        $tmpl->set_var('bg_color_title',($GLOBALS['phpgw_info']['server']['login_bg_color_title']?$GLOBALS['phpgw_info']['server']['login_bg_color_title']:'486591'));
379
380        if($GLOBALS['phpgw_info']['server']['use_frontend_name'])
381                $tmpl->set_var('frontend_name', " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name']);
382
383        if (substr($GLOBALS['phpgw_info']['server']['login_logo_file'],0,4) == 'http')
384        {
385                $var['logo_file'] = $GLOBALS['phpgw_info']['server']['login_logo_file'];
386        }
387        else
388        {
389                $var['logo_file'] = $GLOBALS['phpgw']->common->image('phpgwapi',$GLOBALS['phpgw_info']['server']['login_logo_file']?$GLOBALS['phpgw_info']['server']['login_logo_file']:'logo');
390        }
391        $var['logo_url'] = $GLOBALS['phpgw_info']['server']['login_logo_url']?$GLOBALS['phpgw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
392        if (substr($var['logo_url'],0,4) != 'http')
393        {
394                $var['logo_url'] = 'http://'.$var['logo_url'];
395        }
396        $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org';
397        $tmpl->set_var($var);
398
399        if (!@$GLOBALS['phpgw_info']['server']['login_virtual_keyboard'])
400                $tmpl->set_var('show_kbd','none');
401
402        if (@$GLOBALS['phpgw_info']['server']['login_show_language_selection'])
403        {
404                $select_lang = '<select name="lang" onchange="'."location.href=location.href+(location.search?'&':'?')+'lang='+this.value".'">';
405                $langs = $GLOBALS['phpgw']->translation->get_installed_langs();
406                uasort($langs,'strcasecmp');
407                foreach ($langs as $key => $name)       // if we have a translation use it
408                {
409                        $select_lang .= "\n\t".'<option value="'.$key.'"'.($key == $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ? ' selected="1"' : '').'>'.$name.'</option>';
410                }
411                $select_lang .= "\n</select>\n";
412                $tmpl->set_var(array(
413                        'lang_language' => lang('Language'),
414                        'select_language' => $select_lang,
415                ));
416        }
417        else
418        {
419                $tmpl->set_block('login_form','language_select');
420                $tmpl->set_var('language_select','');
421        }
422
423        $tmpl->set_var('autocomplete', ($GLOBALS['phpgw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : ''));
424// soh mostra o captcha se for login sem certificado....
425if($GLOBALS['phpgw_info']['server']['captcha'] && $_GET['cd']!='300' )
426    {
427        $aux_captcha = '<input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >';
428//        setcookie(session_name(),base64_encode(session_convert($key_convert . session_id(),$key_convert)),0);
429        if($valor_contador > $GLOBALS['phpgw_info']['server']['num_badlogin'])
430            {
431                $aux_captcha = '<div class="login_label" >
432                   <img src="./security/captcha.php?' . session_name() . '=' . session_id() . '" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="position:static;"><br/>
433                   <input class="input" type="text" maxlength="50" size="20" name="codigo" id="codigo" value="" >
434                   <input type="hidden" name="' . session_name() . '"  value="' . session_id() . '" >
435                   </div>';
436            }
437    }
438    $tmpl->set_var('captcha',$aux_captcha);
439// Testa se deve incluir applet para login com certificado......
440if ($_GET['cd']=='300' && $GLOBALS['phpgw_info']['server']['certificado']==1)
441        {
442                //Zera o Cookie contador, responsavel pelo captcha
443                $_SESSION['contador'] = 0;
444                $valor_contador = 0;
445                $link_alterna_login = '<img border=0 style="padding: 0px 5px 0px 0px" src="phpgwapi/templates/default/images/warning.gif"/><a href="login.php" style="margin: 0px; padding: 0px; text-decoration:none;"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="1">' . lang('Access without Digital Certificate') . '</a>';
446                $tmpl->set_var('show','none');
447                $tmpl->set_var('action','<div id="action"><img style="border:0px;margin:31px 0px 58px 0px;" src="phpgwapi/templates/default/images/acao.gif" /></div>');
448                // gera parametro com tokens suportados ....
449                $var_tokens = '';
450                for($ii = 1; $ii < 11; $ii++)
451                        {
452                                if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
453                                        $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
454                        }
455
456                if(!$var_tokens)
457                        {
458                                $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
459                        }
460                        $param1 = "
461                                                '<param name=\"token\" value=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\"> ' +
462                                               ";
463                        $param2 = "
464                                                'token=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\" ' +
465                                               ";
466                               
467                        $cod_applet =
468
469/*    // com debug ativado
470            '<script type="text/javascript">
471                                        if (navigator.userAgent.match(\'MSIE\')){
472                                                document.write(\'<object style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" \' +
473                                                \'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"> \' +
474                                                \'<param name="type" value="application/x-java-applet;version=1.5"> \' +
475                                                \'<param name="code" value="LoginApplet.class"> \' +
476                                                \'<param name="locale" value="' . $lang . '"> \' +
477                                                \'<param name="mayscript" value="true"> \' + '
478                                                . $param1
479                                                . ' \'<param name="archive" value="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar"> \' +
480                        \'<param name="debug" value="true"> \' +
481                                                \'</object>\');
482                                        }
483                                        else {
484                                                document.write(\'<embed style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" code="LoginApplet.class" locale="' . $lang . '"\' +
485                                                \'archive="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar" \' + '
486                                                . $param2
487                                                . ' \'type="application/x-java-applet;version=1.5" debug= "true" mayscript > \' +
488                                                \'<noembed> \' +
489                                                \'No Java Support. \' +
490                                                \'</noembed> \' +
491                                                \'</embed> \');
492                                        }
493                                </script>';
494*/
495            // sem debug ativado
496            '<script type="text/javascript">
497                                        if (navigator.userAgent.match(\'MSIE\')){
498                                                document.write(\'<object style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" \' +
499                                                \'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"> \' +
500                                                \'<param name="type" value="application/x-java-applet;version=1.5"> \' +
501                                                \'<param name="codebase" value="/security/">\' +
502                                                \'<param name="code" value="LoginApplet.class"> \' +
503                                                \'<param name="locale" value="' . $lang . '"> \' +
504                                                \'<param name="mayscript" value="true"> \' + '
505                                                . $param1
506                                                . ' \'<param name="archive" value="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar"> \' +
507                                                \'</object>\');
508                                        }
509                                        else {
510                                                document.write(\'<embed style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" codebase="/security/" code="LoginApplet.class" locale="' . $lang . '"\' +
511                                                \'archive="ExpressoCertLogin.jar,ExpressoCert.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.jar,commons-codec-1.3.jar,bcmail-jdk15-142.jar,mail.jar,activation.jar,bcprov-jdk15-142.jar" \' + '
512                                                . $param2 
513                                                . ' \'type="application/x-java-applet;version=1.5" mayscript > \' +
514                                                \'<noembed> \' +
515                                                \'No Java Support. \' +
516                                                \'</noembed> \' +
517                                                \'</embed> \');
518                                        }
519                                </script>';
520
521
522        }
523
524else
525        {
526                if($GLOBALS['phpgw_info']['server']['certificado']==1)
527                        {
528                                $tmpl->set_var('show','yes');
529                                $link_alterna_login = '<img border=0 style="padding: 0px" src="phpgwapi/templates/default/images/lock1_icon.gif"/><a title="' . lang('Link to use digital certificate') . '" href="login.php?cd=300" style="margin: 0px; padding: 0px; text-decoration:none;"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>' . lang('Logon with my digital certificate') . '</b></font></a>';
530                        }
531                        $tmpl->set_var('lang_username',lang('username'));
532                        $tmpl->set_var('action','');
533                        $cod_applet = '';
534
535                }
536
537                $tmpl->set_var('applet',$cod_applet);
538                $tmpl->set_var('link_alterna_login',$link_alterna_login);
539               
540
541        $tmpl->pfp('loginout','login_form');
542?>
543
Note: See TracBrowser for help on using the repository browser.