The best way to learn how to use the WebCore is by example. See the documentation for more information.

The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.

Source for: https://www.earthli.com/news/access_denied.php

Uses WebCore template(s):

00 <?php
01
02 /****************************************************************************
03  
04 Copyright (c) 2002-2014 Marco Von Ballmoos
05  
06 This file is part of earthli Projects.
07  
08 earthli Projects is free software; you can redistribute it and/or modify
09 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12  
13 earthli Projects is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17  
18 You should have received a copy of the GNU General Public License
19 along with earthli Projects; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  
22 For more information about the earthli News, visit:
23  
24 http://www.earthli.com/software/webcore/news
25  
26 ****************************************************************************/
27   
28   require_once ('news/start.php');
29   require_once ($App->page_template_for ('webcore/pages/access_denied.php'));
30 ?>
31

Source for template: webcore/pages/access_denied.php

00 <?php
01
02 /****************************************************************************
03  
04 Copyright (c) 2002-2014 Marco Von Ballmoos
05  
06 This file is part of earthli WebCore.
07  
08 earthli WebCore is free software; you can redistribute it and/or modify
09 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12  
13 earthli WebCore is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17  
18 You should have received a copy of the GNU General Public License
19 along with earthli WebCore; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  
22 For more information about the earthli WebCore, visit:
23  
24 http://www.earthli.com/software/webcore
25  
26 ****************************************************************************/
27  
28   $class_name = $App->final_class_name ('LOG_IN_FORM', 'webcore/forms/log_in_form.php');
29   /** @var LOG_IN_FORM $form */
30   $form = new $class_name ($App);
31  
32   $Page->title->subject = 'Access denied';
33  
34   $form->process_plain ();
35   $last_page = urldecode ($form->value_for ('last_page'));
36  
37   if ($form->committed ())
38   {
39     $Env->redirect_root ($last_page);
40   }
41   else
42   {
43     if ($form->submitted ())
44     {
45       $Page->title->subject = 'Login Failed';
46     }
47   }
48  
49   $Page->location->add_root_link ();
50   $Page->location->append('Access denied', '', '{icons}buttons/security');
51   $Page->start_display ();
52 ?>
53 <div class="main-box">
54   <?php
55     if (empty ($last_page))
56     {
57       $last_page = 'unknown location';
58     }
59     $error_message = read_var ('error_message');
60     if (empty ($error_message))
61     {
62       $error_message = 'You are not allowed to perform that operation.';
63     }
64   ?>
65   <div class="message-box">
66     <p class="title"><?php echo $error_message; ?></p>
67     <div class="description">
68       <p>Access to &lt;<a href="<?php echo $last_page; ?>"><?php echo $last_page; ?></a>&gt; was denied for this user.</p>
69   <?php if ($App->login->is_anonymous ()) { ?>
70       <p>Log in below to try again as a registered user.</p>
71   <?php } else { ?>
72       <p>You are logged in as <?php echo $App->login->title_as_link (); ?>. If you have another account with the proper permissions, log in below to try again as that user.</p>
73   <?php } ?>
74     </div>
75   </div>
76   <div class="form-content">
77   <?php
78     $form->display ();
79   ?>
80   </div>
81 </div>
82 <?php
83   $Page->finish_display ();
84 ?>