From 3892a6186fc0ee681ccd243e0ab23886978f41cb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 16 Jun 2020 15:23:13 +0200 Subject: [PATCH] add getApiKey(), fix checkVersion() --- SeedDMS_Core/Core/inc.ClassDMS.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index 98be741df..466c94f65 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -475,7 +475,7 @@ class SeedDMS_Core_DMS { $this->lasterror = ''; $this->version = '@package_version@'; if($this->version[0] == '@') - $this->version = '6.0.11'; + $this->version = '6.1.0'; } /* }}} */ /** @@ -580,7 +580,7 @@ class SeedDMS_Core_DMS { $tbllist = explode(',',strtolower(join(',',$tbllist))); if(!array_search('tblversion', $tbllist)) return false; - $queryStr = "SELECT * FROM `tblVersion` order by `major`,`minor`,`subminor` WHERE `module`=".$this->db->qstr($module)." limit 1"; + $queryStr = "SELECT * FROM `tblVersion` WHERE `module`=".$this->db->qstr($module)." ORDER by `major`,`minor`,`subminor` LIMIT 1"; $resArr = $this->db->getResultArray($queryStr); if (is_bool($resArr) && $resArr == false) return false; @@ -602,7 +602,7 @@ class SeedDMS_Core_DMS { $tbllist = explode(',',strtolower(join(',',$tbllist))); if(!array_search('tblversion', $tbllist)) return true; - $queryStr = "SELECT * FROM `tblVersion` order by `major`,`minor`,`subminor` WHERE `module`='core' limit 1"; + $queryStr = "SELECT * FROM `tblVersion` WHERE `module`='core' ORDER by `major`,`minor`,`subminor` LIMIT 1"; $resArr = $this->db->getResultArray($queryStr); if (is_bool($resArr) && $resArr == false) return false; @@ -2783,6 +2783,17 @@ class SeedDMS_Core_DMS { return $this->getRole($this->db->getInsertID('tblRoles')); } /* }}} */ + /** + * Get a apikey by its id + * + * @param integer $name name of key + * @return object/boolean apikey or false if no role was found + */ + function getApiKey($id) { /* {{{ */ + $classname = $this->classnames['apikey']; + return $classname::getInstance($id, $this); + } /* }}} */ + /** * Get a apikey by its key name *