Merge branch 'seeddms-5.0.x' into seeddms-5.1.x

This commit is contained in:
Uwe Steinmann 2016-07-28 08:07:10 +02:00
commit dd1310871f

View File

@ -36,6 +36,13 @@ class SeedDMS_Core_Group { /* {{{ */
*/
protected $_name;
/**
* The comment of the user group
*
* @var string
*/
protected $_comment;
/**
* Back reference to DMS this user group belongs to
*
@ -206,8 +213,14 @@ class SeedDMS_Core_Group { /* {{{ */
return true;
} /* }}} */
// $asManager=false: verify if user is in group
// $asManager=true : verify if user is in group as manager
/**
* Check if user is member of group
*
* @param object $user user to be checked
* @param boolean $asManager also check whether user is manager of group if
* set to true, otherwise does not care about manager status
* @return boolean true if user is member, otherwise false
*/
function isMember($user,$asManager=false) { /* {{{ */
if (isset($this->_users)&&!$asManager) {
foreach ($this->_users as $usr)
@ -228,6 +241,12 @@ class SeedDMS_Core_Group { /* {{{ */
return true;
} /* }}} */
/**
* Toggle manager status of user
*
* @param object $user
* @return boolean true if operation was successful, otherwise false
*/
function toggleManager($user) { /* {{{ */
$db = $this->_dms->getDB();