add getApiKey(), fix checkVersion()

This commit is contained in:
Uwe Steinmann 2020-06-16 15:23:13 +02:00
parent c2b7e4d6c2
commit 3892a6186f

View File

@ -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
*