check if argument passed to setDefaultAccess() is in valid range

This commit is contained in:
Uwe Steinmann 2021-10-04 20:20:45 +02:00
parent b5a6ea330b
commit a0b95e8792

View File

@ -752,6 +752,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
function setDefaultAccess($mode, $noclean="false") { /* {{{ */
$db = $this->_dms->getDB();
if($mode < M_LOWEST_RIGHT || $mode > M_HIGHEST_RIGHT)
return false;
$queryStr = "UPDATE `tblDocuments` set `defaultAccess` = " . (int) $mode . " WHERE `id` = " . $this->_id;
if (!$db->getResult($queryStr))
return false;