mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-31 05:57:34 +00:00
check if argument passed to setDefaultAccess() is in valid range
This commit is contained in:
parent
b5a6ea330b
commit
a0b95e8792
|
@ -752,6 +752,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
function setDefaultAccess($mode, $noclean="false") { /* {{{ */
|
function setDefaultAccess($mode, $noclean="false") { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$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;
|
$queryStr = "UPDATE `tblDocuments` set `defaultAccess` = " . (int) $mode . " WHERE `id` = " . $this->_id;
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user