Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit a4299c5

Browse files
author
the-djmaze
committed
Fix extensions with login.credentials hook parameters
1 parent 2341dd9 commit a4299c5

File tree

6 files changed

+29
-27
lines changed

6 files changed

+29
-27
lines changed

plugins/ldap-login-mapping/index.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ class LDAPLoginMappingPlugin extends AbstractPlugin
88
{
99
const
1010
NAME = 'LDAP login mapping',
11-
VERSION = '2.2',
11+
VERSION = '2.3',
1212
AUTHOR = 'RainLoop Team, Ludovic Pouzenc<ludovic@pouzenc.fr>, ZephOne<zephone@protonmail.com>',
13-
RELEASE = '2024-03-12',
14-
REQUIRED = '2.35.3',
13+
RELEASE = '2024-09-20',
14+
REQUIRED = '2.36.1',
1515
CATEGORY = 'Login',
1616
DESCRIPTION = 'Enable custom mapping using ldap field';
1717
/**
@@ -79,12 +79,13 @@ public function Supported(): string
7979

8080
/**
8181
* @param string $sEmail
82-
* @param string $sLogin
82+
* @param string $sImapUser
8383
* @param string $sPassword
84+
* @param string $sSmtpUser
8485
*
8586
* @throws \RainLoop\Exceptions\ClientException
8687
*/
87-
public function FilterLoginСredentials(&$sEmail, &$sLogin, &$sPassword)
88+
public function FilterLoginСredentials(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
8889
{
8990
$this->oLogger = \RainLoop\Api::Logger();
9091

@@ -102,10 +103,10 @@ public function FilterLoginСredentials(&$sEmail, &$sLogin, &$sPassword)
102103
$sIP = $_SERVER['REMOTE_ADDR'];
103104
$sResult = $this->ldapSearch($sEmail);
104105
if ( is_array($sResult) ) {
105-
$sLogin = $sResult['login'];
106+
$sImapUser = $sResult['login'];
106107
$sEmail = $sResult['email'];
107108
}
108-
syslog(LOG_WARNING, "plugins/ldap-login-mapping/index.php:FilterLoginСredentials() auth try: $sIP/$sEmail, resolved as $sLogin/$sEmail");
109+
syslog(LOG_WARNING, "plugins/ldap-login-mapping/index.php:FilterLoginСredentials() auth try: $sIP/$sEmail, resolved as $sImapUser/$sEmail");
109110
}
110111
}
111112

plugins/ldap-mail-accounts/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class LdapMailAccountsPlugin extends AbstractPlugin
1212
{
1313
const
1414
NAME = 'LDAP Mail Accounts',
15-
VERSION = '2.2.0',
15+
VERSION = '2.2.1',
1616
AUTHOR = 'cm-schl',
1717
URL = 'https://github.com/cm-sch',
18-
RELEASE = '2024-05-28',
18+
RELEASE = '2024-09-20',
1919
REQUIRED = '2.36.1',
2020
CATEGORY = 'Accounts',
2121
DESCRIPTION = 'Add additional mail accounts the SnappyMail user has access to by a LDAP query. Basing on the work of FWest98 (https://github.com/FWest98).';
@@ -44,7 +44,7 @@ public function Init(): void
4444
* @param string &$sPassword
4545
* @param string &$sSmtpUser
4646
*/
47-
public function overwriteMainAccountEmail(&$sEmail, &$sImapUser, &$sPassword, &$sSmtpUser)
47+
public function overwriteMainAccountEmail(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
4848
{
4949
$this->Manager()->Actions()->Logger()->Write("Login DATA: login: $sImapUser email: $sEmail", \LOG_WARNING, "LDAP MAIL ACCOUNTS PLUGIN");
5050

@@ -100,7 +100,7 @@ protected function configMapping(): array
100100
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
101101
->SetDescription("SnappyMail saves the passwords of the additional accounts by encrypting them using a cryptkey that is saved in the file \".cryptkey\". When the password of the main account changes, SnappyMail asks the user for the old password to reencrypt the keys with the new userpassword.
102102
\nOn a password change using ldap (or when the password has been forgotten by the user) this makes problems and asks the user to insert the old password. Therefore activating this option overwrites the .cryptkey file on login in order to always accept the actual ldap password of the user.
103-
\nATTENTION: This has side effects on pgp keys because these are also secured by the cryptkey and could therefore not be accessible anymore!
103+
\nATTENTION: This has side effects on pgp keys because these are also secured by the cryptkey and could therefore not be accessible anymore!
104104
\nSee https://github.com/the-djmaze/snappymail/issues/1570#issuecomment-2085528061")
105105
->SetDefaultValue(false),
106106
]);

plugins/login-override/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ class LoginOverridePlugin extends \RainLoop\Plugins\AbstractPlugin
44
{
55
const
66
NAME = 'Login Override',
7-
VERSION = '2.3',
8-
RELEASE = '2024-03-12',
9-
REQUIRED = '2.35.3',
7+
VERSION = '2.4',
8+
RELEASE = '2024-09-20',
9+
REQUIRED = '2.36.1',
1010
CATEGORY = 'Filters',
1111
DESCRIPTION = 'Override IMAP/SMTP login credentials for specific users.';
1212

@@ -17,7 +17,7 @@ public function Init() : void
1717
$this->addHook('smtp.before-login', 'MapSmtpCredentials');
1818
}
1919

20-
public function MapEmailAddress(string &$sEmail, string &$sLogin, string &$sPassword)
20+
public function MapEmailAddress(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
2121
{
2222
$sMapping = \trim($this->Config()->Get('plugin', 'email_mapping', ''));
2323
if (!empty($sMapping)) {

plugins/login-remote/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class LoginRemotePlugin extends \RainLoop\Plugins\AbstractPlugin
66
NAME = 'Login Remote',
77
AUTHOR = 'SnappyMail',
88
URL = 'https://snappymail.eu/',
9-
VERSION = '1.4',
10-
RELEASE = '2024-03-27',
9+
VERSION = '1.5',
10+
RELEASE = '2024-09-20',
1111
REQUIRED = '2.36.1',
1212
CATEGORY = 'Login',
1313
LICENSE = 'MIT',
@@ -56,7 +56,7 @@ public function ServiceRemoteAutoLogin() : bool
5656
return true;
5757
}
5858

59-
public function FilterLoginCredentials(&$sEmail, &$sImapUser, &$sPassword, &$sSmtpUser)
59+
public function FilterLoginCredentials(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
6060
{
6161
// cPanel https://github.com/the-djmaze/snappymail/issues/697
6262
// && !empty($_ENV['CPANEL'])

plugins/login-virtuser/index.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ class LoginVirtuserPlugin extends \RainLoop\Plugins\AbstractPlugin
66
NAME = 'Virtuser Login',
77
AUTHOR = 'v20z',
88
URL = 'https://github.com/the-djmaze/snappymail/issues/1691',
9-
VERSION = '0.1',
10-
RELEASE = '2024-06-01',
11-
REQUIRED = '2.5.0',
9+
VERSION = '0.2',
10+
RELEASE = '2024-09-20',
11+
REQUIRED = '2.36.1',
1212
CATEGORY = 'Login',
1313
DESCRIPTION = 'File based Email-to-User lookup.';
1414

@@ -19,12 +19,13 @@ public function Init() : void
1919

2020
/**
2121
* @param string $sEmail
22-
* @param string $sLogin
22+
* @param string $sImapUser
2323
* @param string $sPassword
24+
* @param string $sSmtpUser
2425
*
2526
* @throws \RainLoop\Exceptions\ClientException
2627
*/
27-
public function ParseVirtuserFiles(&$sEmail, &$sLogin, &$sPassword)
28+
public function ParseVirtuserFiles(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
2829
{
2930
$sFiles = \trim($this->Config()->Get('plugin', 'virtuser_files', ''));
3031
if (!empty($sFiles))
@@ -46,7 +47,7 @@ public function ParseVirtuserFiles(&$sEmail, &$sLogin, &$sPassword)
4647
$aData = preg_split( '/[[:blank:]]+/', $sLine, 3, PREG_SPLIT_NO_EMPTY);
4748
if (is_array($aData) && !empty($aData[0]) && isset($aData[1])) {
4849
if ($sEmail === $aData[0] && 0 < strlen($aData[1])) {
49-
$sLogin = $aData[1];
50+
$sImapUser = $aData[1];
5051
return;
5152
}
5253
}

plugins/proxy-auth/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class ProxyAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
66
NAME = 'Proxy Auth',
77
AUTHOR = 'Philipp',
88
URL = 'https://www.mundhenk.org/',
9-
VERSION = '0.4',
10-
RELEASE = '2024-05-26',
9+
VERSION = '0.5',
10+
RELEASE = '2024-09-20',
1111
REQUIRED = '2.36.1',
1212
CATEGORY = 'Login',
1313
LICENSE = 'MIT',
@@ -41,7 +41,7 @@ private function ip_in_range( $ip, $range ) {
4141
return ( ( $ip_decimal & $netmask_decimal ) == ( $range_decimal & $netmask_decimal ) );
4242
}
4343

44-
public function MapEmailAddress(string &$sEmail, string &$sLogin, string &$sPassword)
44+
public function MapEmailAddress(string &$sEmail, string &$sImapUser, string &$sPassword, string &$sSmtpUser)
4545
{
4646
$oActions = \RainLoop\Api::Actions();
4747
$oLogger = $oActions->Logger();

0 commit comments

Comments
 (0)