mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-24 22:25:09 +03:00
Compare commits
4 commits
b5c1be34c2
...
870df2d861
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
870df2d861 | ||
|
|
343ef172d1 | ||
|
|
bca01170a4 | ||
|
|
ddf28c299c |
10 changed files with 9 additions and 90 deletions
|
|
@ -107,7 +107,7 @@ class LDAPLoginMappingPlugin extends AbstractPlugin
|
|||
$sSmtpUser = $sResult['login'];
|
||||
$sEmail = $sResult['email'];
|
||||
}
|
||||
syslog(LOG_WARNING, "plugins/ldap-login-mapping/index.php:FilterLoginСredentials() auth try: $sIP/$sEmail, resolved as $sImapUser/$sEmail");
|
||||
syslog(LOG_WARNING, "plugins/ldap-login-mapping/index.php:FilterLoginCredentials() auth try: $sIP/$sEmail, resolved as $sImapUser/$sEmail");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
private static function getQRCode(MainAccount $oAccount, string $secret) : string
|
||||
{
|
||||
$email = \rawurlencode($oAccount->Email());
|
||||
// $issuer = \rawurlencode(\RainLoop\API::Config()->Get('webmail', 'title', 'SnappyMail'));
|
||||
// $issuer = \rawurlencode(\RainLoop\Api::Config()->Get('webmail', 'title', 'SnappyMail'));
|
||||
$QR = \SnappyMail\QRCode::getMinimumQRCode(
|
||||
// "otpauth://totp/{$issuer}:{$email}?secret={$secret}&issuer={$issuer}",
|
||||
"otpauth://totp/{$email}?secret={$secret}",
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Settings extends \MailSo\Net\ConnectSettings
|
|||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$oConfig = \RainLoop\API::Config();
|
||||
$oConfig = \RainLoop\Api::Config();
|
||||
$this->viewErrors = !!$oConfig->Get('labs', 'smtp_show_server_errors', false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ class ServiceActions
|
|||
}
|
||||
|
||||
/**
|
||||
* Login with the \RainLoop\API::CreateUserSsoHash() generated hash
|
||||
* Login with the \RainLoop\Api::CreateUserSsoHash() generated hash
|
||||
*/
|
||||
public function ServiceSso() : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
<?php
|
||||
|
||||
if (\PHP_VERSION_ID < 80000)
|
||||
{
|
||||
interface Stringable
|
||||
{
|
||||
public function __toString() : string;
|
||||
}
|
||||
|
||||
if (!class_exists('ValueError')) {
|
||||
class ValueError extends Error
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('str_contains')) {
|
||||
function str_contains(string $haystack, string $needle) : bool
|
||||
{
|
||||
return false !== strpos($haystack, $needle);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('str_starts_with')) {
|
||||
function str_starts_with(string $haystack, string $needle) : bool
|
||||
{
|
||||
return 0 === strncmp($haystack, $needle, strlen($needle));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('str_ends_with')) {
|
||||
function str_ends_with(string $haystack, string $needle) : bool
|
||||
{
|
||||
$length = strlen($needle);
|
||||
return $length ? substr($haystack, -$length) === $needle : true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_debug_type')) {
|
||||
function get_debug_type($value): string
|
||||
{
|
||||
$type = gettype($value);
|
||||
switch ($type) {
|
||||
case 'NULL': return 'null';
|
||||
case 'boolean': return 'bool';
|
||||
case 'double': return 'float';
|
||||
case 'integer': return 'int';
|
||||
case 'object':
|
||||
// if ($value instanceof __PHP_Incomplete_Class) return '__PHP_Incomplete_Class';
|
||||
$class = get_class($value);
|
||||
if (false === strpos($class, '@')) {
|
||||
return $class;
|
||||
}
|
||||
$parent = get_parent_class($class);
|
||||
if ($parent) {
|
||||
return $parent . '@anonymous';
|
||||
}
|
||||
$implements = class_implements($class);
|
||||
if ($implements) {
|
||||
return key($implements) . '@anonymous';
|
||||
}
|
||||
return 'class@anonymous';
|
||||
case 'resource':
|
||||
$type = get_resource_type($value);
|
||||
if (null === $type) {
|
||||
return 'unknown';
|
||||
}
|
||||
if ('Unknown' === $type) {
|
||||
$type = 'closed';
|
||||
}
|
||||
return "resource ($type)";
|
||||
default:
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -487,7 +487,7 @@ abstract class Base
|
|||
|
||||
protected static function findBinary($name) : ?string
|
||||
{
|
||||
$binary = \function_exists('shell_exec') ? \trim((string) \shell_exec('which $name')) : '';
|
||||
$binary = \function_exists('shell_exec') ? \trim((string) \shell_exec('which ' . \escapeshellarg($name))) : '';
|
||||
if ($binary && \RainLoop\Utils::inOpenBasedir($binary) && \is_executable($binary)) {
|
||||
return $binary;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class PGP extends Base implements \SnappyMail\PGP\PGPInterface
|
|||
// How to use gpgme-json ?
|
||||
$this->binary = static::findBinary('gpg');
|
||||
|
||||
$info = \preg_replace('/\R +/', ' ', `$this->binary --with-colons --list-config`);
|
||||
$info = \preg_replace('/\R +/', ' ', \shell_exec(\escapeshellcmd($this->binary) . ' --with-colons --list-config'));
|
||||
if (\preg_match('/cfg:version:([0-9]+\\.[0-9]+\\.[0-9]+)/', $info, $match)) {
|
||||
$this->version = $match[1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class SMIME extends Base
|
|||
// How to use gpgme-json ?
|
||||
$this->binary = static::findBinary('gpgsm');
|
||||
|
||||
$info = \preg_replace('/\R +/', ' ', \shell_exec("{$this->binary} --version"));
|
||||
$info = \preg_replace('/\R +/', ' ', \shell_exec(\escapeshellcmd($this->binary) . ' --version') );
|
||||
if (\preg_match('/gpgsm.+([0-9]+\\.[0-9]+\\.[0-9]+)/', $info, $match)) {
|
||||
$this->version = $match[1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ abstract class Integrity
|
|||
|
||||
public static function phpVersion()
|
||||
{
|
||||
if (PHP_VERSION_ID < 70400) {
|
||||
return 'Your PHP version ('.PHP_VERSION.') is lower than the minimal required 7.4.0!';
|
||||
if (PHP_VERSION_ID < 80200) {
|
||||
return 'Your PHP version ('.PHP_VERSION.') is lower than the minimal required 8.2.0!';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,6 @@ if (defined('APP_VERSION_ROOT_PATH')) {
|
|||
return;
|
||||
}
|
||||
|
||||
// PHP 8
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
require __DIR__ . '/app/libraries/polyfill/php8.php';
|
||||
}
|
||||
|
||||
if (!extension_loaded('ctype')) {
|
||||
require __DIR__ . '/app/libraries/polyfill/ctype.php';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue