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 / write_sinc.inc < prev    next >
Encoding:
Text File  |  2003-08-24  |  1.6 KB  |  55 lines

  1. <?php
  2. /////////////////////////////////////////////////////////
  3. //    
  4. //    include/write_sinc.inc
  5. //
  6. //    (C)Copyright 2000-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.         Shell for write_sinc.backend.inc.
  18.         Gets config from ../conf/conf.inc
  19.  
  20. ********************************************************/        
  21.  
  22. include("../conf/conf.inc");
  23.  
  24. $user_name = strtolower($user_name);
  25. $host = strtolower($host);
  26.  
  27. if ($backend!="FS") $backend = "DB";
  28. include("../include/write_sinc.".$backend.".inc");
  29.  
  30. /**** Backend agnostic code ***/
  31. if (empty($error)){
  32.     //prep uploads dir
  33.     $uploadDir = $UPLOAD_DIR;
  34.     if (empty($uploadDir)) $uploadDir = "../uploads/";
  35.     if (!is_dir(realpath($uploadDir))) $error .= "Invalid uploads directory<br>\n";
  36.     else{
  37.         $uploadDir = $uploadDir.ereg_replace("[\\/]", "", $user_name.".".$host);
  38.         if (!is_dir(realpath($uploadDir))) mkdir($uploadDir, 0700);
  39.     }
  40.     
  41.     //prep cache dir
  42.     if (empty($CACHE_DIR)) $CACHE_DIR = "../cache/";
  43.     if (is_dir(realpath($CACHE_DIR))){
  44.         $cacheDir = $CACHE_DIR.ereg_replace("[\\/]", "", $user_name.".".$host);
  45.         if (!is_dir(realpath($cacheDir))) mkdir($cacheDir, 0700);
  46.     }
  47.     
  48.     if (!file_exists(realpath($uploadDir))) $error .= "Invalid uploads directory<br>\n";
  49.     
  50.     include_once("../include/cache.inc");
  51.     cache_clear_all($loginID, $host);
  52. }
  53.  
  54. ?>
  55.