/templates/Backup/header.html
HTML | 90 lines | 73 code | 8 blank | 9 comment | 0 complexity | 0e456d9dc5003b347fdc34d0d191e232 MD5 | raw file
- <!--
- RMH Homebase is free software.
- It comes with absolutely no warranty.
- You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
- -->
- <!-- Begin Header -->
- <style type="{{STATIC_URL}}css/styles.css">
- h1 {padding-left: 0px; padding-right:165px;}
- </style>
- <div id="header">
- <!--<br><br><img src="images/rmhHeader.gif" align="center"><br>
- <h1><br><br>RMH Homebase <br></h1>-->
- </div>
- <div align="center" id="navigationLinks">
- <?PHP
- //Log-in security
- //If they aren't logged in, display our log-in form.
- if(!isset($_SESSION['logged_in'])){
- include('login_form.php');
- die();
- }
- else if($_SESSION['logged_in']){
- /**Set our permission array.
- * anything a guest can do, a volunteer and house manager can also do
- * anything a volunteer can do, a house manager can do.
- *
- * If a page is not specified in the permission array, anyone logged into the system
- * can view it. If someone logged into the system attempts to access a page above their
- * permission level, they will be sent back to the home page.
- */
- //pages guests are allowed to view
- $permission_array['index.php']=0;
- $permission_array['about.php']=0;
- $permission_array['apply.php']=0;
- //pages volunteers can view
- $permission_array['viewPerson.php']=1;
- $permission_array['searchPeople.php']=1;
- $permission_array['calendar.php']=1;
- $permission_array['view.php']=1;
- $permission_array['edit.php']=1;
- $permission_array['masterSchedule.php']=1;
- $permission_array['addWeek.php']=1;
- //pages only managers can view
- $permission_array['rmh.php']=2;
- $permission_array['log.php']=2;
- //Check if they're at a valid page for their access level.
- $current_page = substr($_SERVER['PHP_SELF'],1);
- /* if($permission_array[$current_page]>$_SESSION['access_level']){
- //in this case, the user doesn't have permission to view this page.
- //we redirect them to the index page.
- echo "<script type=\"text/javascript\">window.location = \"index.php\";</script>";
- //note: if javascript is disabled for a user's browser, it would still show the page.
- //so we die().
- die();
- }
- */
- //This line gives us the path to the html pages in question, useful if the server isn't installed @ root.
- $path = strrev(substr(strrev($_SERVER['SCRIPT_NAME']),strpos(strrev($_SERVER['SCRIPT_NAME']),'/')));
- //they're logged in and session variables are set.
- if($_SESSION['access_level']>=0){
- echo('<a href="'.$path.'index.php">home</a> | ');
- echo('<a href="'.$path.'about.php">about</a>');
- }
- if ($_SESSION['access_level']==0)
- echo(' | <a href="'.$path.'personEdit.php?id='.'new'.'">apply</a>');
- if($_SESSION['access_level']>=1){
- echo(' | <strong>calendar :</strong> <a href="'.$path.'calendar.php">house,</a> <a href="'.$path.'calendarFam.php">family room</a> | ');
- echo('<strong>people :</strong> <a href="'.$path.'view.php">view,</a> <a href="'.$path.'searchPeople.php">search</a>');
- }
- if($_SESSION['access_level']>=2){
- echo('<a href="personEdit.php?id='.'new'.'">, add</a><br> ' .
- '<strong>master schedule :</strong> <a href="'.$path.'masterSchedule.php">house,</a> ' .
- '<a href="'.$path.'masterScheduleFam.php">family room</a> ' .
- '| <a href="'.$path.'log.php">log</a>');
- }
- if($_SESSION['access_level']>=1)
- echo(' | <a href="'.$path.'help.php?helpPage='.$current_page.'" target="_BLANK">help</a>');
- echo( ' | <a href="'.$path.'logout.php">logout</a> <br>');
- }
- ?>
- </div>
- <!-- End Header -->