mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Code refactoring
a lot of small fixes (Closes #173) Added login field (ownCloud package)
This commit is contained in:
parent
a059b3d063
commit
fed896776f
129 changed files with 1016 additions and 804 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePassword\ChangePasswordInterface
|
||||
class IspConfigChangePasswordDriver implements \RainLoop\Providers\ChangePassword\ChangePasswordInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
|
@ -16,7 +16,7 @@ class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePasswo
|
|||
* @var string
|
||||
*/
|
||||
private $sPassword = '';
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -26,13 +26,13 @@ class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePasswo
|
|||
* @var \MailSo\Log\Logger
|
||||
*/
|
||||
private $oLogger = null;
|
||||
|
||||
|
||||
/**
|
||||
* @param string $sDsn
|
||||
* @param string $sUser
|
||||
* @param string $sPassword
|
||||
*
|
||||
* @return \IspManagerChangePasswordDriver
|
||||
* @return \IspConfigChangePasswordDriver
|
||||
*/
|
||||
public function SetConfig($sDsn, $sUser, $sPassword)
|
||||
{
|
||||
|
|
@ -44,9 +44,9 @@ class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePasswo
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $aDomains
|
||||
* @param string $sAllowedEmails
|
||||
*
|
||||
* @return \IspManagerChangePasswordDriver
|
||||
* @return \IspConfigChangePasswordDriver
|
||||
*/
|
||||
public function SetAllowedEmails($sAllowedEmails)
|
||||
{
|
||||
|
|
@ -57,7 +57,7 @@ class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePasswo
|
|||
/**
|
||||
* @param \MailSo\Log\Logger $oLogger
|
||||
*
|
||||
* @return \IspManagerChangePasswordDriver
|
||||
* @return \IspConfigChangePasswordDriver
|
||||
*/
|
||||
public function SetLogger($oLogger)
|
||||
{
|
||||
|
|
@ -140,12 +140,12 @@ class IspManagerChangePasswordDriver implements \RainLoop\Providers\ChangePasswo
|
|||
{
|
||||
$sSalt = '';
|
||||
$sBase64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
|
||||
|
||||
for ($iIndex = 0; $iIndex < 8; $iIndex++)
|
||||
{
|
||||
$sSalt .= $sBase64[\rand(0, 63)];
|
||||
}
|
||||
|
||||
|
||||
return \crypt($sPassword, '$1$'.$sSalt.'$');
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
Plugin that adds functionality to change the email account password (ISPmanager).
|
||||
Plugin that adds functionality to change the email account password (ISPConfig).
|
||||
1
plugins/ispconfig-change-password/VERSION
Normal file
1
plugins/ispconfig-change-password/VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
1.1
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class IspmanagerChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
class IspconfigChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
public function Init()
|
||||
{
|
||||
|
|
@ -22,7 +22,7 @@ class IspmanagerChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
return 'The PHP exention PDO (mysql) must be installed to use this plugin';
|
||||
}
|
||||
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
@ -42,9 +42,9 @@ class IspmanagerChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
if (!empty($sDsn) && 0 < \strlen($sUser) && 0 < \strlen($sPassword))
|
||||
{
|
||||
include_once __DIR__.'/IspManagerChangePasswordDriver.php';
|
||||
include_once __DIR__.'/IspConfigChangePasswordDriver.php';
|
||||
|
||||
$oProvider = new IspManagerChangePasswordDriver();
|
||||
$oProvider = new IspConfigChangePasswordDriver();
|
||||
$oProvider->SetLogger($this->Manager()->Actions()->Logger());
|
||||
$oProvider->SetConfig($sDsn, $sUser, $sPassword);
|
||||
$oProvider->SetAllowedEmails(\strtolower(\trim($this->Config()->Get('plugin', 'allowed_emails', ''))));
|
||||
|
|
@ -60,7 +60,7 @@ class IspmanagerChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
public function configMapping()
|
||||
{
|
||||
return array(
|
||||
\RainLoop\Plugins\Property::NewInstance('pdo_dsn')->SetLabel('ISPmanager PDO dsn')
|
||||
\RainLoop\Plugins\Property::NewInstance('pdo_dsn')->SetLabel('ISPConfig PDO dsn')
|
||||
->SetDefaultValue('mysql:host=127.0.0.1;dbname=dbispconfig'),
|
||||
\RainLoop\Plugins\Property::NewInstance('user')->SetLabel('DB User')
|
||||
->SetDefaultValue('root'),
|
||||
|
|
@ -1 +0,0 @@
|
|||
1.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue