Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
73 righe
2.2 KiB
73 righe
2.2 KiB
<?php |
|
|
|
/* |
|
* To change this license header, choose License Headers in Project Properties. |
|
* To change this template file, choose Tools | Templates |
|
* and open the template in the editor. |
|
*/ |
|
|
|
/** |
|
* Description of UTENTI |
|
* |
|
* @author Stefano |
|
*/ |
|
class AccessLog { |
|
|
|
//put your code here |
|
const TABLE_NAME = "ACCESS_LOG"; |
|
const SEQ_NAME = "ACCESS_LOG_ID_SEQ"; |
|
|
|
public $ID = 0; // Primary key |
|
public $RESPONSE = ""; |
|
public $FISCALNUMBER = ""; |
|
public $INRESPONSETO = ""; |
|
public $AUTHNINSTANT = ""; |
|
public $AUTHENTICATINGAUTHORITY = ""; |
|
public $REDIRECTTO = ""; |
|
|
|
public function __construct($src = null) { |
|
global $conSpid; |
|
if ($src == null) |
|
return; |
|
if (is_array($src)) { |
|
if (isset($src['ID']) && $src['ID'] > 0) { |
|
$this->_loadAndFillObject($src['ID'], self::TABLE_NAME, $src); |
|
} else { |
|
$this->_loadByRow($src, $stripSlashes); |
|
} |
|
} elseif (intval($src)) { |
|
$this->_loadById($src, self::TABLE_NAME, true); |
|
} |
|
} |
|
|
|
/* |
|
* Select id by Mail |
|
*/ |
|
|
|
public function selectLog($fiscalnumber = "", $inresponseto="", $AuthnInstant="", $redirectto="") { |
|
global $conSpid; |
|
$return = array(); |
|
$return['esito'] = 1; |
|
$return['descrizioneErrore'] = ""; |
|
$verify = $conSpid->prepare("SELECT ID FROM " . self::TABLE_NAME . " WHERE FISCALNUMBER=:fiscalnumber AND INRESPONSETO=:inresponseto AND " |
|
. "REDIRECTTO=:redirectto AND AUTHINSTANT=:authinstant"); |
|
$verify->bindParam(":fiscalnumber", $fiscalnumber); |
|
$verify->bindParam(":inresponseto", $inresponseto); |
|
$verify->bindParam(":redirectto", $redirectto); |
|
$verify->bindParam(":authinstant", $AuthnInstant); |
|
try { |
|
$verify->execute(); |
|
$itVerify = $verify->fetch(PDO::FETCH_ASSOC); |
|
if (intval($itVerify['ID']) > 0) { |
|
$return['esito'] = 1; |
|
} else { |
|
$return['esito'] = 0; |
|
} |
|
} catch (Exception $exc) { |
|
$return['esito'] = -999; |
|
$return['descrizioneErrore'] = $exc->getMessage(); |
|
} |
|
return $return; |
|
} |
|
|
|
}
|
|
|