home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / cms / view.inc < prev    next >
Text File  |  2004-03-08  |  2KB  |  64 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13.  
  14. require($GO_CONFIG->class_path.'cms_site.class.inc');
  15. $cms_site_module = $GO_MODULES->get_module('cms');
  16.  
  17. require_once($GO_LANGUAGE->get_language_file('cms'));
  18.  
  19. if(!isset($site_id) || !$cms_site = new cms_site($site_id))
  20. {
  21.     die('No site or invalid site requested');
  22. }
  23.  
  24. if ($cms_site->site['acl_read'] > 0)
  25. {
  26.     //authenticate the user
  27.     $GO_SECURITY->authenticate();
  28.  
  29.     if (!$GO_SECURITY->has_permission($GO_SECURITY->user_id, $cms_site->site['acl_read']) && !$GO_SECURITY->has_permission($GO_SECURITY->user_id, $cms_site->site['acl_write']))
  30.     {
  31.         require($GO_THEME->theme_path."header.inc");
  32.         require($GO_CONFIG->root_path.'error_docs/403.inc');
  33.         require($GO_THEME->theme_path."footer.inc");
  34.         exit();
  35.     }
  36. }
  37.  
  38. $publish_path = $GO_CONFIG->get_setting('cms_publish_path');
  39. if (isset($published) && $publish_path != '' && $cms_site->site['publish_style'] == '0')
  40. {
  41.     die($cms_site_offline);
  42. }
  43.  
  44. //set the folder id we are in
  45. $folder_id = isset($_REQUEST['folder_id']) ? $_REQUEST['folder_id'] : $cms_site->site['root_folder_id'];
  46. $file_id =  isset($_REQUEST['file_id']) ? $_REQUEST['file_id'] : 0;
  47. if ($file_id == 0)
  48. {
  49.     $cms_site->get_files($folder_id, 'priority', 'ASC');
  50.     while($cms_site->next_record())
  51.     {
  52.         if (eregi('htm',$cms_site->f('extension')))
  53.         {
  54.             $file_id = $cms_site->f('id');
  55.             break;
  56.         }
  57.     }
  58. }
  59.  
  60. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  61. $search_word_id = isset($_REQUEST['search_word_id']) ? $_REQUEST['search_word_id'] : '';
  62. echo $cms_site->generate_page($file_id, $task, $search_word_id);
  63. ?>
  64.