Changeset 8232 for branches/2.5/phpgwapi/templates/news/login_news.php
- Timestamp:
- 10/08/13 16:20:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/phpgwapi/templates/news/login_news.php
r7681 r8232 12 12 \**************************************************************************/ 13 13 14 function 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 $ifMobile = false; 61 $browser = CreateObject('phpgwapi.browser'); 62 switch ( $browser->get_platform() ) 63 { 64 case browser::PLATFORM_IPHONE: 65 case browser::PLATFORM_IPOD: 66 case browser::PLATFORM_IPAD: 67 case browser::PLATFORM_BLACKBERRY: 68 case browser::PLATFORM_NOKIA: 69 case browser::PLATFORM_ANDROID: 70 $ifMobile = true; 71 break; 72 } 73 74 if( $ifMobile && $_GET['dont_redirect_if_moble'] != 1 ) 75 { 76 $GLOBALS['phpgw']->redirect_link('/mobile/login.php'); 77 } 78 else 79 { 14 require_once "logout_code.php"; 15 80 16 /* Program starts here */ 81 17 if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) … … 94 30 # Apache + mod_ssl style SSL certificate authentication 95 31 # Certificate (chain) verification occurs inside mod_ssl 96 if( $GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd']))32 if( $GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd']) ) 97 33 { 98 34 # an X.509 subject looks like: … … 113 49 # login will be set here if the user logged out and uses a different username with 114 50 # the same SSL-certificate. 115 if( !isset($_POST['login'])&&isset($sslattributes['Email']))51 if( !isset($_POST['login']) && isset($sslattributes['Email']) ) 116 52 { 117 53 $login = $sslattributes['Email']; … … 127 63 if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) ) 128 64 { 129 $_SESSION['contador'] = 0; 130 } 131 132 if(isset($passwd_type) || $_POST['submitit_x'] || $_POST['submitit_y'] || $submit) 133 { 134 65 $_SESSION['contador_captcha'] = 0; 66 } 67 68 if( isset($passwd_type) || $_POST['submitit_x'] || $_POST['submitit_y'] || $submit ) 69 { 135 70 // Primeiro testa o captcha....se houver...... 136 if($GLOBALS['phpgw_info']['server']['captcha']==1) 137 { 138 if($_SESSION['contador'] > $GLOBALS['phpgw_info']['server']['num_badlogin']) 139 { 140 if ($_SESSION['CAPTCHAString'] != trim(strtoupper($_POST['codigo']))) 141 { 142 if(!$_GET['cd']) 143 { 144 $_GET['cd'] = '200'; 145 } 146 } 147 unset($_SESSION['CAPTCHAString']); 148 } 149 } 150 if($_POST['user']) { 151 if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) { 152 $common = CreateObject('phpgwapi.common'); 153 $ldap_conn = $common->ldapConnect(); 154 $justthese = array("uid"); 155 $filter="(&(phpgwAccountType=u)(uid=".$_POST['user']."))"; 156 $ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 157 $ldap_info = ldap_get_entries($ldap_conn, $ldap_search); 71 if( $GLOBALS['phpgw_info']['server']['captcha'] == 1 ) 72 { 73 if( $_SESSION['contador_captcha'] > $GLOBALS['phpgw_info']['server']['num_badlogin'] ) 74 { 75 if ($_SESSION['CAPTCHAString'] != trim(strtoupper($_POST['codigo']))) 76 { 77 if(!$_GET['cd']) 78 { 79 $_GET['cd'] = '200'; 80 } 81 } 82 83 unset($_SESSION['CAPTCHAString']); 84 } 85 } 86 87 if( $_POST['user'] ) 88 { 89 if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) 90 { 91 $common = CreateObject('phpgwapi.common'); 92 $ldap_conn = $common->ldapConnect(); 93 $justthese = array("uid"); 94 $filter = "(&(phpgwAccountType=u)(uid=".$_POST['user']."))"; 95 $ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 96 $ldap_info = ldap_get_entries($ldap_conn, $ldap_search); 97 158 98 ldap_close($ldap_conn); 159 if ($ldap_info['count'] != 0) { 99 100 if( $ldap_info['count'] != 0 ) 101 { 160 102 $_POST['login'] = $_POST['user']; 161 103 } 162 104 } 163 105 else 106 { 164 107 $_POST['login'] = $_POST['user']; 165 } 108 } 109 } 110 166 111 if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 167 112 !isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN'])) 168 113 { 169 170 171 172 114 if(!$_GET['cd']) 115 { 116 $_GET['cd'] = '5'; 117 } 173 118 } 174 119 175 120 // don't get login data again when $submit is true 176 if( $submit == false)121 if( $submit == false ) 177 122 { 178 123 $login = $_POST['login']; 179 124 } 180 125 181 if( strstr($login,'@') === False && isset($_POST['logindomain']))126 if( strstr($login,'@') === False && isset($_POST['logindomain']) ) 182 127 { 183 128 $login .= '@' . $_POST['logindomain']; … … 188 133 } 189 134 190 If(!$_GET['cd']) 135 if( !$_GET['cd'] ) 136 { 191 137 $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u'); 192 193 if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) 138 } 139 140 if( !isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'] ) 194 141 { 195 142 If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason; … … 197 144 else 198 145 { 199 if ($_POST['lang'] && preg_match('/^[a-z]{2}(-[a-z]{2}){0,1}$/',$_POST['lang']) &&200 $_POST['lang'] != $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] )146 if( $_POST['lang'] && preg_match('/^[a-z]{2}(-[a-z]{2}){0,1}$/',$_POST['lang']) && 147 $_POST['lang'] != $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ) 201 148 { 202 149 $GLOBALS['phpgw']->preferences->add('common','lang',$_POST['lang'],'session'); … … 207 154 $GLOBALS['phpgw']->translation->autoload_changed_langfiles(); 208 155 } 156 209 157 $forward = isset($_GET['phpgw_forward']) ? urldecode($_GET['phpgw_forward']) : @$_POST['phpgw_forward']; 210 if (!$forward) 158 159 if ( !$forward ) 211 160 { 212 161 $extra_vars['cd'] = 'yes'; … … 217 166 list($forward,$extra_vars) = explode('?',$forward,2); 218 167 } 219 if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) 220 { 221 //Modificacao feita para que o Expresso redirecione para o primeiro proxy caso haja um encadeamento de mais de um proxy. 222 //$forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); 223 $forward = 'http://' . nearest_to_me() . $GLOBALS['phpgw']->link($forward.'?cd=yes'); 224 echo "<script language='Javascript1.3'>location.href='".$forward."'</script>"; 225 } 226 else 227 { 228 $GLOBALS['phpgw']->redirect_link($forward,$extra_vars); 229 } 230 } 231 } 232 //else // ================================================================================= 233 //{ 234 $valor_contador = $_SESSION['contador']; 235 $valor_contador = $valor_contador + 1; 236 $_SESSION['contador'] = $valor_contador; 237 // !!! DONT CHANGE THESE LINES !!! 238 // If there is something wrong with this code TELL ME! 239 // Commenting out the code will not fix it. (jengo) 240 if(isset($_COOKIE['last_loginid'])) 241 { 242 $accounts = CreateObject('phpgwapi.accounts'); 243 $prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid'])); 244 245 if($prefs->account_id) 246 { 247 $GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository(); 248 } 249 } 250 251 $_GET['lang'] = addslashes($_GET['lang']); 252 if ($_GET['lang']) 253 { 254 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $_GET['lang']; 255 } 256 elseif(!isset($_COOKIE['last_loginid']) || !$prefs->account_id) 257 { 258 // If the lastloginid cookies isn't set, we will default to the first language, 259 // the users browser accepts. 260 list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); 261 /* 262 if(strlen($lang) > 2) 263 { 264 $lang = substr($lang,0,2); 265 } 266 */ 267 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang; 268 } 269 #print 'LANG:' . $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '<br>'; 270 271 $GLOBALS['phpgw']->translation->init(); // this will set the language according to the (new) set prefs 272 $GLOBALS['phpgw']->translation->add_app('login'); 273 $GLOBALS['phpgw']->translation->add_app('loginscreen'); 274 if(lang('loginscreen_message') == 'loginscreen_message*') 275 { 276 $GLOBALS['phpgw']->translation->add_app('loginscreen','en'); // trying the en one 277 } 278 if(lang('loginscreen_message') != 'loginscreen_message*') 279 { 280 $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message'))); 281 } 282 //} 283 284 if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) 285 { 168 169 if( $GLOBALS['phpgw_info']['server']['use_https'] != 2 ) 170 { 171 //Modificacao feita para que o Expresso redirecione para o primeiro proxy caso haja um encadeamento de mais de um proxy. 172 //$forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); 173 $forward = 'http://' . nearest_to_me() . $GLOBALS['phpgw']->link($forward.'?cd=yes'); 174 echo "<script language='Javascript1.3'>location.href='".$forward."'</script>"; 175 } 176 else 177 { 178 $GLOBALS['phpgw']->redirect_link($forward,$extra_vars); 179 } 180 } 181 } 182 183 // Incrementar Contador para o Uso do Captcha 184 $_SESSION['contador_captcha']++; 185 186 // !!! DONT CHANGE THESE LINES !!! 187 // If there is something wrong with this code TELL ME! 188 // Commenting out the code will not fix it. (jengo) 189 if( isset( $_COOKIE['last_loginid'] ) ) 190 { 191 $accounts = CreateObject('phpgwapi.accounts'); 192 193 $prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid'])); 194 195 if($prefs->account_id) 196 { 197 $GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository(); 198 } 199 } 200 201 $_GET['lang'] = addslashes($_GET['lang']); 202 203 if ($_GET['lang']) 204 { 205 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $_GET['lang']; 206 } 207 elseif(!isset($_COOKIE['last_loginid']) || !$prefs->account_id) 208 { 209 // If the lastloginid cookies isn't set, we will default to the first language, 210 // the users browser accepts. 211 list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); 212 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang; 213 } 214 215 $GLOBALS['phpgw']->translation->init(); // this will set the language according to the (new) set prefs 216 $GLOBALS['phpgw']->translation->add_app('login'); 217 $GLOBALS['phpgw']->translation->add_app('loginscreen'); 218 219 // OUs LDAP 220 $show_Organization = "none"; 221 222 if( $GLOBALS['phpgw_info']['server']['use_prefix_organization'] ) 223 { 224 $show_Organization = "block"; 225 286 226 $obj_organization = CreateObject('phpgwapi.sector_search_ldap'); 227 287 228 $organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']); 288 289 $organizations_count = count($organizations); 290 for ($i=0; $i<$organizations_count; ++$i) 229 230 for ($i=0; $i<count($organizations); $i++) 291 231 { 292 232 $tmp_array[strtolower($organizations[$i])] = $organizations[$i]; … … 294 234 295 235 $arrayOrganization = $tmp_array; 236 296 237 ksort($arrayOrganization); 297 238 298 foreach($arrayOrganization 299 as $organization_name => $organization_vars) 239 foreach($arrayOrganization as $organization_name => $organization_vars) 300 240 { 301 241 $organization_select .= '<option value="' . $organization_name . '"'; 302 242 303 if( $organization_name == $_COOKIE['last_organization'])243 if( $organization_name == $_COOKIE['last_organization'] ) 304 244 { 305 245 $organization_select .= ' selected'; … … 307 247 $organization_select .= '>' . $organization_vars . "</option>\n"; 308 248 } 309 $organization_select = '<div class="login_label"><label>'.lang("organization") 310 .'</label><br><select name="organization">' 311 .$organization_select.'</select></div>'; 249 312 250 $tmpl->set_var('select_organization',$organization_select); 313 251 } 252 253 $tmpl->set_var( 'show_organization', $show_Organization ); 314 254 315 255 $domain_select = ' '; 256 316 257 $last_loginid = $_COOKIE['last_loginid']; 317 if($GLOBALS['phpgw_info']['server']['show_domain_selectbox']) 258 259 if( $GLOBALS['phpgw_info']['server']['show_domain_selectbox'] ) 318 260 { 319 261 $domain_select = "<select name=\"logindomain\">\n"; 262 320 263 foreach($GLOBALS['phpgw_domain'] as $domain_name => $domain_vars) 321 264 { … … 333 276 { 334 277 reset($GLOBALS['phpgw_domain']); 278 335 279 list($default_domain) = each($GLOBALS['phpgw_domain']); 336 280 … … 340 284 } 341 285 } 286 342 287 $tmpl->set_var('select_domain',$domain_select); 343 288 344 foreach($_GET as $name => $value)345 { 346 if( preg_match('/phpgw_/',$name))289 foreach($_GET as $name => $value) 290 { 291 if(ereg('phpgw_',$name)) 347 292 { 348 293 $extra_vars .= '&' . $name . '=' . urlencode($value); … … 350 295 } 351 296 352 if 297 if( is_string( $extra_vars ) ) 353 298 { 354 299 $extra_vars = '?' . substr($extra_vars,1); … … 364 309 $config_reg = $cnf_reg->config_data; 365 310 366 if($config_reg[ 'enable_registration']=='True' && $config_reg['register_link']=='True')311 if($config_reg[enable_registration]=='True' && $config_reg[register_link]=='True') 367 312 { 368 313 $reg_link=' <a href="registration/">'.lang('Not a user yet? Register now').'</a><br/>'; … … 370 315 371 316 $template = $GLOBALS['phpgw_info']['login_template_set']; 317 372 318 $GLOBALS['phpgw_info']['server']['template_set'] = $template; 373 319 … … 387 333 $tmpl->set_var('template_set', $template); 388 334 389 // loads the template's login.css 390 // and then the theme's login.css (if any) 391 $template_dir = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/' . $template; 392 $login_dir = $template_dir . '/login.css'; 393 $login_css = "<link href='" . $login_dir . "' rel='stylesheet' type='text/css' />"; 394 $login_dir = $template_dir . '/themes/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '/login.css'; 395 if(file_exists('./'.$login_dir)) 396 { 397 $login_css .= "<link href='" . $login_dir . "' rel='stylesheet' type='text/css' />"; 398 } 399 $tmpl->set_var('login_css',$login_css); 400 401 $GLOBALS['phpgw']->translation->add_app('loginhelp',$_GET['lang']); 402 403 if(lang('loginhelp_message') != 'loginhelp_message*' && trim(lang('loginhelp_message')) != ""){ 404 $tmpl->set_var('lang_help',lang("Help")); 405 } 406 else 407 $tmpl->set_var('display_help','none'); 408 409 $tmpl->set_var('bg_color',($GLOBALS['phpgw_info']['server']['login_bg_color']?$GLOBALS['phpgw_info']['server']['login_bg_color']:'FFFFFF')); 410 $tmpl->set_var('bg_color_title',($GLOBALS['phpgw_info']['server']['login_bg_color_title']?$GLOBALS['phpgw_info']['server']['login_bg_color_title']:'486591')); 411 412 if($GLOBALS['phpgw_info']['server']['use_frontend_name']) 413 $tmpl->set_var('frontend_name', " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name']); 414 415 if (substr($GLOBALS['phpgw_info']['server']['login_logo_file'],0,4) == 'http') 416 { 417 $var['logo_file'] = $GLOBALS['phpgw_info']['server']['login_logo_file']; 418 } 419 else 420 { 421 $var['logo_file'] = $GLOBALS['phpgw']->common->image('phpgwapi',$GLOBALS['phpgw_info']['server']['login_logo_file']?$GLOBALS['phpgw_info']['server']['login_logo_file']:'logo'); 422 } 423 $var['logo_url'] = $GLOBALS['phpgw_info']['server']['login_logo_url']?$GLOBALS['phpgw_info']['server']['login_logo_url']:'http://www.eGroupWare.org'; 424 if (substr($var['logo_url'],0,4) != 'http') 425 { 426 $var['logo_url'] = 'http://'.$var['logo_url']; 427 } 428 $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org'; 429 $tmpl->set_var($var); 430 431 if (!@$GLOBALS['phpgw_info']['server']['login_virtual_keyboard']) 432 $tmpl->set_var('show_kbd','none'); 433 434 if (@$GLOBALS['phpgw_info']['server']['login_show_language_selection']) 435 { 436 $select_lang = '<select name="lang" onchange="'."location.href=location.href+(location.search?'&':'?')+'lang='+this.value".'">'; 437 $langs = $GLOBALS['phpgw']->translation->get_installed_langs(); 438 uasort($langs,'strcasecmp'); 439 foreach ($langs as $key => $name) // if we have a translation use it 440 { 441 $select_lang .= "\n\t".'<option value="'.$key.'"'.($key == $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ? ' selected="1"' : '').'>'.$name.'</option>'; 442 } 443 $select_lang .= "\n</select>\n"; 444 $tmpl->set_var(array( 445 'lang_language' => lang('Language'), 446 'select_language' => $select_lang, 447 )); 448 } 449 else 450 { 451 $tmpl->set_block('login_form','language_select'); 452 $tmpl->set_var('language_select',''); 453 } 335 // Keyboard Virtual 336 $tmpl->set_var('show_kbd',$GLOBALS['phpgw_info']['server']['login_virtual_keyboard']); 454 337 455 338 $tmpl->set_var('autocomplete', ($GLOBALS['phpgw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : '')); … … 458 341 if($GLOBALS['phpgw_info']['server']['captcha'] && $_GET['cd']!='300' ) 459 342 { 460 $aux_captcha = '<input type="hidden" name="' . session_name() . '" value="' . session_id() . '" >'; 461 // setcookie(session_name(),base64_encode(session_convert($key_convert . session_id(),$key_convert)),0); 462 if($valor_contador > $GLOBALS['phpgw_info']['server']['num_badlogin']) 463 { 464 $aux_captcha = '<div class="login_label" > 465 <img id="id_captcha" src="./security/captcha.php?' . session_name() . '=' . session_id() . '" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="position:static;"> 466 <input class="input" type="text" maxlength="50" size="20" name="codigo" id="codigo" value="" > 467 <input type="hidden" name="' . session_name() . '" value="' . session_id() . '" > 468 </div>'; 469 } 470 } 471 $tmpl->set_var('captcha',$aux_captcha); 343 $aux_captcha = '<input type="hidden" name="'.session_name().'" value="'.session_id().'">'; 344 345 if( $_SESSION['contador_captcha'] > $GLOBALS['phpgw_info']['server']['num_badlogin'] ) 346 { 347 $aux_captcha = '<div>' 348 .'<img id="id_captcha" src="./security/captcha.php?' . session_name() . '=' . session_id() . '" title="'.lang('Security code').'" alt="'.lang('Security code').'" style="position:static;">' 349 .'<input class="input" type="text" maxlength="50" size="15" name="codigo" id="codigo" value="" >' 350 .'<input type="hidden" name="' . session_name() . '" value="' . session_id() . '" >' 351 .'</div>'; 352 } 353 354 $tmpl->set_var('captcha',$aux_captcha); 355 } 472 356 473 357 // Testa se deve incluir applet para login com certificado...... 474 if ( $_GET['cd']=='300' && $GLOBALS['phpgw_info']['server']['certificado']==1)358 if ( $_GET['cd']=='300' && $GLOBALS['phpgw_info']['server']['certificado'] == 1 ) 475 359 { 476 360 //Zera o Cookie contador, responsavel pelo captcha 477 $_SESSION['contador'] = 0; 478 $valor_contador = 0; 479 $link_alterna_login = '<img src="phpgwapi/templates/news/images/warning.gif"/><a href="login.php">' . lang('Access without Digital Certificate') . '</a>'; 361 $_SESSION['contador_captcha'] = 0; 362 $link_alterna_login = '<img src="phpgwapi/templates/default/images/warning.gif"/><a href="login.php">' . lang('Access without Digital Certificate') . '</a>'; 480 363 $tmpl->set_var('show','none'); 481 $tmpl->set_var('action','<div id="action"><img style="border:0px;margin:31px 0px 58px 0px;" src="phpgwapi/templates/ news/images/acao.gif" /></div>');364 $tmpl->set_var('action','<div id="action"><img style="border:0px;margin:31px 0px 58px 0px;" src="phpgwapi/templates/default/images/acao.gif" /></div>'); 482 365 // gera parametro com tokens suportados .... 483 366 $var_tokens = ''; 484 for($ii = 1; $ii < 11; ++$ii) 367 368 for($ii = 1; $ii < 11; $ii++) 485 369 { 486 370 if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1']) … … 492 376 $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll'; 493 377 } 494 $param1 = " 495 '<param name=\"token\" value=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\"> ' + 496 "; 497 $param2 = " 498 'token=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\" ' + 499 "; 378 379 $param1 = "'<param name=\"token\" value=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\">'+"; 380 $param2 = "'token=\"" . substr($var_tokens,0,strlen($var_tokens)) . "\" ' +"; 500 381 501 382 $cod_applet = 502 503 /* // com debug ativado504 '<script type="text/javascript">505 if (navigator.userAgent.match(\'MSIE\')){506 document.write(\'<object style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" \' +507 \'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"> \' +508 \'<param name="type" value="application/x-java-applet;version=1.5"> \' +509 \'<param name="code" value="LoginApplet.class"> \' +510 \'<param name="locale" value="' . $lang . '"> \' +511 \'<param name="mayscript" value="true"> \' + '512 . $param1513 . ' \'<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"> \' +514 \'<param name="debug" value="true"> \' +515 \'</object>\');516 }517 else {518 document.write(\'<embed style="display:yes;width:0;height:0;vertical-align:bottom;" id="login_applet" code="LoginApplet.class" locale="' . $lang . '"\' +519 \'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" \' + '520 . $param2521 . ' \'type="application/x-java-applet;version=1.5" debug= "true" mayscript > \' +522 \'<noembed> \' +523 \'No Java Support. \' +524 \'</noembed> \' +525 \'</embed> \');526 }527 </script>';528 */529 383 // sem debug ativado 530 384 '<script type="text/javascript"> … … 553 407 </script>'; 554 408 555 556 } 557 409 } 558 410 else 559 411 { … … 561 413 { 562 414 $tmpl->set_var('show','yes'); 563 $link_alterna_login = '<img src="phpgwapi/templates/ news/images/lock1_icon.gif"/><a title="' . lang('Link to use digital certificate') . '" href="login.php?cd=300">' . lang('Logon with my digital certificate') . '</a>';415 $link_alterna_login = '<img src="phpgwapi/templates/default/images/lock1_icon.gif"/><a title="' . lang('Link to use digital certificate') . '" href="login.php?cd=300">' . lang('Logon with my digital certificate') . '</a>'; 564 416 } 565 417 $tmpl->set_var('lang_username',lang('username')); 566 418 $tmpl->set_var('action',''); 567 419 $cod_applet = ''; 568 569 420 } 570 421 571 422 $tmpl->set_var('applet',$cod_applet); 572 423 $tmpl->set_var('link_alterna_login',$link_alterna_login); 573 574 // Load News from NewsAdmin module - BEGIN 575 define('PHPGW_TEMPLATE_DIR','./phpgwapi/templates/'.$GLOBALS['phpgw_info']['login_template_set']); 576 $news = CreateObject('news_admin.uinews'); 577 $public_news = $news->bo->get_all_public_news(); 578 rsort($public_news); 579 $newslist = array(); 580 foreach($public_news as $i => $news){ 581 $newslist[] = array_map('utf8_encode', $news); 582 } 583 $tmpl->set_var('public_news',json_encode($newslist)); 584 $tmpl->set_var('lang_previous',lang('Previous')); 585 $tmpl->set_var('lang_next',lang('Next')); 586 $tmpl->set_var('lang_pause',lang('Pause')); 587 $tmpl->set_var('lang_resume',lang('Resume')); 588 589 // Load News from NewsAdmin module - END 590 424 591 425 $tmpl->set_var('dir_root', 'http://' . nearest_to_me() . '/'); 592 426 if(is_file(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php')) … … 594 428 if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 595 429 596 // Adiciona c ódigo personalizado de outro template430 // Adiciona código personalizado de outro template 597 431 // que esteja utilizando o login_default.php 598 if(is_file('.'.$template_dir.'/login.inc.php')) { 432 if(is_file('.'.$template_dir.'/login.inc.php')) 433 { 599 434 include_once('.'.$template_dir.'/login.inc.php'); 600 435 } 601 436 602 437 $tmpl->pfp('loginout','login_form'); 603 }604 438 605 439 ?> 606
Note: See TracChangeset
for help on using the changeset viewer.