$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERRER']; $link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI']; switch ($task) { case 'save_file_properties': $task = 'file_properties'; $name = smart_addslashes(trim($_POST['name'])); if ($name == '') { $feedback = '<p class="Error">' . $error_missing_field . '</p>'; } else { if ($_POST['extension'] != '') { $name = $name . '.' . $_POST['extension']; } $existing_id = $cms->file_exists($folder_id, $name); if ($existing_id && $_POST['file_id'] != $existing_id) { $feedback = '<p class="Error">' . $fbNameExists . '</p>'; } elseif (!($file = $cms->get_file($_POST['file_id']))) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } else { $hot_item = isset($_POST['hot_item']) ? '1' : '0'; if (!$cms->update_file($_POST['file_id'], $name, addslashes($file['content']), smart_addslashes($_POST['title']), smart_addslashes($_POST['description']), smart_addslashes($_POST['keywords']), $_POST['priority'], $hot_item)) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } else { if ($_POST['close'] == 'true') { header('Location: ' . $return_to); exit; } } } } break; case 'save_folder_properties':
Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ require "../../Group-Office.php"; //load file management class require $GO_CONFIG->class_path . 'filetypes.class.inc'; $cms_module = $GO_MODULES->get_module('cms'); require $cms_module['class_path'] . 'cms.class.inc'; $cms = new cms(); $filetypes = new filetypes(); $site = $cms->get_site($_REQUEST['site_id']); if ($site['acl_read'] > 0) { $GO_SECURITY->authenticate(); } if ($site['acl_read'] == 0 || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $site['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $site['acl_write'])) { if ($file = $cms->get_file($_REQUEST['file_id'])) { $browser = detect_browser(); //header('Content-Length: '.$file['size']); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); if ($browser['name'] == 'MSIE') { header('Content-Type: ' . $file['content_type']); header('Content-Disposition: inline; filename="' . $file['name'] . '"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header('Content-Type: ' . $file['content_type']); header('Pragma: no-cache'); header('Content-Disposition: inline; filename="' . $file['name'] . '"'); } header('Content-Transfer-Encoding: binary'); echo $file['content'];
} else { $name = smart_addslashes(trim($_POST['name'])); if ($name == '') { $feedback = '<p class="Error">' . $error_missing_field . '</p>'; } else { $filename = $name . '.html'; if ($cms->file_exists($folder_id, $filename)) { $feedback = '<p class="Error">' . $fbNameExists . '</p>'; } elseif (!($file_id = $cms->add_file($folder_id, $filename, smart_addslashes($_POST['content']), '', '', '', $_POST['priority']))) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } } } } if ($file_id > 0) { $file = $cms->get_file($file_id); $content = $file['content']; $name = $file['name']; $title = $file['title']; $description = $file['description']; $keywords = $file['keywords']; $priority = $file['priority']; $hot_item = $file['hot_item']; } else { require $GO_THEME->theme_path . "header.inc"; require "add_file.inc"; require $GO_THEME->theme_path . "footer.inc"; exit; } $link_back = 'edit.php?site_id=' . $site_id . '&file_id=' . $file_id . '&folder_id=' . $folder_id; //set the page title for the header file