예제 #1
0
 private function getDirectory()
 {
     $diff = 24 * 60 * 60;
     if (self::$lastcheck) {
         $diff = time() - self::$lastcheck;
     }
     if ($diff < 24 * 60 * 60) {
         return 0;
     }
     if (!$this->send("DirectoryRequest")) {
         return -1;
     }
     $search = $this->parse("directory");
     if (!$search) {
         $this->error();
         return -2;
     }
     self::$issuers = array();
     $iss = explode("<issuer>", str_replace("</issuer>", "", $search));
     foreach ($iss as $k => $v) {
         $issuerid = $this->parse("issuerid", $v);
         $issuername = $this->parse("issuername", $v);
         if ($issuerid && $issuername) {
             self::$issuers[$issuerid] = $issuername;
         }
     }
     self::$lastcheck = time();
     return 0;
 }