@@ -32,6 +32,11 @@ $object_user = (
3232 !is_null ( $ object_user_id ) ? new User ( $ object_user_id ) : null
3333);
3434
35+ if ( !$ object instanceof Event ) {
36+ $ title = 'Event Not Found ' ;
37+ $ description = 'The event you tried to access could not be found. ' ;
38+ }
39+
3540$ tpl_user = (
3641 is_null ( $ object_user ) ? '<em>(null)</em> ' :
3742 '<a href=" ' . $ object_user ->getURI () . '"><img class="avatar" src=" ' .
@@ -49,7 +54,7 @@ $tpl_metadata = (
4954
5055$ tpl_referer = getenv ( 'HTTP_REFERER ' );
5156if ( !empty ( $ tpl_referer )) {
52- $ tpl_referer = '<hr/>< a href=" ' . filter_var (
57+ $ tpl_referer = '<a href=" ' . filter_var (
5358 $ tpl_referer , FILTER_SANITIZE_FULL_SPECIAL_CHARS
5459 ) . '"><< Back to Previous</a> ' ;
5560}
@@ -64,11 +69,19 @@ $this->additional_css[] = '/a/forms.css';
6469require ('./header.inc.phtml ' );
6570?>
6671 <article>
67- <?php if (!$ this ->getContext ()->acl_allowed ) { ?>
72+ <?php if ( !$ this ->getContext ()->acl_allowed ) { ?>
6873 <header class="red"><?php echo $ title ; ?> </header>
6974 <section class="red">
7075 <p>You are not authorized to view this page.</p>
7176 </section>
77+ <?php } else if ( is_null ( $ object )) { $ title = 'Event Not Found ' ?>
78+ <header class="red"><?php echo $ title ; ?> </header>
79+ <section class="red">
80+ <p><?php echo $ description ; ?> </p>
81+ <?php if ( !empty ( $ tpl_referer )) { ?>
82+ <p><?php echo $ tpl_referer ; ?> </p>
83+ <?php } ?>
84+ </section>
7285<?php } else { ?>
7386 <header><?php echo $ title ; ?> </header>
7487 <section>
@@ -81,7 +94,10 @@ require('./header.inc.phtml');
8194 <tr><th class="right">User Account</th><td><?php echo $ tpl_user ; ?> </td></tr>
8295 <tr><th class="right" style="vertical-align:top;">Metadata</th><td><?php echo $ tpl_metadata ; ?> </td></tr>
8396 </tbody>
84- </table><?php echo $ tpl_referer ; ?>
97+ </table>
98+ <?php if ( !empty ( $ tpl_referer )) { ?>
99+ <hr/><p><?php echo $ tpl_referer ; ?> </p>
100+ <?php } ?>
85101 </section>
86102 </article>
87103<?php } ?>
0 commit comments