DATE_ADD(CURRENT_DATE, INTERVAL -1 DAY)) "; $qryCheckCookie = mysql_db_query($nomedb, $sql, $id_link) or muori ("cerca session",$sql,1); $nrowsCheckCookie = mysql_num_rows($qryCheckCookie); //Se la session non corrisponde con quella nel db oppure è scaduta annulla il cookie if($nrowsCheckCookie != 1){ $msg_err = "Si è verificato un errore
Siete pregati di effettuare nuovamente il login"; /*header("Location: index.php?msg_err=errore1"); exit;*/ //mettiCookie2($id_cliente,$tabella); return false; } //Preleva ID del utente else { $row = mysql_fetch_array($qryCheckCookie); //$id_session = $row["id_session"]; $id_utente = $row["id_".$tabella_utenti]; return $id_utente; } }else{//Non esiste una session quindi ridireziona alla pagina di login $msg_err = "Si è verificato un errore
Siete pregati di effettuare nuovamente il login"; /*header("Location: index.php?msg=errore2"); exit;*/ //mettiCookie2($id_cliente,$tabella); return false; } } //andare nel cookie /* vedere il num di sessione andare nella tabella sessione vedere se giusto controllare che permesso ha a questo deve vedere se la pagina visitata è visibile da quel utente */ function login($login,$password,$tabella="utente",$tabella_session = "session"){ extract($GLOBALS); $proceed = FALSE; //Verifica variabili passate $login = addslashes(substr(trim($login), 0, 50)); $passwd = addslashes(substr(trim($password), 0, 50)); if(($login != "") && ($passwd != "")) $proceed = TRUE; if($proceed): $sql = "SELECT * FROM $tabella WHERE username = '$login' AND password = '$passwd' AND (status ='on')"; $qryLogin = mysql_db_query($nomedb, $sql, $id_link) or muori ("errore login",$sql,1); $nrowsQryLogin = mysql_num_rows($qryLogin); if($nrowsQryLogin == 0): $proceed = FALSE; $msg_err = "nome utente o password errati"; return false; // exit; else: if($nrowsQryLogin > 0): $row = mysql_fetch_array($qryLogin); if($row['status']=='on'): $id_cliente = $row["id_$tabella"]; $nome = $row["nome"]; $cognome = $row["cognome"]; else: $proceed = FALSE; $msg_err = "utente non abilitato"; return false; endif; endif; $msg_err = "$id_cliente, $nome, $cognome, $proceed"; endif;//query ricerca utente da nome e pwd else: $msg_err = "nome utente o password vuoti"; return false; // exit; endif; if($proceed): if(mettiCookie($id_cliente,$tabella_session,$tabella)): return $id_cliente; else: return false; endif; else: $msg_err = "Si è verificato un errore! ripetere la procedura"; return false; // exit; endif; } function mettiCookie($id_cliente="",$tabella="session",$tabella_utenti = "utenti"){ extract($GLOBALS); $session = md5(uniqid(rand()));//valore casuale //Set il cookie fino alla chiusura del browser //echo"$session"; setcookie("session", "{$session}", time() + 3600); /*if ($tmp != 'off'): $tmp = 'on'; $sql = "INSERT INTO `clienti_tmp` (`data_iscrizione`,`note`,`status`) VALUES (NOW(),'Accesso al sito','on') "; $qryUpdateAccess = mysql_db_query($nomedb, $sql, $id_link) or die ("QUERY ERROR INSERT TMP CLIENTE"); $id_cliente = mysql_insert_id($id_link); //else: endif;*/ /**/ //Elimina eventuali session identiche dal db, quelle scadute e quelle dello stesso cliente $sql = "DELETE FROM $tabella WHERE (id_$tabella = '$session') OR (quando < DATE_ADD(CURRENT_DATE,INTERVAL -1 DAY))OR (id_$tabella_utenti = '$id_cliente')"; $qryDeleteOldSession = mysql_db_query($nomedb, $sql, $id_link) or muori ("clean session",$sql,1); /* SCRIVE NELLA SESSIONE I PERMESSI E IL COOKIE */ $sql = "SELECT id_$tabella FROM $tabella WHERE (id_$tabella = '$id_cliente')"; $qryCheckCookie = mysql_db_query($nomedb, $sql, $id_link) or muori ("get session",$sql,1); $nrowsCheckCookie = mysql_num_rows($qryCheckCookie); if($nrowsCheckCookie == 0){ $sql = "INSERT INTO $tabella (id_$tabella, id_$tabella_utenti) VALUES ('$session','$id_cliente')"; $qryInsertSession = mysql_db_query($nomedb, $sql, $id_link) or muori ("insert session",$sql,1); return true; }else{//Preleva ID del utente //$row = mysql_fetch_array($qryCheckCookie); //$id_cliente = $row["id_utente"]; $msg_err = "Si è verificato un errore (ERR:001) con le sessioni\n Siete pregati di effettuare nuovamente il login"; //header("Location: index.php?msg=msg_err"); //exit; return false; /*$sql = "INSERT INTO clienti_tmp (data_iscrizione,note,status) VALUES ('NOW()','tmp cliente','on')"; $qryUpdateAccess = mysql_db_query($nomedb, $sql, $id_link) or die ("QUERY ERROR INSERT TMP CLIENTE"); $id_cliente = mysql_insert_id($id_link); $sql_insert_session = "INSERT INTO session (id_session, id_cliente) VALUES ('$session','$id_cliente')"; $qry_insert_session = mysql_db_query($nomedb, $sql_insert_session, $id_link) or die ("QUERY ERROR 02"); return true;*/ } } ?>$larghezza)or($h>$altezza))://img > dimensioni massime if ($h > $w)://img verticale $new_w = ($w * $altezza)/$h;//calcolo nuova larghezza $new_h = $altezza;//nuova altezza = altezza massima $new_w = number_format($new_w, 0, '', '');//formatto la nuova larghezza else://img orizzontale o quadrata $new_w = $larghezza;//larghezza=larghezza massima $new_h = ($h * $larghezza)/$w;//calcol nuova altezza $new_h = number_format($new_h, 0, '', ''); //formatto nuova altezza endif; else://..altrimenti che ridimensioni a fare?!?!?!!? :-)) $new_w = $w;//larghezza invariata $new_h = $h;//altezza invariata endif; $dst_img = imagecreatetruecolor($new_w,$new_h);//creo nuova immagine if($estensione=="jpg" or $estensione[count($estensione)-1]=="jpeg")//se immagine jpg $src_img=imagecreatefromjpeg($src_img);//riempio a partire da originale elseif($estensione=="png")//se immagine png $src_img=imagecreatefrompng($src_img);//riempio a partire da originale elseif($estensione=="gif")//se immagine gif $src_img = imagecreatefromgif($src_img);//riempio a partire da originale else//immagine gif o di altro tipo non contemplato $msg_errore = "Tipo di immagine non supportato ".$nome.""; if(!isset($msg_errore)): imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w+1, $new_h+1, imagesx($src_img), imagesy($src_img)); $new_file = $dir_dest.$nome; switch($estensione){ case 'jpg': imagejpeg($dst_img,$new_file, 100); break; case 'png': imagepng($dst_img,$new_file); break; case 'gif': imagegif($dst_img,$new_file); break; } imagedestroy($dst_img); /* ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w+1,$new_h+1,ImageSX($src_img),ImageSY($src_img)); //salvo tutto e distruggo l'originale ImageJpeg($dst_img,$new_file,'100'); ImageDestroy($dst_img);*/ $msg_errore="File ".$nome." correttamente ridimensionato"; endif; return($msg_errore); } ?>

PRIVACY

This online privacy policy discloses information gathering practices and describes the usage of the information gathered on this website.

PERSONAL INFORMATION COLLECTION AND USE

The only personally identifiable information collected on this site is submitted to us freely and deliberately by site users. We collect and use this information through the provided forms online.
Euklis By GSG International will not share e-mail addresses or contact information we collect through our website with any third parties unless required by law.
If you send us an e-mail message, we may keep that message, your e-mail address, and any other data submitted with the message.

COOKIES

www.euklis.it uses cookies on this website. We utilize cookie technology to enhance and customize your experience. Cookies contain no personally identifying information.

SERVER LOGS

Server logs capture certain non-personally identifying data, such as the time and date of a web visit, the browser and operating system being used, the IP address or domain name of the user's ISP, and the web URL a user linked from.
This information is used generally to help us plan system enhancements when necessary and to provide content which is compatible with our visitors' web browsing systems.

HYPERLINKS TO OTHER WEB SITES

www.euklis.it includes links to websites of other companies. We do not log visitors' clicks from our site to other sites. Please note that we take no responsibility for the content of any external web site.

SECURITY

We have taken careful measures to ensure the integrity and security of your data. It is stored behind a firewall and is only accessible by using a secure ID and password which is distributed to staff members who need it to do their jobs.

ACCEPTANCE OF PRIVACY POLICY

By using this site, you agree to Euklis’s online privacy policy. If you do not agree to this policy, please do not use this site. We may change or modify this policy without notice, please check back periodically.

NEWS

New opportunities thanks to EUKLIS KLIS LPC

EUKLIS KLIS LPC is the new "License Plate Capture Camera" ideal for working with OCR software used for automatic plate r ...

Nuovi Corsi Genetec 2018

Iscriviti, non perdere l’occasione !La certificazione Genetec è fondamentale per gestire al meglio un sistema "Security ...

GEN ANALYTICS

GSG InternationAL is pleased to present EUKLIS KLIS GEN ANALYTICS Thanks to KLIS GEN ANALYTICS, all EUKLIS cameras equipped with v ...


EUKLIS S.r.l. Start Up Innovativa - P.IVA: 09967770968