mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-31 19:19:00 +08:00
Small improvements for #727
This commit is contained in:
parent
e92910d4a0
commit
a4ea8a46a8
3 changed files with 56 additions and 52 deletions
|
@ -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();
|
||||
|
|
|
@ -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,12 +43,14 @@ class LdapMailAccountsPlugin extends AbstractPlugin
|
|||
*/
|
||||
public function AddAdditionalLdapMailAccounts(Account $oAccount)
|
||||
{
|
||||
// Set up config
|
||||
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
|
||||
if ($oAccount instanceof MainAccount) {
|
||||
// Set up config
|
||||
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
|
||||
|
||||
$oldapMailAccounts = new LdapMailAccounts($config, $this->Manager()->Actions()->Logger());
|
||||
$oldapMailAccounts = new LdapMailAccounts($config, $this->Manager()->Actions()->Logger());
|
||||
|
||||
$oldapMailAccounts->AddLdapMailAccounts($oAccount);
|
||||
$oldapMailAccounts->AddLdapMailAccounts($oAccount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue