|
@@ 583-591 (lines=9) @@
|
| 580 |
|
* @param int $userId |
| 581 |
|
* @return array of invitationObjects |
| 582 |
|
*/ |
| 583 |
|
public function userStatus($userId) { |
| 584 |
|
$retval = []; |
| 585 |
|
$userrows = $this->databaseHandle->exec("SELECT `token` FROM `silverbullet_invitation` WHERE `silverbullet_user_id` = ? AND `profile_id` = ? ", "ii", $userId, $this->identifier); |
| 586 |
|
// SELECT -> resource, not boolean |
| 587 |
|
while ($returnedData = mysqli_fetch_object(/** @scrutinizer ignore-type */ $userrows)) { |
| 588 |
|
$retval[] = new SilverbulletInvitation($returnedData->token); |
| 589 |
|
} |
| 590 |
|
return $retval; |
| 591 |
|
} |
| 592 |
|
|
| 593 |
|
/** |
| 594 |
|
* finds out the expiry date of a given user |
|
@@ 621-629 (lines=9) @@
|
| 618 |
|
* lists all users of this SB profile |
| 619 |
|
* @return array |
| 620 |
|
*/ |
| 621 |
|
public function listAllUsers() { |
| 622 |
|
$userArray = []; |
| 623 |
|
$users = $this->databaseHandle->exec("SELECT `id`, `username` FROM `silverbullet_user` WHERE `profile_id` = ? ", "i", $this->identifier); |
| 624 |
|
// SELECT -> resource, not boolean |
| 625 |
|
while ($res = mysqli_fetch_object(/** @scrutinizer ignore-type */ $users)) { |
| 626 |
|
$userArray[$res->id] = $res->username; |
| 627 |
|
} |
| 628 |
|
return $userArray; |
| 629 |
|
} |
| 630 |
|
|
| 631 |
|
/** |
| 632 |
|
* lists all users which are currently active (i.e. have pending invitations and/or valid certs) |