mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Resolve Issue #93
This commit is contained in:
parent
5a6c012b60
commit
d67cfaa3a4
13 changed files with 169 additions and 6 deletions
42
plugins/login-register/index.php
Normal file
42
plugins/login-register/index.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
class LoginRegisterPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
const
|
||||
NAME = 'Register and Forgot',
|
||||
VERSION = '2.0',
|
||||
RELEASE = '2021-06-01',
|
||||
REQUIRED = '2.5.2',
|
||||
CATEGORY = 'Login',
|
||||
DESCRIPTION = 'Links on login screen for registration and forgot password';
|
||||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->UseLangs(true);
|
||||
$this->addJs('LoginRegister.js');
|
||||
$this->addHook('filter.app-data', 'FilterAppData');
|
||||
}
|
||||
|
||||
public function configMapping() : array
|
||||
{
|
||||
return [
|
||||
\RainLoop\Plugins\Property::NewInstance("forgot_password_link_url")
|
||||
// ->SetLabel('TAB_LOGIN/LABEL_FORGOT_PASSWORD_LINK_URL')
|
||||
->SetLabel('Forgot password url')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::URL),
|
||||
\RainLoop\Plugins\Property::NewInstance("registration_link_url")
|
||||
// ->SetLabel('TAB_LOGIN/LABEL_REGISTRATION_LINK_URL')
|
||||
->SetLabel('Register url')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::URL),
|
||||
];
|
||||
}
|
||||
|
||||
public function FilterAppData($bAdmin, &$aResult)
|
||||
{
|
||||
if (!$bAdmin && \is_array($aResult) && empty($aResult['Auth'])) {
|
||||
$aResult['forgotPasswordLinkUrl'] = \trim($this->Config()->Get('plugin', 'forgot_password_link_url', ''));
|
||||
$aResult['registrationLinkUrl'] = \trim($this->Config()->Get('plugin', 'registration_link_url', ''));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue