Skip to content

Commit 76548fd

Browse files
author
Tomasz Formański
authored
Merge pull request #10 from codelathe/bugfix/move_getgroupforuser_pagination_settings_to_function_parameters
Changed the getGroupsForUser method
2 parents 564ea2b + 90abf41 commit 76548fd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fccloudapi.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6533,22 +6533,22 @@ public function updatepolicyforuser($username, $policy, $value)
65336533
return NULL;
65346534
}
65356535

6536-
public function getGroupsForUser($username){
6536+
public function getGroupsForUser($username, int $pageStart = 0, int $pageEnd = 10){
65376537
$this->startTimer();
65386538
$url = $this->server_url . "/admin/index.php";
6539-
$postdata = 'op=getgroupsforuser&username=' . $username . 'start=0&end=10';
6539+
$postdata = http_build_query([
6540+
'op' => 'getgroupsforuser',
6541+
'username' => $username,
6542+
'start' => $pageStart,
6543+
'end' => $pageEnd
6544+
]);
65406545
$buffer = $this->doPOST($url, $postdata);
65416546
$collection = new Collection($buffer, "group", GroupRecord::class , "meta");
65426547
$this->stopTimer();
6543-
if ($collection->getNumberOfRecords() > 0)
6544-
{
6548+
if ($collection->getNumberOfRecords() > 0) {
65456549
return $collection;
65466550
}
6547-
else
6548-
{
6549-
return $collection->getMetaRecord();
6550-
}
6551-
return NULL;
6551+
return $collection->getMetaRecord();
65526552
}
65536553

65546554
public function setCheckList($param, $value)

0 commit comments

Comments
 (0)