Small improvements for #727

This commit is contained in:
the-djmaze 2022-11-30 11:54:55 +01:00
parent e92910d4a0
commit a4ea8a46a8
3 changed files with 56 additions and 52 deletions

View file

@ -3,7 +3,7 @@
use RainLoop\Enumerations\Capa;
use MailSo\Log\Logger;
use RainLoop\Actions;
use RainLoop\Model\Account;
use RainLoop\Model\MainAccount;
class LdapMailAccounts
{
@ -53,10 +53,10 @@ class LdapMailAccounts
*
* The ldap lookup has to be configured in the plugin configuration of the extension (in the SnappyMail Admin Panel)
*
* @param Account $oAccount
* @param MainAccount $oAccount
* @return bool true if additional accounts have been added or no additional accounts where found in . false if an error occured
*/
public function AddLdapMailAccounts(Account $oAccount): bool
public function AddLdapMailAccounts(MainAccount $oAccount): bool
{
try {
$this->EnsureBound();

View file

@ -5,6 +5,7 @@ use RainLoop\Enumerations\PluginPropertyType;
use RainLoop\Plugins\AbstractPlugin;
use RainLoop\Plugins\Property;
use RainLoop\Model\Account;
use RainLoop\Model\MainAccount;
use RainLoop\Actions;
@ -42,6 +43,7 @@ class LdapMailAccountsPlugin extends AbstractPlugin
*/
public function AddAdditionalLdapMailAccounts(Account $oAccount)
{
if ($oAccount instanceof MainAccount) {
// Set up config
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
@ -49,6 +51,7 @@ class LdapMailAccountsPlugin extends AbstractPlugin
$oldapMailAccounts->AddLdapMailAccounts($oAccount);
}
}
/**
* Defines the content of the plugin configuration page inside the Admin Panel of SnappyMail

View file

@ -45,10 +45,11 @@ trait User
$this->Logger()->AddSecret($sPassword);
$oAccount = $this->LoginProcess($sEmail, $sPassword, $bSignMe);
$this->Plugins()->RunHook('login.success', array($oAccount));
$this->SetAuthToken($oAccount);
$this->Plugins()->RunHook('login.success', array($oAccount));
$sLanguage = $this->GetActionParam('Language', '');
if ($oAccount && $sLanguage)
{