openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3018e022f1c69b30edad511848ad75a33f3b4fe1
parent bacfbf09fa1f2477896efb1b74995c09bd535790
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 25 Oct 2012 23:47:08 +0200

Exception fangen, falls Benutzer nicht geladen werden kann.

Diffstat:
dispatcher.php | 2++
model/Value.class.php | 102++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 83 insertions(+), 21 deletions(-)

diff --git a/dispatcher.php b/dispatcher.php @@ -171,6 +171,7 @@ try } catch( ObjectNotFoundException $e ) { + Logger::warn( $e->__toString() ); Http::sendStatus(404,"Object not found","The requested object was not found." ); } catch( Exception $e ) @@ -233,6 +234,7 @@ try } catch( ObjectNotFoundException $e ) { + Logger::warn( $e->__toString() ); Http::sendStatus(404,"Object not found","The requested object was not found." ); } diff --git a/model/Value.class.php b/model/Value.class.php @@ -701,7 +701,6 @@ SQL case 'link': $objectid = $this->linkToObjectId; - if ( intval($objectid) == 0 ) $objectid = $this->element->defaultObjectId; @@ -853,62 +852,123 @@ SQL case 'create_user_desc': $user = $linkedObject->createUser; - $user->load(); - $inhalt = $user->desc; + try + { + $user->load(); + $inhalt = $user->desc; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'create_user_fullname': $user = $linkedObject->createUser; - $user->load(); - $inhalt = $user->fullname; + try + { + $user->load(); + $inhalt = $user->fullname; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'create_user_mail': $user = $linkedObject->createUser; - $user->load(); - $inhalt = $user->mail; + try + { + $user->load(); + $inhalt = $user->mail; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'create_user_tel': $user = $linkedObject->createUser; - $user->load(); - $inhalt = $user->tel; + try + { + $user->load(); + $inhalt = $user->tel; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'create_user_username': $user = $linkedObject->createUser; - $user->load(); - $inhalt = $user->name; + try + { + $user->load(); + $inhalt = $user->name; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'lastch_user_desc': $user = $linkedObject->lastchangeUser; - $user->load(); - $inhalt = $user->desc; + try + { + $user->load(); + $inhalt = $user->desc; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'lastch_user_fullname': $user = $linkedObject->lastchangeUser; - $user->load(); - $inhalt = $user->fullname; + try + { + $user->load(); + $inhalt = $user->fullname; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'lastch_user_mail': $user = $linkedObject->lastchangeUser; - $user->load(); - $inhalt = $user->mail; + try + { + $user->load(); + $inhalt = $user->mail; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'lastch_user_tel': $user = $linkedObject->lastchangeUser; - $user->load(); - $inhalt = $user->tel; + try + { + $user->load(); + $inhalt = $user->tel; + } + catch( ObjectNotFoundException $e ) + { + } + break; case 'lastch_user_username': $user = $linkedObject->lastchangeUser; - $user->load(); - $inhalt = $user->name; + try + { + $user->load(); + $inhalt = $user->name; + } + catch( ObjectNotFoundException $e ) + { + } break; case 'mime-type':