Skip to content

Commit 90abf41

Browse files
committed
Moved the pagination settings to the method parameters list so they're not hardcoded
1 parent e03b1f3 commit 90abf41

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
@@ -6054,22 +6054,22 @@ public function updatepolicyforuser($username, $policy, $value)
60546054
return NULL;
60556055
}
60566056

6057-
public function getGroupsForUser($username){
6057+
public function getGroupsForUser($username, int $pageStart = 0, int $pageEnd = 10){
60586058
$this->startTimer();
60596059
$url = $this->server_url . "/admin/index.php";
6060-
$postdata = 'op=getgroupsforuser&username=' . $username . 'start=0&end=10';
6060+
$postdata = http_build_query([
6061+
'op' => 'getgroupsforuser',
6062+
'username' => $username,
6063+
'start' => $pageStart,
6064+
'end' => $pageEnd
6065+
]);
60616066
$buffer = $this->doPOST($url, $postdata);
60626067
$collection = new Collection($buffer, "group", GroupRecord::class , "meta");
60636068
$this->stopTimer();
6064-
if ($collection->getNumberOfRecords() > 0)
6065-
{
6069+
if ($collection->getNumberOfRecords() > 0) {
60666070
return $collection;
60676071
}
6068-
else
6069-
{
6070-
return $collection->getMetaRecord();
6071-
}
6072-
return NULL;
6072+
return $collection->getMetaRecord();
60736073
}
60746074

60756075
public function setCheckList($param, $value)

0 commit comments

Comments
 (0)