From b2034fdfec040a67988e543a911208ef2491ce7a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Sun, 22 Feb 2015 12:58:46 +0100 Subject: New RoundCube Plugins Git folder --- password/drivers/dbmail.php | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 password/drivers/dbmail.php (limited to 'password/drivers/dbmail.php') diff --git a/password/drivers/dbmail.php b/password/drivers/dbmail.php new file mode 100644 index 0000000..1207283 --- /dev/null +++ b/password/drivers/dbmail.php @@ -0,0 +1,70 @@ +config->get('password_dbmail_args', ''); + $command = "$curdir/chgdbmailusers -c $username -w $password $args"; + + if (strlen($command) > 1024) { + rcube::raise_error(array( + 'code' => 600, + 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Password plugin: The command is too long." + ), true, false); + + return PASSWORD_ERROR; + } + + exec($command, $output, $returnvalue); + + if ($returnvalue == 0) { + return PASSWORD_SUCCESS; + } + else { + rcube::raise_error(array( + 'code' => 600, + 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Password plugin: Unable to execute $curdir/chgdbmailusers" + ), true, false); + } + + return PASSWORD_ERROR; + } +} -- cgit v1.2.3