Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2018-10-15 11:01:12 +0300
committerAleksander Machniak <alec@alec.pl>2018-10-15 11:01:12 +0300
commitf1ee6d7906a0239e0595bf4638851602eab7d663 (patch)
tree6393bdd12a193c362ccbaa6fd0393dffffaa5c0c /index.php
parentccff7c83133617eba89014429fb2c2ebb2d16c60 (diff)
Plugin API: Add possibility to specify HTTP return code via 'unauthenticated' hook
Diffstat (limited to 'index.php')
-rw-r--r--index.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/index.php b/index.php
index 3f62d4cd0..9a31e03f1 100644
--- a/index.php
+++ b/index.php
@@ -241,11 +241,15 @@ if (empty($RCMAIL->user->ID)) {
));
}
- $plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array('task' => 'login', 'error' => $session_error));
+ $plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array(
+ 'task' => 'login',
+ 'error' => $session_error,
+ 'http_code' => !$session_error ? 401 : 200
+ ));
$RCMAIL->set_task($plugin['task']);
- if (!$session_error) {
+ if ($plugin['http_code'] == 401) {
header('HTTP/1.0 401 Unauthorized');
}