mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
ensure setRole() is passed an object
This commit is contained in:
parent
b9c613ff83
commit
96933bb30d
|
@ -90,7 +90,7 @@ class SeedDMS_Core_Role { /* {{{ */
|
|||
$queryStr = "SELECT * FROM `tblRoles` WHERE `name` = ".$db->qstr($id);
|
||||
break;
|
||||
default:
|
||||
$queryStr = "SELECT * FROM `tblRoles` WHERE id = " . (int) $id;
|
||||
$queryStr = "SELECT * FROM `tblRoles` WHERE `id` = " . (int) $id;
|
||||
}
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
@ -740,6 +740,9 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
function setRole($newrole) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
if(!is_object($newrole) || (get_class($newrole) != $this->_dms->getClassname('role')))
|
||||
return false;
|
||||
|
||||
if(is_object($newrole))
|
||||
$queryStr = "UPDATE `tblUsers` SET `role` = " . $newrole->getID() . " WHERE `id` = " . $this->_id;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user