|
From: Jon O. <jon...@us...> - 2006-06-17 20:50:51
|
Update of /cvsroot/mxbb/mx_simpledoc/simpledoc/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6843/modules/mx_simpledoc/simpledoc/modules Modified Files: simpledoc_export.php simpledoc_export_single.php simpledoc_import.php simpledoc_index.php simpledoc_publish.php simpledoc_publish_export.php simpledoc_settings.php simpledoc_view.php simpledoc_view_plain.php Log Message: security Index: simpledoc_settings.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_settings.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_settings.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_settings.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,12 **** * */ ! class mx_simpledoc_settings extends mx_simpledoc_public { --- 8,17 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_settings extends mx_simpledoc_public { *************** *** 14,18 **** { global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; ! global $CONFIG, $simpledoc_projectName; $template->set_filenames( array( 'body' => 'simpledoc_settings.tpl' )); --- 19,23 ---- { global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; ! global $CONFIG, $simpledoc_projectName; $template->set_filenames( array( 'body' => 'simpledoc_settings.tpl' )); *************** *** 20,55 **** // // Start ! // $mayEdit = IoFile::isWritable($module_root_path . 'config.php'); ! $encoding = post('encoding'); $editorWidth = post('editor-width'); $editorHeight = post('editor-height'); $publish_dir = post('publish_dir'); ! $encoding = $this->config_safe($encoding); $publish_dir = $this->config_safe($publish_dir); $publish_dir = str_replace('\\', '/', $publish_dir); ! if (substr($publish_dir, -1) == '/') { $publish_dir = substr($publish_dir, 0, -1); } ! if (!is_numeric($editorWidth)) { $editorWidth = null; } if (!is_numeric($editorHeight)) { $editorHeight = null; } ! if (!$encoding) { $publish_dir = $CONFIG['publish_dir']; } ! // ! // Prefix // $publish_dir_full = $module_root_path . 'simpledoc/' . $publish_dir; ! $err_publish_dir = false; ! if (!$publish_dir_full || !IoDir::exists($publish_dir_full) || !IoDir::isWritable($publish_dir_full)) { $err_publish_dir = true;} ! $ok = $mayEdit && $encoding && $editorWidth && $editorHeight && !$err_publish_dir; ! if ($ok) { $s = "<"."?"."php\r\n"; --- 25,60 ---- // // Start ! // $mayEdit = IoFile::isWritable($module_root_path . 'config.php'); ! $encoding = post('encoding'); $editorWidth = post('editor-width'); $editorHeight = post('editor-height'); $publish_dir = post('publish_dir'); ! $encoding = $this->config_safe($encoding); $publish_dir = $this->config_safe($publish_dir); $publish_dir = str_replace('\\', '/', $publish_dir); ! if (substr($publish_dir, -1) == '/') { $publish_dir = substr($publish_dir, 0, -1); } ! if (!is_numeric($editorWidth)) { $editorWidth = null; } if (!is_numeric($editorHeight)) { $editorHeight = null; } ! if (!$encoding) { $publish_dir = $CONFIG['publish_dir']; } ! // ! // Prefix // $publish_dir_full = $module_root_path . 'simpledoc/' . $publish_dir; ! $err_publish_dir = false; ! if (!$publish_dir_full || !IoDir::exists($publish_dir_full) || !IoDir::isWritable($publish_dir_full)) { $err_publish_dir = true;} ! $ok = $mayEdit && $encoding && $editorWidth && $editorHeight && !$err_publish_dir; ! if ($ok) { $s = "<"."?"."php\r\n"; *************** *** 63,67 **** IoFile::write($module_root_path . 'config.php', $s); } ! if (!$encoding) { $encoding = $CONFIG['encoding']; --- 68,72 ---- IoFile::write($module_root_path . 'config.php', $s); } ! if (!$encoding) { $encoding = $CONFIG['encoding']; *************** *** 70,107 **** $publish_dir = $CONFIG['publish_dir']; } ! // // Error // ! if ($ok) { $message = 'Settings saved successfully'; } ! if (!$mayEdit) { $message = 'File /config.php must be writable to change settings'; } ! if ($err_publish_dir) { $message = 'Publish Dir doesn\'t exist or is not writable'; } ! $template->assign_block_vars("message", array( 'MESSAGE' => $message ! )); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), --- 75,112 ---- $publish_dir = $CONFIG['publish_dir']; } ! // // Error // ! if ($ok) { $message = 'Settings saved successfully'; } ! if (!$mayEdit) { $message = 'File /config.php must be writable to change settings'; } ! if ($err_publish_dir) { $message = 'Publish Dir doesn\'t exist or is not writable'; } ! $template->assign_block_vars("message", array( 'MESSAGE' => $message ! )); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), *************** *** 110,149 **** 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'ENCODING' => $encoding, 'EDITOR_WIDTH' => $editorWidth, 'EDITOR_HEIGHT' => $editorHeight, 'PUBLISH_DIR' => $publish_dir, ! 'DISABLED' => !$mayEdit ? 'disabled="disabled"' : '', ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme --- 115,154 ---- 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'ENCODING' => $encoding, 'EDITOR_WIDTH' => $editorWidth, 'EDITOR_HEIGHT' => $editorHeight, 'PUBLISH_DIR' => $publish_dir, ! 'DISABLED' => !$mayEdit ? 'disabled="disabled"' : '', ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme *************** *** 161,177 **** 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Settings ! // ! 'L_CHANGE_SETTINGS' => $lang['sd_Change_settings'], ! 'L_ERROR_EMPTY' => $lang['sd_Error_empty'], ! 'L_ERROR_WIDTH' => $lang['sd_Error_width'], ! 'L_ERROR_HEIGHT' => $lang['sd_Error_height'], ! 'L_ERROR_DIR' => $lang['sd_Error_dir'], ! ! ! )); } --- 166,182 ---- 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Settings ! // ! 'L_CHANGE_SETTINGS' => $lang['sd_Change_settings'], ! 'L_ERROR_EMPTY' => $lang['sd_Error_empty'], ! 'L_ERROR_WIDTH' => $lang['sd_Error_width'], ! 'L_ERROR_HEIGHT' => $lang['sd_Error_height'], ! 'L_ERROR_DIR' => $lang['sd_Error_dir'], ! ! ! )); } Index: simpledoc_publish.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_publish.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_publish.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_publish.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,17 **** * */ ! class mx_simpledoc_publish extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $simpledoc_projectName; --- 8,22 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_publish extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $simpledoc_projectName; *************** *** 20,41 **** // // Start ! // $documents = 0; $folders = 0; $size = 0; ! $files = IoDir::readFull($CONTENT); $sections = array(); ! foreach ($files as $file) { if ($this->get_name($file) == $SORT) continue; $id = substr($file, strlen($CONTENT)+1); ! ! if (IoFile::exists($file)) { $documents++; $size += IoFile::getSize($file); ! } ! else if (IoDir::exists($file)) { $folders++; --- 25,46 ---- // // Start ! // $documents = 0; $folders = 0; $size = 0; ! $files = IoDir::readFull($CONTENT); $sections = array(); ! foreach ($files as $file) { if ($this->get_name($file) == $SORT) continue; $id = substr($file, strlen($CONTENT)+1); ! ! if (IoFile::exists($file)) { $documents++; $size += IoFile::getSize($file); ! } ! else if (IoDir::exists($file)) { $folders++; *************** *** 43,69 **** } } ! $publish_dir_ok = true; ! if ($CONFIG['publish_dir']) { if (!IoDir::exists($PUBLISH) || !IoDir::isWritable($PUBLISH)) { $publish_dir_ok = false; } } ! $size = $this->get_readable_size($size); ! $publish_dir_error = !$publish_dir_ok ? 'Publish Dir doesn\'t exist or is not writable' : ''; $template_options = sugolibTemplate::htmlOptions($sections); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), --- 48,74 ---- } } ! $publish_dir_ok = true; ! if ($CONFIG['publish_dir']) { if (!IoDir::exists($PUBLISH) || !IoDir::isWritable($PUBLISH)) { $publish_dir_ok = false; } } ! $size = $this->get_readable_size($size); ! $publish_dir_error = !$publish_dir_ok ? 'Publish Dir doesn\'t exist or is not writable' : ''; $template_options = sugolibTemplate::htmlOptions($sections); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), *************** *** 73,82 **** 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! ! 'DOCUMENT' => $documents, ! 'FOLDERS' => $folders, ! 'SIZE' => $size, ! 'PUBLISH_DIR' => $CONFIG['publish_dir'], ! 'PUBLISH_DIR_ERROR' => $publish_dir_error, 'TEMPLATE_OPTIONS' => $template_options, --- 78,87 ---- 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! ! 'DOCUMENT' => $documents, ! 'FOLDERS' => $folders, ! 'SIZE' => $size, ! 'PUBLISH_DIR' => $CONFIG['publish_dir'], ! 'PUBLISH_DIR_ERROR' => $publish_dir_error, 'TEMPLATE_OPTIONS' => $template_options, *************** *** 84,111 **** // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme --- 89,116 ---- // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme *************** *** 123,144 **** 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Publish // ! 'L_DOCUMENTS' => $lang['sd_p_Documents'], ! 'L_FOLDERS' => $lang['sd_p_Folders'], ! 'L_SIZE' => $lang['sd_p_Size'], ! 'L_SENDTEMPLATES' => $lang['sd_p_SendTemplates'], ! 'L_OPTIONMENU' => $lang['sd_p_optionMenu'], ! 'L_OPTIONRAW' => $lang['sd_p_optionRaw'], ! 'L_SENDZIP' => $lang['sd_p_SendZip'], ! 'L_PUBLISHTEMPLATES' => $lang['sd_p_PublishTemplates'], ! 'L_OPTIONSECTION' => $lang['sd_p_optionSection'], ! 'L_PUBLISHDIR' => $lang['sd_p_PublishDir'], ! 'L_PUBLISH' => $lang['sd_p_Publish'], ! ! )); } --- 128,149 ---- 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Publish // ! 'L_DOCUMENTS' => $lang['sd_p_Documents'], ! 'L_FOLDERS' => $lang['sd_p_Folders'], ! 'L_SIZE' => $lang['sd_p_Size'], ! 'L_SENDTEMPLATES' => $lang['sd_p_SendTemplates'], ! 'L_OPTIONMENU' => $lang['sd_p_optionMenu'], ! 'L_OPTIONRAW' => $lang['sd_p_optionRaw'], ! 'L_SENDZIP' => $lang['sd_p_SendZip'], ! 'L_PUBLISHTEMPLATES' => $lang['sd_p_PublishTemplates'], ! 'L_OPTIONSECTION' => $lang['sd_p_optionSection'], ! 'L_PUBLISHDIR' => $lang['sd_p_PublishDir'], ! 'L_PUBLISH' => $lang['sd_p_Publish'], ! ! )); } Index: simpledoc_export_single.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_export_single.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_export_single.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_export_single.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,27 **** * */ ! class mx_simpledoc_export_single extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; $id = get('id'); $name = $this->get_name($id); $html = $this->fetch_document($id); ! header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$name\""); header("Pragma: no-cache"); header("Expires: 0"); ! echo $html; exit; --- 8,32 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_export_single extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; $id = get('id'); $name = $this->get_name($id); $html = $this->fetch_document($id); ! header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$name\""); header("Pragma: no-cache"); header("Expires: 0"); ! echo $html; exit; Index: simpledoc_import.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_import.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_import.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_import.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,35 **** * */ ! class mx_simpledoc_import extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH, $CHMOD_FILE, $CHMOD_DIR; global $simpledoc_projectName; include_once( $module_root_path . 'simpledoc/includes/functions_zip.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'simpledoc_import.tpl' )); ! $ZipFile = new Upload('zip_file'); $err = array(); ! if (isPOST() && $ZipFile->isValid()) { ! $name = substr($ZipFile->filename, 0, -strlen($ZipFile->getExtension())); $path = $ZipFile->tmp; ! $zip = new zip; $list = @$zip->get_List($path); if (!$list || !count($list)) $err['invalid_zip'] = true; ! if (!count($err)) { $root = $list[0]['filename']; --- 8,40 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_import extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH, $CHMOD_FILE, $CHMOD_DIR; global $simpledoc_projectName; include_once( $module_root_path . 'simpledoc/includes/functions_zip.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'simpledoc_import.tpl' )); ! $ZipFile = new Upload('zip_file'); $err = array(); ! if (isPOST() && $ZipFile->isValid()) { ! $name = substr($ZipFile->filename, 0, -strlen($ZipFile->getExtension())); $path = $ZipFile->tmp; ! $zip = new zip; $list = @$zip->get_List($path); if (!$list || !count($list)) $err['invalid_zip'] = true; ! if (!count($err)) { $root = $list[0]['filename']; *************** *** 37,41 **** if ($root != $name) $err['invalid_zip'] = true; } ! if (!count($err)) { $tmp = $PUBLISH.'/import-'.$name; --- 42,46 ---- if ($root != $name) $err['invalid_zip'] = true; } ! if (!count($err)) { $tmp = $PUBLISH.'/import-'.$name; *************** *** 53,63 **** die('There was an error while uploading file'); } ! if (isset($err['invalid_zip'])) { die('The zip file contains invalid data'); } ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, --- 58,68 ---- die('There was an error while uploading file'); } ! if (isset($err['invalid_zip'])) { die('The zip file contains invalid data'); } ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, *************** *** 65,72 **** 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), --- 70,77 ---- 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu ! // 'MODE_MANAGE_URL' => $this->this_simpledoc_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_simpledoc_mxurl('mode=publish'), *************** *** 76,108 **** 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme --- 81,113 ---- 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme *************** *** 120,134 **** 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Import ! // ! 'L_ZIP_FILE' => $lang['sd_Zip_file'], ! 'L_ZIP_IMPORT' => $lang['sd_Import'], ! 'L_ZIP_FILE_REQUIRED' => $lang['sd_Zip_file_required'], ! 'L_ZIP_INFO' => $lang['sd_Zip_info'], ! ! )); } } --- 125,139 ---- 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Import ! // ! 'L_ZIP_FILE' => $lang['sd_Zip_file'], ! 'L_ZIP_IMPORT' => $lang['sd_Import'], ! 'L_ZIP_FILE_REQUIRED' => $lang['sd_Zip_file_required'], ! 'L_ZIP_INFO' => $lang['sd_Zip_info'], ! ! )); } } Index: simpledoc_view_plain.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_view_plain.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_view_plain.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_view_plain.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,36 **** * */ ! class mx_simpledoc_view_plain extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_view_plain.tpl' )); ! $edit_auth = ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ? true : false; ! //$published_folder = $PUBLISH . '/html'; ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! 'PUBLISH_DIR' => $PUBLISH, ! // // Menu --- 8,41 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_view_plain extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_view_plain.tpl' )); ! $edit_auth = ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ? true : false; ! //$published_folder = $PUBLISH . '/html'; ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! 'PUBLISH_DIR' => $PUBLISH, ! // // Menu *************** *** 42,74 **** 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme --- 47,79 ---- 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme *************** *** 86,105 **** 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // View // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], 'L_SAVING' => $lang['sd_Saving'], ! 'MANAGE' => $edit_auth ? ' - <a href="'.$this->this_simpledoc_mxurl('mode=index').'" >[' . $lang['sd_Management'] . ']</a>' : '', ! ! ! )); ! } } --- 91,110 ---- 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // View // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], 'L_SAVING' => $lang['sd_Saving'], ! 'MANAGE' => $edit_auth ? ' - <a href="'.$this->this_simpledoc_mxurl('mode=index').'" >[' . $lang['sd_Management'] . ']</a>' : '', ! ! ! )); ! } } Index: simpledoc_index.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_index.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_index.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,21 **** * */ ! class mx_simpledoc_index extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_index.tpl' )); ! // // Build the $tree and html --- 8,26 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_index extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_index.tpl' )); ! // // Build the $tree and html *************** *** 23,38 **** $tree = array(); $this->build_tree($tree, $CONTENT); ! $tree_html = $this->build_tree_html($tree); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu --- 28,43 ---- $tree = array(); $this->build_tree($tree, $CONTENT); ! $tree_html = $this->build_tree_html($tree); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu *************** *** 45,50 **** 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'TREE_HTML' => $tree_html, ! // // Theme --- 50,55 ---- 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), 'MODE_VIEW_URL' => $this->this_simpledoc_mxurl('mode=view'), ! 'TREE_HTML' => $tree_html, ! // // Theme *************** *** 64,110 **** 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Index // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_DOC_PREVIEW' => $lang['sd_Doc_preview'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], ! 'L_SAVING' => $lang['sd_Saving'], ! 'VIEW_DOC' => ' - <a href="'.$this->this_simpledoc_mxurl('mode=view').'" >[' . $lang['sd_Doc_view'] . ']</a>', ! ! )); ! } } --- 69,115 ---- 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_DOC_VIEW' => $lang['sd_Doc_view'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], ! 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Index // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_DOC_PREVIEW' => $lang['sd_Doc_preview'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], ! 'L_SAVING' => $lang['sd_Saving'], ! 'VIEW_DOC' => ' - <a href="'.$this->this_simpledoc_mxurl('mode=view').'" >[' . $lang['sd_Doc_view'] . ']</a>', ! ! )); ! } } Index: simpledoc_export.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_export.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_export.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_export.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,17 **** * */ ! class mx_simpledoc_export extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; $this->send_zip($CONTENT, 'content-'.date('Y-m-d').'.zip', 'content-'.date('Y-m-d')); --- 8,22 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_export extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; $this->send_zip($CONTENT, 'content-'.date('Y-m-d').'.zip', 'content-'.date('Y-m-d')); Index: simpledoc_view.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_view.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_view.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_view.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,23 **** * */ ! class mx_simpledoc_view extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_view.tpl' )); ! $edit_auth = ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ? true : false; ! $published_folder = $PUBLISH . '/html'; --- 8,28 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_view extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $theme, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH; global $mx_page, $mx_block, $simpledoc_projectName; ! $template->set_filenames( array( 'body' => 'simpledoc_view.tpl' )); ! $edit_auth = ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ? true : false; ! $published_folder = $PUBLISH . '/html'; *************** *** 27,42 **** $tree = array(); $this->build_tree($tree, $published_folder); ! $tree_html = $this->build_tree_html($tree); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu --- 32,47 ---- $tree = array(); $this->build_tree($tree, $published_folder); ! $tree_html = $this->build_tree_html($tree); ! ! $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, ! 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, ! ! 'L_PROJECT_NAME' => $simpledoc_projectName, ! // // Menu *************** *** 48,80 **** 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme --- 53,85 ---- 'MODE_EXPORT_URL' => $this->this_simpledoc_mxurl('mode=export'), 'MODE_SETTINGS_URL' => $this->this_simpledoc_mxurl('mode=settings'), ! 'TREE_HTML' => $tree_html, ! // // Menu langs // ! 'L_PROJECT' => $lang['sd_Project'], ! 'L_MANAGEMENT' => $lang['sd_Management'], ! 'L_PUBLISH' => $lang['sd_Publish'], ! 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], ! 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], ! 'L_OPTIONS' => $lang['sd_Options'], ! 'L_SETTINGS' => $lang['sd_Settings'], ! 'L_HELP' => $lang['sd_Help'], ! 'L_CONTENTS' => $lang['sd_Contents'], ! 'L_ABOUT' => $lang['sd_About'], ! // // Tree // ! 'L_TREE_VIEW' => $lang['sd_Tree_View'], 'L_TOC' => $lang['sd_Toc'], ! 'L_WHERE' => $lang['sd_Where'], ! 'L_BEFORE' => $lang['sd_Before'], ! 'L_AFTER' => $lang['sd_After'], ! 'L_TYPE' => $lang['sd_Type'], ! 'L_NAME' => $lang['sd_Name'], ! 'L_DOCUMENT' => $lang['sd_Document'], ! 'L_FOLDER' => $lang['sd_Folder'], ! // // Theme *************** *** 92,111 **** 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // View // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], 'L_SAVING' => $lang['sd_Saving'], ! 'MANAGE' => $edit_auth ? ' - <a href="'.$this->this_simpledoc_mxurl('mode=index').'" >[' . $lang['sd_Management'] . ']</a>' : '', ! ! ! )); ! } } --- 97,116 ---- 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input ! // // View // ! 'L_DOC_INFO' => $lang['sd_Doc_info'], ! 'L_EDIT_CONTENT' => $lang['sd_Edit_content'], ! 'L_DEFAULT_EDIT' => $lang['sd_Default_edit'], ! 'L_LOADING' => $lang['sd_Loading'], 'L_SAVING' => $lang['sd_Saving'], ! 'MANAGE' => $edit_auth ? ' - <a href="'.$this->this_simpledoc_mxurl('mode=index').'" >[' . $lang['sd_Management'] . ']</a>' : '', ! ! ! )); ! } } Index: simpledoc_publish_export.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/modules/simpledoc_publish_export.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpledoc_publish_export.php 23 Apr 2006 19:21:27 -0000 1.1 --- simpledoc_publish_export.php 17 Jun 2006 20:50:47 -0000 1.2 *************** *** 8,17 **** * */ ! class mx_simpledoc_publish_export extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH, $CHMOD_FILE, $CHMOD_DIR, $SORT, $mx_simpledoc_functions; global $mx_page, $simpledoc_projectName; --- 8,22 ---- * */ ! ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! class mx_simpledoc_publish_export extends mx_simpledoc_public { function main( $action ) { ! global $template, $lang, $db, $board_config, $phpEx, $simpledoc_config, $debug, $mx_root_path, $module_root_path, $CONTENT, $PUBLISH, $CHMOD_FILE, $CHMOD_DIR, $SORT, $mx_simpledoc_functions; global $mx_page, $simpledoc_projectName; *************** *** 19,23 **** $publish_dir = get('publish_dir'); $section = get('section'); ! switch ($template) { case 'tree': --- 24,28 ---- $publish_dir = get('publish_dir'); $section = get('section'); ! switch ($template) { case 'tree': *************** *** 27,31 **** $TMP = $PUBLISH.'/tmp-'.$DIR; $SECTION = $section ? $CONTENT.'/'.$section : $CONTENT; ! if ($publish_dir) { IoDir::delete($PUBLISH, false); --- 32,36 ---- $TMP = $PUBLISH.'/tmp-'.$DIR; $SECTION = $section ? $CONTENT.'/'.$section : $CONTENT; ! if ($publish_dir) { IoDir::delete($PUBLISH, false); *************** *** 34,39 **** IoDir::delete($TMP); sugolib_redirect($module_root_path . 'redirect.php?msg=Published+successfully&url=./../../index.php?page=' . $mx_page->page_id . '&mode=publish'); ! } ! else { include $module_root_path . "simpledoc/shared/publish/$template.php"; --- 39,44 ---- IoDir::delete($TMP); sugolib_redirect($module_root_path . 'redirect.php?msg=Published+successfully&url=./../../index.php?page=' . $mx_page->page_id . '&mode=publish'); ! } ! else { include $module_root_path . "simpledoc/shared/publish/$template.php"; *************** *** 46,50 **** break; } ! } } --- 51,55 ---- break; } ! } } |