/branches/assicurazioniesinistri/gui/_Login.php
PHP | 146 lines | 131 code | 13 blank | 2 comment | 23 complexity | d0f931df39bcd09173cf86550593abc4 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, GPL-3.0
- <?php
- include_once("../config/config.inc.php");
- include_once("../include/Design/Design.class.php");
- include_once("../include/Date/Date.class.php");
- if (isset($_SESSION['User'])){
- header('Location:_LoginOperations.php?operation=logout');
- exit;
- }
- $Design = new Design();
- $Design->addJs(array('../js/jquery/jquery.min.js'));
- $Design->setBodyTag('
- <body style="background-image:none;">');
- $Design->privateHtmlOpen();
- if (stristr($_SERVER['HTTP_USER_AGENT'], "Mozilla") && stristr($_SERVER['HTTP_USER_AGENT'], "compatible")){
- // do nothing
- }
- else {
- echo '
- <script type="text/javascript">
- <!--
- function submitLoginForm(formId){
- if ($(\'#User__userName\').val()==\'\')
- alert(\'Attenzione! Inserire uno username valido.\');
- else
- $(\'#\'+formId).submit();
- return false;
- }
- function submitByEnter(formId, e) {
- var keycode;
- if (window.event) keycode = window.event.keyCode;
- else if (e) keycode = e.which;
- else return true;
- if (keycode == 13){
- submitLoginForm(formId);
- return false;
- }
- else
- return true;
- }
- //-->
- </script>';
- }
- echo '
- <br/><br/><br/><br/>
- <div id="login_div" class="form_div">';
- if (stristr($_SERVER['HTTP_USER_AGENT'], "Mozilla") && stristr($_SERVER['HTTP_USER_AGENT'], "compatible")){
- echo '
- <form action="_LoginOperations.php" method="post" name="form" id="form_Login">';
- }
- else
- echo '
- <form action="_LoginOperations.php" method="post" name="form" id="form_Login" onkeypress="submitByEnter(\'form_Login\', event)">';
- echo '
- <input type="hidden" name="operation" value="login">
- <div id="login_label">
- Login
- </div>
- <div class="align_right">
- <label for="User__userName">Username</label>
- <input class="input_text" type="text" name="User__userName" id="User__userName" maxlength="50" size="15"/>
- </div>
- <div class="align_right">
- <label id="User__password_label" for="User__userPassword">Password </label>
- <input class="input_text" type="password" name="User__userPassword" id="User__userPassword" maxlength="50" size="15"/>
- </div>
- <div class="align_right margin_top_5">';
-
- if (stristr($_SERVER['HTTP_USER_AGENT'], "Mozilla") && stristr($_SERVER['HTTP_USER_AGENT'], "compatible")){
- echo '
- <button type="submit">
- <img src="../img/icons/nuvola/16x16/actions/button_ok.png" alt="OK" width="16" height="16" />
- <span>Entra</span>
- </button>';
- }
- else
- echo '
- <a href="#" onclick="submitLoginForm(\'form_Login\');" title="Entra." class="button">
- <img src="../img/icons/nuvola/16x16/actions/button_ok.png" alt="OK" width="16" height="16" />
- <span>Entra</span>
- </a>';
- echo '
- </div>
- </form>
- </div>
- <br/>';
- $handle = fopen("../.svn/entries", "rb");
- $counter=0;
- while (($buffer = fgets($handle, 4096)) !== false) {
- $counter++;
- if ($counter==10){
- $Date = new Date();
- $Date->data_timestamp(substr($buffer, 0, 10));
- $svnVersionDate=$Date->trasformaData('d/m/Y');
- $svnVersionTime=substr($buffer, 11, 8);
- }
- if ($counter==11){
- $svnVersionNumber=$buffer;
- break;
- }
- }
- fclose($handle);
-
- echo '<div class="font10 align_center margin3">Version <b>'.$svnVersionNumber.'</b><br/><i class="colorgray">'.$svnVersionDate.' '.$svnVersionTime.'</i></div>';
-
- echo '
- <br/>
- ';
- // echo $_SERVER['HTTP_USER_AGENT'];
- if (stristr($_SERVER['HTTP_USER_AGENT'], "Mozilla") && stristr($_SERVER['HTTP_USER_AGENT'], "compatible")){
- echo '
- <div style="width:500px;border:1px solid red;color:red;background-color:#FFFBAD;margin:auto;padding:5px;font-size:12px;">
- Per l\'utilizzo di questa web application consigliamo caldamente il <b>Browser Mozilla Firefox</b> più affidabile e sicuro di Microsoft Internet Explorer.
- Mozilla Firefox è scaricabile gratuitamente da qui » <b><a target="_blank" href="http://www.mozilla-europe.org/it/firefox/" title="Scarica ora Firefox è gratuito e facile da installare">Browser Firefox</a></b>
- <br/>
- Per stampare i moduli e i documenti è necessario <b>Adobe Reader</b> scaricabile gratuitamente da qui » <b><a target="_blank" href="http://www.adobe.com/it/products/acrobat/readstep2.html" title="Scarica ora Adobe Reader è gratuito e facile da installare">Adobe Reader</a></b>
- </div>';
- }
- if ($_REQUEST['message']=='loginError'){
- echo "<script>alert('Attenzione! Utente o password errati.');</script>";
- }
- if ($_REQUEST['message']=='userNotPresent'){
- echo "<script>alert('Attenzione! Utente o password errati.');</script>";
- }
- else if ($_REQUEST['message']=='intrusion'){
- echo "<script>alert('Attenzione! Non si hanno le autorizzazioni necessarie per accedere al modulo selezionato. Rieseguire il login.');</script>";
- }
- else if ($_REQUEST['message']=='timeout'){
- echo "<script>alert('Attenzione! Sessione scaduta per prolungata inattivita\'. Rieseguire il login.');</script>";
- }
- else if (isset($_REQUEST['message'])){
- echo "<script>alert(unescape('$_REQUEST[message]'));</script>";
- }
- $Design->privateHtmlClose($noswitch=1);
- ?>