mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Update Nextcloud.php (#2662)
It seems the try in the getInternalUsername function was not placed very well, so the throw exception in the ocs_request function didn't work.
This commit is contained in:
+7
-8
@@ -280,15 +280,14 @@ class Nextcloud extends Base implements IBackupProvider
|
||||
|
||||
public function getInternalUsername($url, $username, $password): string
|
||||
{
|
||||
$xml_response = $this->ocs_request(
|
||||
"$url/ocs/v1.php/cloud/user",
|
||||
$username,
|
||||
$password,
|
||||
"GET",
|
||||
"Cannot get real username"
|
||||
);
|
||||
|
||||
try {
|
||||
$xml_response = $this->ocs_request(
|
||||
"$url/ocs/v1.php/cloud/user",
|
||||
$username,
|
||||
$password,
|
||||
"GET",
|
||||
"Cannot get real username"
|
||||
);
|
||||
$data = $xml_response->data;
|
||||
if ($data == null) {
|
||||
return $username; // no data found, return the old username
|
||||
|
||||
Reference in New Issue
Block a user