Subversion Repositories oidplus

Rev

Rev 730 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 730 Rev 790
Line 30... Line 30...
30
                return $this->email;
30
                return $this->email;
31
        }
31
        }
32
 
32
 
33
        public function existing() {
33
        public function existing() {
34
                $res = OIDplus::db()->query("select email from ###ra where email = ?", array($this->email));
34
                $res = OIDplus::db()->query("select email from ###ra where email = ?", array($this->email));
35
                return ($res->num_rows() > 0);
35
                return ($res->any());
36
        }
36
        }
37
 
37
 
38
        public function raName() {
38
        public function raName() {
39
                $res = OIDplus::db()->query("select ra_name from ###ra where email = ?", array($this->email));
39
                $res = OIDplus::db()->query("select ra_name from ###ra where email = ?", array($this->email));
40
                if ($res->num_rows() == 0) return _L('(RA not in database)');
40
                if (!$res->any()) return _L('(RA not in database)');
41
                $row = $res->fetch_array();
41
                $row = $res->fetch_array();
42
                return $row['ra_name'];
42
                return $row['ra_name'];
43
        }
43
        }
44
 
44
 
45
        public static function getAllRAs() {
45
        public static function getAllRAs() {
Line 76... Line 76...
76
                OIDplus::db()->query("insert into ###ra (salt, authkey, email, registered, ra_name, personal_name, organization, office, street, zip_town, country, phone, mobile, fax) values (?, ?, ?, ".OIDplus::db()->sqlDate().", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array($s_salt, $calc_authkey, $this->email, "", "", "", "", "", "", "", "", "", ""));
76
                OIDplus::db()->query("insert into ###ra (salt, authkey, email, registered, ra_name, personal_name, organization, office, street, zip_town, country, phone, mobile, fax) values (?, ?, ?, ".OIDplus::db()->sqlDate().", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array($s_salt, $calc_authkey, $this->email, "", "", "", "", "", "", "", "", "", ""));
77
        }
77
        }
78
 
78
 
79
        public function getAuthInfo()/*: ?OIDplusRAAuthInfo*/ {
79
        public function getAuthInfo()/*: ?OIDplusRAAuthInfo*/ {
80
                $ra_res = OIDplus::db()->query("select authkey, salt from ###ra where email = ?", array($this->email));
80
                $ra_res = OIDplus::db()->query("select authkey, salt from ###ra where email = ?", array($this->email));
81
                if ($ra_res->num_rows() == 0) return null; // User not found
81
                if (!$ra_res->any()) return null; // User not found
82
                $ra_row = $ra_res->fetch_array();
82
                $ra_row = $ra_res->fetch_array();
83
 
83
 
84
                return new OIDplusRAAuthInfo($ra_row['salt'], $ra_row['authkey']);
84
                return new OIDplusRAAuthInfo($ra_row['salt'], $ra_row['authkey']);
85
        }
85
        }
86
 
86