[icinga-checkins] icinga.org: icinga-web/r1.6: * Json unauthorized error fix
git at icinga.org
git at icinga.org
Tue Jan 31 13:51:40 CET 2012
Module: icinga-web
Branch: r1.6
Commit: f8a0598d065cc175382cc5d94ecba81cfd42f554
URL: https://git.icinga.org/?p=icinga-web.git;a=commit;h=f8a0598d065cc175382cc5d94ecba81cfd42f554
Author: Marius Hein <marius.hein at netways.de>
Date: Tue Jan 31 13:51:25 2012 +0100
* Json unauthorized error fix
---
.../AppKit/views/SecureSuccessView.class.php | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/app/modules/AppKit/views/SecureSuccessView.class.php b/app/modules/AppKit/views/SecureSuccessView.class.php
index 0a6a455..a286711 100644
--- a/app/modules/AppKit/views/SecureSuccessView.class.php
+++ b/app/modules/AppKit/views/SecureSuccessView.class.php
@@ -1,12 +1,27 @@
<?php
class AppKit_SecureSuccessView extends AppKitBaseView {
+
+ public function initialize(AgaviExecutionContainer $container) {
+ parent::initialize($container);
+ }
+
+ private function sendHeader() {
+ $this->getResponse()->setHttpStatusCode('401');
+ }
+
public function executeHtml(AgaviRequestDataHolder $rd) {
+ $this->sendHeader();
$this->setAttribute('_title', 'Access Denied');
-
$this->setupHtml($rd);
+ }
- $this->getResponse()->setHttpStatusCode('401');
+
+ public function executeJson(AgaviRequestDataHolder $rd) {
+ return json_encode(array(
+ 'success' => false,
+ 'errors' => array('401 unauthorized')
+ ));
}
}
More information about the icinga-checkins
mailing list