lib/private/SubAdmin.php
/**
	 * checks if a user is a SubAdmin
	 * @param IUser $user 
	 * @return bool
	 */
checks if a user is a SubAdmin
@param IUser $user
@return bool
checks if a user is a SubAdmin @param IUser $user @return bool
public function isSubAdmin(IUser $user) {
		if ($this->groupManager->isAdmin($user->getUID())) {
			return true;
		}
		$qb = $this->dbConn->getQueryBuilder();
		$result = $qb->select('gid')
			->from('group_admin')
			->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID())))
			->setMaxResults(1)
			->execute();
		$isSubAdmin = $result->fetch();
		$result->closeCursor();
		$result = $isSubAdmin === false ? false : true;
		return $result;
	}
public function isSubAdmin ( IUser $ user ) { if ( $ this -> groupManager -> isAdmin ( $ user -> getUID ( ) ) ) { return true ; } $ qb = $ this -> dbConn -> getQueryBuilder ( ) ; $ result = $ qb -> select ( 'gid' ) -> from ( 'group_admin' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'uid' , $ qb -> createNamedParameter ( $ user -> getUID ( ) ) ) ) -> setMaxResults ( 1 ) -> execute ( ) ; $ isSubAdmin = $ result -> fetch ( ) ; $ result -> closeCursor ( ) ; $ result = $ isSubAdmin === false ? false : true ; return $ result ; }
checks if a user is a SubAdmin
 @param IUser $user
 @return bool
checks if a user is a SubAdmin @param IUser $user @return bool
// Check if the user is already an admin