Skip to content

Commit

Permalink
Bugfix: Nextcloud login failed due to undefined email address
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed May 27, 2024
1 parent ab2f646 commit 69cd876
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/nextcloud/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
{
const
NAME = 'Nextcloud',
VERSION = '2.36',
RELEASE = '2024-05-26',
VERSION = '2.36.1',
RELEASE = '2024-05-27',
CATEGORY = 'Integrations',
DESCRIPTION = 'Integrate with Nextcloud v20+',
REQUIRED = '2.36.2';
Expand Down Expand Up @@ -74,14 +74,14 @@ public static function IsLoggedIn()
public function loginCredentials(string &$sEmail, string &$sLogin, ?string &$sPassword = null) : void
{
$ocUser = \OC::$server->getUserSession()->getUser();
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress();
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress() ?: $sEmail;
$sLogin = $ocUser->getUID();
}

public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) : void
{
$ocUser = \OC::$server->getUserSession()->getUser();
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress();
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress() ?: $sEmail;
}

public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
Expand Down

0 comments on commit 69cd876

Please sign in to comment.