[2] | 1 | <?php |
---|
[1042] | 2 | //Valida a existencia do cookie, antes de grava-lo |
---|
| 3 | if(isset($_COOKIE['contador'])) { |
---|
| 4 | $valor_cookie = $_COOKIE['contador']; |
---|
[1734] | 5 | if( isset( $_POST['user'] ) && isset( $_POST['passwd'] ) ) |
---|
[1042] | 6 | { |
---|
| 7 | $valor_cookie = $valor_cookie + 1; |
---|
| 8 | setcookie("contador", $valor_cookie,0); |
---|
| 9 | } |
---|
| 10 | } |
---|
| 11 | //Cookie inexistente: tenta gravar um |
---|
| 12 | else |
---|
| 13 | { |
---|
| 14 | if (setcookie("contador", 1,0)) |
---|
| 15 | //echo "OK, cookie gravado."; |
---|
| 16 | $valor_cookie = 1; |
---|
| 17 | else |
---|
| 18 | //echo "Nao gravou o cookie"; |
---|
| 19 | $valor_cookie = "9999"; // forca captcha |
---|
| 20 | } |
---|
| 21 | // logout, inicia contador novamente..... |
---|
[1734] | 22 | if( ( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) ) || ( isset( $_COOKIE['sessionid'] ) ) ) |
---|
[1042] | 23 | { |
---|
| 24 | $valor_cookie = 1; |
---|
| 25 | setcookie("contador", 1,0); |
---|
| 26 | } |
---|
| 27 | |
---|
[2] | 28 | /**************************************************************************\ |
---|
| 29 | * eGroupWare login * |
---|
| 30 | * http://www.egroupware.org * |
---|
| 31 | * Originaly written by Dan Kuykendall <seek3r@phpgroupware.org> * |
---|
| 32 | * Joseph Engo <jengo@phpgroupware.org> * |
---|
[25] | 33 | * Updated by Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br> * |
---|
[2] | 34 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 35 | * under the terms of the GNU General Public License as published by the * |
---|
| 36 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 37 | * option) any later version. * |
---|
| 38 | \**************************************************************************/ |
---|
| 39 | |
---|
| 40 | $phpgw_info = array(); |
---|
| 41 | $submit = False; // set to some initial value |
---|
| 42 | |
---|
| 43 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
| 44 | 'disable_Template_class' => True, |
---|
| 45 | 'login' => True, |
---|
| 46 | 'currentapp' => 'login', |
---|
| 47 | 'noheader' => True |
---|
| 48 | ); |
---|
| 49 | |
---|
| 50 | if(file_exists('./header.inc.php')) |
---|
| 51 | { |
---|
| 52 | include('./header.inc.php'); |
---|
[219] | 53 | // Force location to home, while logged in. |
---|
[222] | 54 | $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; |
---|
| 55 | if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10) |
---|
[219] | 56 | $GLOBALS['phpgw']->redirect_link('/home.php'); |
---|
[2] | 57 | if ($GLOBALS['phpgw_info']['server']['use_https'] > 0) |
---|
| 58 | { |
---|
| 59 | if ($_SERVER['HTTPS'] != 'on') |
---|
| 60 | { |
---|
| 61 | Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
---|
| 62 | exit; |
---|
| 63 | } |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | if(function_exists('CreateObject')) |
---|
| 67 | { |
---|
| 68 | $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions'); |
---|
| 69 | } |
---|
| 70 | else |
---|
| 71 | { |
---|
| 72 | Header('Location: setup/index.php'); |
---|
| 73 | exit; |
---|
| 74 | } |
---|
| 75 | } |
---|
| 76 | else |
---|
| 77 | { |
---|
| 78 | Header('Location: setup/index.php'); |
---|
| 79 | exit; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set']; |
---|
| 83 | $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); |
---|
| 84 | |
---|
| 85 | // read the images from the login-template-set, not the (maybe not even set) users template-set |
---|
| 86 | $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; |
---|
| 87 | |
---|
| 88 | // This is used for system downtime, to prevent new logins. |
---|
| 89 | if($GLOBALS['phpgw_info']['server']['deny_all_logins']) |
---|
| 90 | { |
---|
| 91 | $deny_msg=lang('Oops! You caught us in the middle of system maintainance.<br/> |
---|
| 92 | Please, check back with us shortly.'); |
---|
| 93 | |
---|
| 94 | $tmpl->set_file(array |
---|
| 95 | ( |
---|
| 96 | 'login_form' => 'login_denylogin.tpl' |
---|
| 97 | )); |
---|
| 98 | |
---|
| 99 | $tmpl->set_var('template_set','default'); |
---|
| 100 | $tmpl->set_var('deny_msg',$deny_msg); |
---|
| 101 | $tmpl->pfp('loginout','login_form'); |
---|
| 102 | exit; |
---|
| 103 | } |
---|
| 104 | $tmpl->set_file(array('login_form' => 'login.tpl')); |
---|
[1117] | 105 | |
---|
| 106 | $tmpl->set_var('template',$GLOBALS['phpgw_info']['login_template_set']); |
---|
[1118] | 107 | $tmpl->set_var('lang',$_GET['lang']?$_GET['lang']:preg_replace("/\,.*/","",$GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE'])); |
---|
| 108 | |
---|
[1085] | 109 | if (count($GLOBALS['phpgw_info']['server']['login_logo_file']) > 0) |
---|
| 110 | $tmpl->set_var('logo_config',$GLOBALS['phpgw_info']['server']['login_logo_file']); |
---|
| 111 | else |
---|
[1742] | 112 | $tmpl->set_var('logo_config','<a title="Governo do Paraná" href="http://www.pr.gov.br" target="_blank"><img src="phpgwapi/templates/'.$GLOBALS['phpgw_info']['login_template_set'].'/images/logo_governo.gif" border="0"></a></td> |
---|
[1111] | 113 | <td><div align="center"><font color="#9a9a9a" face="Verdana, Arial, Helvetica, sans-serif" size="1"> |
---|
| 114 | <a title="Celepar Informática do Paraná" target="_blank" href="http://www.celepar.pr.gov.br/"> |
---|
[1742] | 115 | <img src="phpgwapi/templates/'.$GLOBALS['phpgw_info']['login_template_set'].'/images/logo_celepar.gif" border="0"></a>'); |
---|
[2] | 116 | // !! NOTE !! |
---|
| 117 | // Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file. |
---|
| 118 | // If there is a problem, tell me and I will fix it. (jengo) |
---|
| 119 | |
---|
| 120 | // whoooo scaring |
---|
| 121 | |
---|
[25] | 122 | // ServerID => Identify the Apache Frontend. |
---|
| 123 | if($GLOBALS['phpgw_info']['server']['usecookies'] == True && $GLOBALS['phpgw_info']['server']['use_frontend_id']) |
---|
[2] | 124 | { |
---|
[25] | 125 | $GLOBALS['phpgw']->session->phpgw_setcookie('serverID', $GLOBALS['phpgw_info']['server']['use_frontend_id']); |
---|
[2] | 126 | } |
---|
| 127 | |
---|
[1681] | 128 | include(personalize_include_path('phpgwapi','login')); |
---|
[2] | 129 | ?> |
---|
[1042] | 130 | |
---|