diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/ProjectPermissionModel.php | 16 | ||||
-rw-r--r-- | app/Model/ProjectUserRoleModel.php | 16 | ||||
-rw-r--r-- | app/Model/UserNotificationModel.php | 22 |
3 files changed, 0 insertions, 54 deletions
diff --git a/app/Model/ProjectPermissionModel.php b/app/Model/ProjectPermissionModel.php index 752913d7..d1351a6c 100644 --- a/app/Model/ProjectPermissionModel.php +++ b/app/Model/ProjectPermissionModel.php @@ -112,22 +112,6 @@ class ProjectPermissionModel extends Base } /** - * Return true if everybody is allowed for the project - * - * @access public - * @param integer $project_id Project id - * @return bool - */ - public function isEverybodyAllowed($project_id) - { - return $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->eq('is_everybody_allowed', 1) - ->exists(); - } - - /** * Return true if the user is allowed to access a project * * @param integer $project_id diff --git a/app/Model/ProjectUserRoleModel.php b/app/Model/ProjectUserRoleModel.php index a95cf5d9..dc4add34 100644 --- a/app/Model/ProjectUserRoleModel.php +++ b/app/Model/ProjectUserRoleModel.php @@ -44,10 +44,7 @@ class ProjectUserRoleModel extends Base { $userProjects = $this->db ->hashtable(ProjectModel::TABLE) - ->beginOr() ->eq(self::TABLE.'.user_id', $user_id) - ->eq(ProjectModel::TABLE.'.is_everybody_allowed', 1) - ->closeOr() ->in(ProjectModel::TABLE.'.is_active', $status) ->join(self::TABLE, 'project_id', 'id') ->getAll(ProjectModel::TABLE.'.id', ProjectModel::TABLE.'.name'); @@ -70,15 +67,6 @@ class ProjectUserRoleModel extends Base */ public function getUserRole($project_id, $user_id) { - $projectInfo = $this->db->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->columns('owner_id', 'is_everybody_allowed') - ->findOne(); - - if ($projectInfo['is_everybody_allowed'] == 1) { - return $projectInfo['owner_id'] == $user_id ? Role::PROJECT_MANAGER : Role::PROJECT_MEMBER; - } - $role = $this->db->table(self::TABLE)->eq('user_id', $user_id)->eq('project_id', $project_id)->findOneColumn('role'); if (empty($role)) { @@ -163,10 +151,6 @@ class ProjectUserRoleModel extends Base */ public function getAssignableUsers($project_id) { - if ($this->projectPermissionModel->isEverybodyAllowed($project_id)) { - return $this->userModel->getActiveUsersList(); - } - $userMembers = $this->db->table(self::TABLE) ->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name') ->join(UserModel::TABLE, 'id', 'user_id') diff --git a/app/Model/UserNotificationModel.php b/app/Model/UserNotificationModel.php index d77526f6..9e90cf5d 100644 --- a/app/Model/UserNotificationModel.php +++ b/app/Model/UserNotificationModel.php @@ -68,10 +68,6 @@ class UserNotificationModel extends Base */ public function getUsersWithNotificationEnabled($project_id, $exclude_user_id = 0) { - if ($this->projectPermissionModel->isEverybodyAllowed($project_id)) { - return $this->getEverybodyWithNotificationEnabled($exclude_user_id); - } - $users = array(); $members = $this->getProjectUserMembersWithNotificationEnabled($project_id, $exclude_user_id); $groups = $this->getProjectGroupMembersWithNotificationEnabled($project_id, $exclude_user_id); @@ -183,22 +179,4 @@ class UserNotificationModel extends Base ->eq(UserModel::TABLE.'.is_active', 1) ->findAll(); } - - /** - * Get a list of project members with notification enabled - * - * @access private - * @param integer $exclude_user_id User id to exclude - * @return array - */ - private function getEverybodyWithNotificationEnabled($exclude_user_id) - { - return $this->db - ->table(UserModel::TABLE) - ->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name', UserModel::TABLE.'.email', UserModel::TABLE.'.language', UserModel::TABLE.'.notifications_filter') - ->eq('notifications_enabled', '1') - ->neq(UserModel::TABLE.'.id', $exclude_user_id) - ->eq(UserModel::TABLE.'.is_active', 1) - ->findAll(); - } } |