PageRenderTime 46ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/Backup/header.html

https://bitbucket.org/bookram/rmhhomebase
HTML | 90 lines | 73 code | 8 blank | 9 comment | 0 complexity | 0e456d9dc5003b347fdc34d0d191e232 MD5 | raw file
  1. <!--
  2. RMH Homebase is free software.
  3. It comes with absolutely no warranty.
  4. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
  5. -->
  6. <!-- Begin Header -->
  7. <style type="{{STATIC_URL}}css/styles.css">
  8. h1 {padding-left: 0px; padding-right:165px;}
  9. </style>
  10. <div id="header">
  11. <!--<br><br><img src="images/rmhHeader.gif" align="center"><br>
  12. <h1><br><br>RMH Homebase <br></h1>-->
  13. </div>
  14. <div align="center" id="navigationLinks">
  15. <?PHP
  16. //Log-in security
  17. //If they aren't logged in, display our log-in form.
  18. if(!isset($_SESSION['logged_in'])){
  19. include('login_form.php');
  20. die();
  21. }
  22. else if($_SESSION['logged_in']){
  23. /**Set our permission array.
  24. * anything a guest can do, a volunteer and house manager can also do
  25. * anything a volunteer can do, a house manager can do.
  26. *
  27. * If a page is not specified in the permission array, anyone logged into the system
  28. * can view it. If someone logged into the system attempts to access a page above their
  29. * permission level, they will be sent back to the home page.
  30. */
  31. //pages guests are allowed to view
  32. $permission_array['index.php']=0;
  33. $permission_array['about.php']=0;
  34. $permission_array['apply.php']=0;
  35. //pages volunteers can view
  36. $permission_array['viewPerson.php']=1;
  37. $permission_array['searchPeople.php']=1;
  38. $permission_array['calendar.php']=1;
  39. $permission_array['view.php']=1;
  40. $permission_array['edit.php']=1;
  41. $permission_array['masterSchedule.php']=1;
  42. $permission_array['addWeek.php']=1;
  43. //pages only managers can view
  44. $permission_array['rmh.php']=2;
  45. $permission_array['log.php']=2;
  46. //Check if they're at a valid page for their access level.
  47. $current_page = substr($_SERVER['PHP_SELF'],1);
  48. /* if($permission_array[$current_page]>$_SESSION['access_level']){
  49. //in this case, the user doesn't have permission to view this page.
  50. //we redirect them to the index page.
  51. echo "<script type=\"text/javascript\">window.location = \"index.php\";</script>";
  52. //note: if javascript is disabled for a user's browser, it would still show the page.
  53. //so we die().
  54. die();
  55. }
  56. */
  57. //This line gives us the path to the html pages in question, useful if the server isn't installed @ root.
  58. $path = strrev(substr(strrev($_SERVER['SCRIPT_NAME']),strpos(strrev($_SERVER['SCRIPT_NAME']),'/')));
  59. //they're logged in and session variables are set.
  60. if($_SESSION['access_level']>=0){
  61. echo('<a href="'.$path.'index.php">home</a> | ');
  62. echo('<a href="'.$path.'about.php">about</a>');
  63. }
  64. if ($_SESSION['access_level']==0)
  65. echo(' | <a href="'.$path.'personEdit.php?id='.'new'.'">apply</a>');
  66. if($_SESSION['access_level']>=1){
  67. echo(' | <strong>calendar :</strong> <a href="'.$path.'calendar.php">house,</a> <a href="'.$path.'calendarFam.php">family room</a> | ');
  68. echo('<strong>people :</strong> <a href="'.$path.'view.php">view,</a> <a href="'.$path.'searchPeople.php">search</a>');
  69. }
  70. if($_SESSION['access_level']>=2){
  71. echo('<a href="personEdit.php?id='.'new'.'">, add</a><br> ' .
  72. '<strong>master schedule :</strong> <a href="'.$path.'masterSchedule.php">house,</a> ' .
  73. '<a href="'.$path.'masterScheduleFam.php">family room</a> ' .
  74. '| <a href="'.$path.'log.php">log</a>');
  75. }
  76. if($_SESSION['access_level']>=1)
  77. echo(' | <a href="'.$path.'help.php?helpPage='.$current_page.'" target="_BLANK">help</a>');
  78. echo( ' | <a href="'.$path.'logout.php">logout</a> <br>');
  79. }
  80. ?>
  81. </div>
  82. <!-- End Header -->