diff options
author | Aleksander Machniak <alec@alec.pl> | 2018-10-15 11:01:12 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2018-10-15 11:01:12 +0300 |
commit | f1ee6d7906a0239e0595bf4638851602eab7d663 (patch) | |
tree | 6393bdd12a193c362ccbaa6fd0393dffffaa5c0c /index.php | |
parent | ccff7c83133617eba89014429fb2c2ebb2d16c60 (diff) |
Plugin API: Add possibility to specify HTTP return code via 'unauthenticated' hook
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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'); } |