mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Revamp for #351
This commit is contained in:
parent
3522f76d37
commit
1dccfdba3b
4 changed files with 95 additions and 65 deletions
|
|
@ -52,7 +52,6 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// foreach (\glob(__DIR__ . '/../change-password-*', GLOB_ONLYDIR) as $file) {
|
||||
foreach (\glob(__DIR__ . '/drivers/*.php') as $file) {
|
||||
$name = \basename($file, '.php');
|
||||
$class = 'ChangePasswordDriver' . $name;
|
||||
|
|
@ -71,6 +70,25 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (\glob(__DIR__ . '/../change-password-*', GLOB_ONLYDIR) as $file) {
|
||||
$name = \str_replace('change-password-', '', \basename($file));
|
||||
$class = "ChangePassword{$name}Driver";
|
||||
$file .= '/driver.php';
|
||||
try
|
||||
{
|
||||
if (\is_readable($file) && ($all || $this->Config()->Get('plugin', "driver_{$name}_enabled", false))) {
|
||||
require_once $file;
|
||||
if ($class::isSupported()) {
|
||||
yield $name => $class;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Throwable $oException)
|
||||
{
|
||||
\trigger_error("ERROR {$class}: " . $oException->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function Supported() : string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue