install_files.inc.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php // $Id: install_files.inc.php 11139 2007-02-17 15:43:14Z yannoo $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  16. Mail: info@dokeos.com
  17. ==============================================================================
  18. */
  19. /**
  20. ==============================================================================
  21. * Install the Dokeos files
  22. * Notice : This script has to be included by install/index.php
  23. *
  24. * The script creates two files:
  25. * - configuration.php, the file that contains very important info for Dokeos
  26. * such as the database names.
  27. * - .htaccess file (in the courses directory) that is optional but improves
  28. * security
  29. *
  30. * @package dokeos.install
  31. ==============================================================================
  32. */
  33. if(defined('DOKEOS_INSTALL'))
  34. {
  35. // Write the Dokeos config file
  36. write_dokeos_config_file('../inc/conf/configuration.php');
  37. // Write a distribution file with the config as a backup for the admin
  38. write_dokeos_config_file('../inc/conf/configuration.dist.php');
  39. // Write a .htaccess file in the course repository
  40. write_courses_htaccess_file($urlAppendPath);
  41. //copy distribution files into right names for Dokeos install
  42. copy('../inc/conf/add_course.conf.dist.php','../inc/conf/add_course.conf.php');
  43. copy('../inc/conf/course_info.conf.dist.php','../inc/conf/course_info.conf.php');
  44. copy('../inc/conf/mail.conf.dist.php','../inc/conf/mail.conf.php');
  45. copy('../inc/conf/profile.conf.dist.php','../inc/conf/profile.conf.php');
  46. }
  47. else
  48. {
  49. echo 'You are not allowed here !';
  50. }
  51. ?>