Code Duplication    Length = 8-8 lines in 5 locations

apps/user_ldap/lib/GroupPluginManager.php 5 locations

@@ 79-86 (lines=8) @@
76
	 * @return string | null The group DN if group creation was successful.
77
	 * @throws \Exception
78
	 */
79
	public function createGroup($gid) {
80
		$plugin = $this->which[GroupInterface::CREATE_GROUP];
81
82
		if ($plugin) {
83
			return $plugin->createGroup($gid);
84
		}
85
		throw new \Exception('No plugin implements createGroup in this LDAP Backend.');
86
	}
87
88
	/**
89
	 * Delete a group
@@ 94-101 (lines=8) @@
91
	 * @return bool
92
	 * @throws \Exception
93
	 */
94
	public function deleteGroup($gid) {
95
		$plugin = $this->which[GroupInterface::DELETE_GROUP];
96
97
		if ($plugin) {
98
			return $plugin->deleteGroup($gid);
99
		}
100
		throw new \Exception('No plugin implements deleteGroup in this LDAP Backend.');
101
	}
102
103
	/**
104
	 * Add a user to a group
@@ 112-119 (lines=8) @@
109
	 *
110
	 * Adds a user to a group.
111
	 */
112
	public function addToGroup($uid, $gid) {
113
		$plugin = $this->which[GroupInterface::ADD_TO_GROUP];
114
115
		if ($plugin) {
116
			return $plugin->addToGroup($uid, $gid);
117
		}
118
		throw new \Exception('No plugin implements addToGroup in this LDAP Backend.');
119
	}
120
121
	/**
122
	 * Removes a user from a group
@@ 130-137 (lines=8) @@
127
	 *
128
	 * removes the user from a group.
129
	 */
130
	public function removeFromGroup($uid, $gid) {
131
		$plugin = $this->which[GroupInterface::REMOVE_FROM_GROUP];
132
133
		if ($plugin) {
134
			return $plugin->removeFromGroup($uid, $gid);
135
		}
136
		throw new \Exception('No plugin implements removeFromGroup in this LDAP Backend.');
137
	}
138
139
	/**
140
	 * get the number of all users matching the search string in a group
@@ 161-168 (lines=8) @@
158
	 * @return array|false
159
	 * @throws \Exception
160
	 */
161
	public function getGroupDetails($gid) {
162
		$plugin = $this->which[GroupInterface::GROUP_DETAILS];
163
164
		if ($plugin) {
165
			return $plugin->getGroupDetails($gid);
166
		}
167
		throw new \Exception('No plugin implements getGroupDetails in this LDAP Backend.');
168
	}
169
}
170