[icinga-checkins] icinga.org: icinga-web/mhein/extlayout: * Fixed compatibility issues with PHP 5.3.2

git at icinga.org git at icinga.org
Tue May 11 19:18:11 CEST 2010


Module: icinga-web
Branch: mhein/extlayout
Commit: 94496c00678625408e8676782f09bc4a856b784b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=94496c00678625408e8676782f09bc4a856b784b

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Wed May  5 14:54:53 2010 +0200

* Fixed compatibility issues with PHP 5.3.2

---

 app/modules/AppKit/templates/Ext/HeaderSuccess.php |    1 -
 .../Widgets/SquishLoaderSuccessView.class.php      |    2 ++
 lib/appkit/AppKit.class.php                        |   11 +++++++++--
 lib/appkit/auth/AppKitSecurityUser.class.php       |    6 +++---
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/app/modules/AppKit/templates/Ext/HeaderSuccess.php b/app/modules/AppKit/templates/Ext/HeaderSuccess.php
index 1330fd2..6558ee1 100644
--- a/app/modules/AppKit/templates/Ext/HeaderSuccess.php
+++ b/app/modules/AppKit/templates/Ext/HeaderSuccess.php
@@ -8,7 +8,6 @@
 ?>
 <script type="text/javascript">
 Ext.onReady(function() {
-	
 	var UserMenu = (function() {
 	    var pub = {};
 	    var _LA = AppKit.util.Layout;
diff --git a/app/modules/AppKit/views/Widgets/SquishLoaderSuccessView.class.php b/app/modules/AppKit/views/Widgets/SquishLoaderSuccessView.class.php
index edd788d..bc1f5c5 100644
--- a/app/modules/AppKit/views/Widgets/SquishLoaderSuccessView.class.php
+++ b/app/modules/AppKit/views/Widgets/SquishLoaderSuccessView.class.php
@@ -30,6 +30,8 @@ class AppKit_Widgets_SquishLoaderSuccessView extends AppKitBaseView
 		$out = null;
 		foreach ($actions as $a) {
 			$p = array ();
+			if(!isset($a['arguments']))
+				$a['arguments'] = false;
 			if (is_array($a['arguments'])) $p = $a['arguments'];
 			$a['arguments']['is_slot'] = true;
 			$r = $this->createForwardContainer($a['module'], $a['action'], $p, $a['output_type'])
diff --git a/lib/appkit/AppKit.class.php b/lib/appkit/AppKit.class.php
index 7aff387..bd75445 100644
--- a/lib/appkit/AppKit.class.php
+++ b/lib/appkit/AppKit.class.php
@@ -296,9 +296,14 @@ class AppKit {
 	private static function setLanguageDomain() {
 		try {
 			$context = AgaviContext::getInstance(AgaviConfig::get('core.default_context'));
-			$user = $context->getUser()->getNsmUser();
+			$user = $context->getUser();	
+			if($user) {		
+				$user = $user->getNsmUser(true);
+			}
+		
 			if(!$user)
 				return true;
+		
 			$translationMgr = $context->getTranslationManager();		
 			$locale = $user->getPrefVal("de.icinga.appkit.locale",$translationMgr->getDefaultLocaleIdentifier());
 			try {
@@ -306,8 +311,10 @@ class AppKit {
 			} catch(Exception $e) {
 				$translationMgr->setLocale($translationMgr->getDefaultLocaleIdentifier());
 			}
-		} catch(Exception $e) {
 			return true;
+		
+		} catch(AppKitDoctrineException $e) {
+			return true;	
 		}
 	}
 }
diff --git a/lib/appkit/auth/AppKitSecurityUser.class.php b/lib/appkit/auth/AppKitSecurityUser.class.php
index 641ad55..e1b339d 100644
--- a/lib/appkit/auth/AppKitSecurityUser.class.php
+++ b/lib/appkit/auth/AppKitSecurityUser.class.php
@@ -142,13 +142,13 @@ class AppKitSecurityUser extends AgaviRbacSecurityUser {
 	 * @throws AppKitDoctrineException
 	 * @author Marius Hein
 	 */
-	public function getNsmUser() {
+	public function getNsmUser($noThrow = false) {
 		$user =& $this->getAttribute(self::USEROBJ_ATTRIBUTE);
 		if ($user instanceof NsmUser) {
 			return $user;
 		}
-		
-		throw new AppKitDoctrineException('User attribute is no a NsmUser!');
+		if(!$noThrow)
+			throw new AppKitDoctrineException('User attribute is no a NsmUser!');
 	}
 	
 	/**





More information about the icinga-checkins mailing list