mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-03-01 01:06:38 +08:00
Small improvements for #727
This commit is contained in:
parent
e92910d4a0
commit
a4ea8a46a8
3 changed files with 56 additions and 52 deletions
plugins/ldap-mail-accounts
snappymail/v/0.0.0/app/libraries/RainLoop/Actions
|
@ -3,7 +3,7 @@
|
||||||
use RainLoop\Enumerations\Capa;
|
use RainLoop\Enumerations\Capa;
|
||||||
use MailSo\Log\Logger;
|
use MailSo\Log\Logger;
|
||||||
use RainLoop\Actions;
|
use RainLoop\Actions;
|
||||||
use RainLoop\Model\Account;
|
use RainLoop\Model\MainAccount;
|
||||||
|
|
||||||
class LdapMailAccounts
|
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)
|
* 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
|
* @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 {
|
try {
|
||||||
$this->EnsureBound();
|
$this->EnsureBound();
|
||||||
|
|
|
@ -5,6 +5,7 @@ use RainLoop\Enumerations\PluginPropertyType;
|
||||||
use RainLoop\Plugins\AbstractPlugin;
|
use RainLoop\Plugins\AbstractPlugin;
|
||||||
use RainLoop\Plugins\Property;
|
use RainLoop\Plugins\Property;
|
||||||
use RainLoop\Model\Account;
|
use RainLoop\Model\Account;
|
||||||
|
use RainLoop\Model\MainAccount;
|
||||||
use RainLoop\Actions;
|
use RainLoop\Actions;
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,12 +43,14 @@ class LdapMailAccountsPlugin extends AbstractPlugin
|
||||||
*/
|
*/
|
||||||
public function AddAdditionalLdapMailAccounts(Account $oAccount)
|
public function AddAdditionalLdapMailAccounts(Account $oAccount)
|
||||||
{
|
{
|
||||||
// Set up config
|
if ($oAccount instanceof MainAccount) {
|
||||||
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
|
// 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);
|
$this->Logger()->AddSecret($sPassword);
|
||||||
|
|
||||||
$oAccount = $this->LoginProcess($sEmail, $sPassword, $bSignMe);
|
$oAccount = $this->LoginProcess($sEmail, $sPassword, $bSignMe);
|
||||||
$this->Plugins()->RunHook('login.success', array($oAccount));
|
|
||||||
|
|
||||||
$this->SetAuthToken($oAccount);
|
$this->SetAuthToken($oAccount);
|
||||||
|
|
||||||
|
$this->Plugins()->RunHook('login.success', array($oAccount));
|
||||||
|
|
||||||
$sLanguage = $this->GetActionParam('Language', '');
|
$sLanguage = $this->GetActionParam('Language', '');
|
||||||
if ($oAccount && $sLanguage)
|
if ($oAccount && $sLanguage)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue