home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / admin / header_main.inc < prev    next >
Encoding:
Text File  |  2003-12-27  |  2.7 KB  |  100 lines

  1. <?php
  2. /////////////////////////////////////////////////////////
  3. //    
  4. //    include/header_main.inc
  5. //
  6. //    (C)Copyright 2001-2002 Ryo Chijiiwa <Ryo@IlohaMail.org>
  7. //
  8. //    This file is part of IlohaMail. IlohaMail is free software released 
  9. //    under the GPL license.  See enclosed file COPYING for details, or 
  10. //    see http://www.fsf.org/copyleft/gpl.html
  11. //
  12. /////////////////////////////////////////////////////////
  13.  
  14. /********************************************************
  15.  
  16.     PURPOSE:
  17.         Provide header and initialization functionality common to many pages.
  18.         Including:
  19.             1.  Display HTML header    
  20.                     (including BODY tag with colors set according to user prefs)
  21.             2.  Read user preferences into $my_prefs and $my_colors arrays
  22.     PRE-CONDITIONS:
  23.         $user - Session ID
  24.     COMMENTS:
  25.         Reading preferences into array is actually done in "include/session_auth.inc"
  26.  
  27. ********************************************************/
  28. include_once("../include/nocache.inc");
  29. include_once("../conf/conf.inc");
  30. include_once("../conf/db_conf.php");
  31.  
  32. //disable time limit
  33. if(!ini_get("safe_mode")){
  34.     @set_time_limit($MAX_EXEC_TIME);
  35. }
  36.  
  37. //get current page
  38. $current_page = $_SERVER["PHP_SELF"];
  39. $pos = strrpos($current_page, "/");
  40. if ($pos !== false){
  41.     $current_page = substr($current_page, $pos+1);
  42. }
  43.  
  44. //setup code for onLoad and onUnload
  45. $onUnLoad = "";
  46. if (strpos($current_page, "compose2.php")!==false) {
  47.     $onUnLoad = " onUnload=\"close_popup();\"";
  48. }
  49. $onLoad = "";
  50. if (strpos($current_page, "contacts_popup.php")!==false) {
  51.     $onLoad = " onLoad=\"acknowledge_popup();\"";
  52.     $onUnLoad = " onUnLoad=\"alert_close();\"";
  53. }
  54.  
  55. //continue only if valid session ID
  56. if (isset($user)){
  57.     $sid=$user;
  58.  
  59.     include("../include/session_auth.inc");
  60.     include("../lang/".$my_prefs["charset"].".inc");
  61.     include("../include/ryosimap.inc");
  62.  
  63.     ?>
  64. <HTML>
  65. <HEAD>
  66. <!--
  67. IlohaMail by Ryo Chijiiwa
  68. http://ilohamail.org
  69. //-->
  70.     <?php
  71.     $linkc=$my_colors["main_link"];
  72.     //$bgc=$my_colors["main_bg"];
  73.     $bgc=$my_colors["main_darkbg"];
  74.     $textc=$my_colors["main_text"];
  75.     $hilitec=$my_colors["main_hilite"];
  76.     $font_size = $my_colors["font_size"];
  77.     
  78.     $css_url = "css.php?user=".$user."&theme=".$my_prefs["theme"];
  79.     ?>
  80.         <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<?php echo $my_prefs["charset"]?>">
  81.         <link rel="stylesheet" href="<?php echo $css_url?>" type="text/css">
  82.         <?php
  83.         /** include CSS **/
  84.         //include("../include/css.inc");
  85.         
  86.         /** include JavaScript **/
  87.         include("../include/javascript.inc");
  88.         ?>
  89.     </HEAD>
  90.     <?php
  91.      echo '<BODY TEXT="'.$textc.'" BGCOLOR="'.$bgc.'" LINK="'.$linkc.'" ALINK="'.$linkc.'" VLINK="'.$linkc.'"'.$onLoad.$onUnLoad.'>';
  92. }else{
  93.     echo "<BODY>";
  94.     echo "User unspecified:".$user;
  95.     //echo "<script> parent.location=\"login.php\"; </script>";
  96.     echo "</HTML></BODY>";
  97.     exit;
  98. }
  99. flush();
  100. ?>