Code Duplication    Length = 11-12 lines in 3 locations

apps/user_ldap/lib/Group_Proxy.php 2 locations

@@ 135-146 (lines=12) @@
132
	 * get a list of all users in a group
133
	 * @return string[] with user ids
134
	 */
135
	public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
136
		$users = array();
137
138
		foreach($this->backends as $backend) {
139
			$backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset);
140
			if (is_array($backendUsers)) {
141
				$users = array_merge($users, $backendUsers);
142
			}
143
		}
144
145
		return $users;
146
	}
147
148
	/**
149
	 * returns the number of users in a group, who match the search term
@@ 165-176 (lines=12) @@
162
	 *
163
	 * Returns a list with all groups
164
	 */
165
	public function getGroups($search = '', $limit = -1, $offset = 0) {
166
		$groups = array();
167
168
		foreach($this->backends as $backend) {
169
			$backendGroups = $backend->getGroups($search, $limit, $offset);
170
			if (is_array($backendGroups)) {
171
				$groups = array_merge($groups, $backendGroups);
172
			}
173
		}
174
175
		return $groups;
176
	}
177
178
	/**
179
	 * check if a group exists

apps/user_ldap/lib/User_Proxy.php 1 location

@@ 143-153 (lines=11) @@
140
	 * @param null|int $offset
141
	 * @return string[] an array of all uids
142
	 */
143
	public function getUsers($search = '', $limit = 10, $offset = 0) {
144
		//we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends
145
		$users = array();
146
		foreach($this->backends as $backend) {
147
			$backendUsers = $backend->getUsers($search, $limit, $offset);
148
			if (is_array($backendUsers)) {
149
				$users = array_merge($users, $backendUsers);
150
			}
151
		}
152
		return $users;
153
	}
154
155
	/**
156
	 * check if a user exists