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); } ?>

News

Home » News
[«] [«] 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [»] [»]

Euklis approda nei mercati del Medio Oriente e Nor...

GSG International, azienda italiana leader per la fornitura di tecnologie per la videosorveglianza, ha raggiunto un importante accordo di partnership commerciale della durata di cinque anni con Alingntech Group, distributore a valore aggiunto di prodotti per la sicurezza con sede a Dubai, riconosciuto...

GSG International distribuisce Commend 01 dicembr...

GSG International, azienda italiana fondata nel 1997, leader nella fornitura di sistemi integrati di sicurezza , videosorveglianza e controllo accessi amplia la propria offerta di soluzioni con i prodotti audio ed intercom della Commend con la quale ha recentemente siglato un contratto di distribuzione.


...

EUKLIS in the Middle East and North Africa market...

GSG International, Italian company, a leading provider of technologies for video surveillance, came to an agreement of partnership for the duration of five years with Alingntech Group, a manufactory representative and value-added supplier for security products, well known for his great competence in...

New line EUKLIS IP Ultra Dark Vision

Euklis UDV

GSG International announces its new line EUKLIS IP Ultra Dark Vision for high-quality video even in low light conditions. The minimum illumination in terms of color image is 0.01 and 0.0001 lux@F1.2 lux@F1.2 black and white. EUKLIS UDV is able to display license plates even in low or no light conditions...

[«] [«] 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [»] [»]

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