コード例 #1
0
ファイル: Sql.php プロジェクト: k42b3/psx-ws
 public function save($opEndpoint, Association $assoc)
 {
     $now = new DateTime();
     $this->sql->insert($this->table, array('opEndpoint' => $opEndpoint, 'assocHandle' => $assoc->getAssocHandle(), 'assocType' => $assoc->getAssocType(), 'sessionType' => $assoc->getSessionType(), 'secret' => $assoc->getSecret(), 'expires' => $assoc->getExpire(), 'date' => $now->format(DateTime::SQL)));
 }
コード例 #2
0
ファイル: Memory.php プロジェクト: k42b3/psx-ws
 public function save($opEndpoint, Association $assoc)
 {
     $key = md5($opEndpoint);
     $this->container[$key] = array('opEndpoint' => $opEndpoint, 'assocHandle' => $assoc->getAssocHandle(), 'assocType' => $assoc->getAssocType(), 'sessionType' => $assoc->getSessionType(), 'secret' => $assoc->getSecret(), 'expires' => $assoc->getExpire());
 }
コード例 #3
0
ファイル: File.php プロジェクト: k42b3/psx-ws
 public function save($opEndpoint, Association $assoc)
 {
     $data = unserialize(FileObject::getContents($this->file));
     $key = md5($opEndpoint);
     $data[$key] = array('opEndpoint' => $opEndpoint, 'assocHandle' => $assoc->getAssocHandle(), 'assocType' => $assoc->getAssocType(), 'sessionType' => $assoc->getSessionType(), 'secret' => $assoc->getSecret(), 'expires' => $assoc->getExpire());
     FileObject::putContents($this->file, serialize($data));
 }
コード例 #4
0
ファイル: Signon.php プロジェクト: visapi/amun
    public function onAsocciation(Association $assoc)
    {
        $sql = <<<SQL
SELECT
\t`assoc`.`id`,
\t`assoc`.`assocHandle`,
\t`assoc`.`expires`,
\t`assoc`.`date`
FROM 
\t{$this->registry['table.openid_assoc']} `assoc`
WHERE 
\t`assoc`.`assocHandle` = ?
SQL;
        $row = $this->sql->getRow($sql, array($assoc->getAssocHandle()));
        if (empty($row)) {
            $date = new DateTime('NOW', $this->registry['core.default_timezone']);
            $this->sql->insert($this->registry['table.openid_assoc'], array('assocHandle' => $assoc->getAssocHandle(), 'assocType' => $assoc->getAssocType(), 'sessionType' => $assoc->getSessionType(), 'secret' => $assoc->getSecret(), 'expires' => self::EXPIRE, 'date' => $date->format(DateTime::SQL)));
            return self::EXPIRE;
        } else {
            throw new Exception('Association already exists');
        }
    }