@@ -36,6 +36,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
3636
3737 /**
3838 * Constructor
39+ *
3940 * @param string[] $serverConfigPrefixes array containing the config Prefixes
4041 */
4142 public function __construct ($ serverConfigPrefixes , ILDAPWrapper $ ldap , GroupPluginManager $ groupPluginManager ) {
@@ -51,6 +52,7 @@ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap, GroupPlug
5152
5253 /**
5354 * Tries the backends one after the other until a positive result is returned from the specified method
55+ *
5456 * @param string $gid the gid connected to the request
5557 * @param string $method the method of the group backend that shall be called
5658 * @param array $parameters an array of parameters to be passed
@@ -60,7 +62,9 @@ protected function walkBackends($gid, $method, $parameters) {
6062 $ cacheKey = $ this ->getGroupCacheKey ($ gid );
6163 foreach ($ this ->backends as $ configPrefix => $ backend ) {
6264 if ($ result = call_user_func_array ([$ backend , $ method ], $ parameters )) {
63- $ this ->writeToCache ($ cacheKey , $ configPrefix );
65+ if (!$ this ->isSingleBackend ()) {
66+ $ this ->writeToCache ($ cacheKey , $ configPrefix );
67+ }
6468 return $ result ;
6569 }
6670 }
@@ -69,6 +73,7 @@ protected function walkBackends($gid, $method, $parameters) {
6973
7074 /**
7175 * Asks the backend connected to the server that supposely takes care of the gid from the request.
76+ *
7277 * @param string $gid the gid connected to the request
7378 * @param string $method the method of the group backend that shall be called
7479 * @param array $parameters an array of parameters to be passed
@@ -99,8 +104,13 @@ protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) {
99104 return false ;
100105 }
101106
107+ protected function activeBackends (): int {
108+ return count ($ this ->backends );
109+ }
110+
102111 /**
103112 * is user in group?
113+ *
104114 * @param string $uid uid of the user
105115 * @param string $gid gid of the group
106116 * @return bool
@@ -113,6 +123,7 @@ public function inGroup($uid, $gid) {
113123
114124 /**
115125 * Get all groups a user belongs to
126+ *
116127 * @param string $uid Name of the user
117128 * @return string[] with group names
118129 *
@@ -134,6 +145,7 @@ public function getUserGroups($uid) {
134145
135146 /**
136147 * get a list of all users in a group
148+ *
137149 * @return string[] with user ids
138150 */
139151 public function usersInGroup ($ gid , $ search = '' , $ limit = -1 , $ offset = 0 ) {
@@ -160,6 +172,7 @@ public function createGroup($gid) {
160172
161173 /**
162174 * delete a group
175+ *
163176 * @param string $gid gid of the group to delete
164177 * @return bool
165178 */
@@ -170,6 +183,7 @@ public function deleteGroup($gid) {
170183
171184 /**
172185 * Add a user to a group
186+ *
173187 * @param string $uid Name of the user to add to group
174188 * @param string $gid Name of the group in which add the user
175189 * @return bool
@@ -183,6 +197,7 @@ public function addToGroup($uid, $gid) {
183197
184198 /**
185199 * Removes a user from a group
200+ *
186201 * @param string $uid Name of the user to remove from group
187202 * @param string $gid Name of the group from which remove the user
188203 * @return bool
@@ -196,6 +211,7 @@ public function removeFromGroup($uid, $gid) {
196211
197212 /**
198213 * returns the number of users in a group, who match the search term
214+ *
199215 * @param string $gid the internal group name
200216 * @param string $search optional, a search string
201217 * @return int|bool
@@ -207,6 +223,7 @@ public function countUsersInGroup($gid, $search = '') {
207223
208224 /**
209225 * get an array with group details
226+ *
210227 * @param string $gid
211228 * @return array|false
212229 */
@@ -217,6 +234,7 @@ public function getGroupDetails($gid) {
217234
218235 /**
219236 * get a list of all groups
237+ *
220238 * @return string[] with group names
221239 *
222240 * Returns a list with all groups
@@ -236,6 +254,7 @@ public function getGroups($search = '', $limit = -1, $offset = 0) {
236254
237255 /**
238256 * check if a group exists
257+ *
239258 * @param string $gid
240259 * @return bool
241260 */
@@ -245,6 +264,7 @@ public function groupExists($gid) {
245264
246265 /**
247266 * Check if backend implements actions
267+ *
248268 * @param int $actions bitwise-or'ed actions
249269 * @return boolean
250270 *
@@ -258,6 +278,7 @@ public function implementsActions($actions) {
258278
259279 /**
260280 * Return access for LDAP interaction.
281+ *
261282 * @param string $gid
262283 * @return Access instance of Access for LDAP interaction
263284 */
@@ -268,6 +289,7 @@ public function getLDAPAccess($gid) {
268289 /**
269290 * Return a new LDAP connection for the specified group.
270291 * The connection needs to be closed manually.
292+ *
271293 * @param string $gid
272294 * @return resource of the LDAP connection
273295 */
0 commit comments