$dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE)); $dialog->setContent($content); $dialog->show(); exit; } else { $updateErrors = array(); foreach ($errors as $anError) { $updateErrors[] = $anError; } CMS_session::setSessionVar('patchErrors', $updateErrors); } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE)); //correct first error of the array $errors = CMS_session::getSessionVar('patchErrors'); $error = $errors[0]; //button message $validate_msg = !is_array($errors[1]) ? MESSAGE_PAGE_RETURN_TO_PATCH : MESSAGE_PAGE_NEXT_ERROR; switch ($error['no']) { case 5: //try to update a protected file (UPDATE.DENY) $content .= $cms_language->getMessage(MESSAGE_PAGE_ERROR_5_LABEL) . '<br /><br />'; $installParams = array_map("trim", explode("\t", $error['command'])); //get files $file = $installParams[1]; $content .= ' ' . $cms_language->getMessage(MESSAGE_PAGE_ORIGINAL_PROTECTED_FILE) . ' : <div class="cms_code">
} } $field->setValue("objectID", $object->getID()); if (!$cms_message && $_POST["cms_action"] == "validate") { //save the data $field->writeToPersistence(); header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&field=" . $field->getID() . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } elseif ($_POST["cms_action"] != "validate") { $cms_message = ''; } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, array($object->getLabel($cms_languege))), 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&field=" . $field->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } if ($moduleCodename) { $polymod = CMS_modulesCatalog::getByCodename($moduleCodename); } $required = $field->getValue("required") ? ' checked="checked"' : ''; $indexable = $field->getValue("indexable") ? ' checked="checked"' : ''; $searchlist = $field->getValue("searchlist") ? ' checked="checked"' : ''; $searchable = $field->getValue("searchable") ? ' checked="checked"' : ''; $polyModules = CMS_modulesCatalog::getAll("label", true); $poly_types = array(); foreach ($polyModules as $aModule) { $poly_types = array_merge($poly_types, CMS_poly_object_catalog::getObjectsForModule($aModule->getCodename()));
if (!$cms_message) { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); //grab block content $data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false); } break; case "previz": //checks and assignments $previz = $_POST["item"]; default: //grab block content $data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false); break; } $dialog = new CMS_dialog(); $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE, false, MOD_CMS_FORMS_CODENAME)); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Search for all forms in current language $search = new CMS_forms_search(); // Param : userpermisison on module $search->addWhereCondition("profile", $cms_user); // Param : Language $search->addWhereCondition("language", $items_language); // Param : With categories if (CMS_session::getSessionVar("items_ctg") != '') { $search->addWhereCondition("category", CMS_session::getSessionVar("items_ctg")); } //language selection $content .= '
$parameters = $module->getParameters(false, true); break; case 'delete_module': if ($module->destroy()) { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); } else { $cms_message = 'Error during module deletion ...'; } unset($module); unset($modules); unset($moduleCodename); $modules = CMS_modulesCatalog::getAll("label", false, true); break; } $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE), 'picto_modules.gif'); //Show a list of all modules if (!sizeof($modules)) { $content .= $cms_language->getMessage(MESSAGE_PAGE_EMPTY_SET) . "<br /><br />"; $content .= ' <form action="polymod_mod.php" method="post"> <input type="submit" class="admin_input_submit" value="' . $cms_language->getMessage(MESSAGE_PAGE_ACTION_NEW) . '" /> </form><br />'; } else { $content .= ' <form action="' . $_SERVER["SCRIPT_NAME"] . '" method="post"> ' . $cms_language->getMessage(MESSAGE_PAGE_CHOOSE_MODULE) . ' : <select name="moduleCodename" class="admin_input_text" onchange="submit();"> <option value="">' . $cms_language->getMessage(MESSAGE_PAGE_CHOOSE) . '</option>'; foreach ($modules as $aModule) { $selected = $moduleCodename == $aModule->getCodename() ? ' selected="selected"' : '';
$website->setMeta('metas', $_POST['metas']); if (!$cms_message && !$website->hasError()) { $website->writeToPersistence(); CMS_tree::regenerateAllPages(true); $log = new CMS_log(); $log->logMiscAction(CMS_log::LOG_ACTION_WEBSITE_EDIT, $cms_user, "Website : " . $website->getLabel()); $dialog->reloadAll(); header("Location: websites.php?cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } } break; } $dialog->setBackLink("websites.php"); $title = $cms_language->getMessage(MESSAGE_PAGE_TITLE); $dialog->setTitle($title); if ($cms_message) { $dialog->setActionMessage($cms_message); } $grand_root = CMS_tree::getRoot(); $tree_href = PATH_ADMIN_SPECIAL_TREE_WR; $tree_href .= '?root=' . $grand_root->getID(); //$tree_href .= '&pageLink=website.php'.chr(167).chr(167).'website_root=%s'.chr(167).'cms_action=set_root'.chr(167).'website='.$website->getID(); $tree_href .= '&encodedPageLink=' . base64_encode('website.php' . chr(167) . chr(167) . 'website_root=%s' . chr(167) . 'cms_action=set_root' . chr(167) . 'website=' . $website->getID()); $tree_href .= '&backLink=websites.php'; $tree_href .= '&title=' . urlencode($cms_language->getMessage(MESSAGE_PAGE_TREE_TITLE)); $tree_href .= '&heading=' . urlencode($cms_language->getMessage(MESSAGE_PAGE_TREE_HEADING)); $website_root = $website->getRoot(); $content = ' <form action="' . $_SERVER["SCRIPT_NAME"] . '?website=' . $website->getID() . '" method="post"> <table border="0" cellpadding="3" cellspacing="2">
// | http://www.gnu.org/copyleft/gpl.html. | // +----------------------------------------------------------------------+ // | Author: Sébastien Pauchet <*****@*****.**> | // +----------------------------------------------------------------------+ // // $Id: backtrace.php,v 1.3 2010/03/08 16:41:17 sebastien Exp $ /** * PHP page : Backtrace debug page * * @package Automne * @subpackage admin * @author Sébastien Pauchet <*****@*****.**> */ require_once dirname(__FILE__) . '/../../cms_rc_admin.php'; $dialog = new CMS_dialog(); $dialog->setTitle('Automne :: Debug :: BackTrace', 'pic_meta.gif'); $backTraceName = $_GET['bt']; if (!$backTraceName) { $content = 'Cannot backtrace, datas missing ...'; } else { //get backtrace from cache object $cache = new CMS_cache($backTraceName, 'atm-backtrace', 600, false); //load cache content if (!$cache->exist() || !($datas = $cache->load())) { $content = 'Cannot backtrace, datas missing ...'; } else { $content = ' <h3>Backtrace:</h3> ' . $datas['summary'] . '<br /> <h3>Backtrace Detail:</h3> <pre>' . io::htmlspecialchars($datas['backtrace']) . '</pre>
} } } // Save data if (!$cms_message && $item->writeToPersistence()) { header("Location: items.php?cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } break; } // +----------------------------------------------------------------------+ // | Render | // +----------------------------------------------------------------------+ $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_MODULE, array($cms_module->getLabel($cms_language))) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, false, MOD_CMS_FORMS_CODENAME)); $dialog->setBacklink("items.php?item=" . $item->getId()); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Insert prefered text editor for textarea field $toolbarset = !$cms_module->getParameters("editor_toolbar") ? 'Basic' : $cms_module->getParameters("editor_toolbar"); $attrs = array('form' => 'frmitem', 'field' => 'source_' . $item->getID(), 'value' => $item->getAttribute('source'), 'language' => $cms_language, 'width' => 600, 'height' => 600, 'rows' => 8, 'toolbarset' => $toolbarset); $text_editor = CMS_textEditor::getEditorFromParams($attrs); $dialog->setJavascript($text_editor->getJavascript()); // Get listboxes for categories $a_all_categories = CMS_moduleCategories_catalog::getAllCategoriesAsArray($cms_user, $cms_module->getCodename(), $cms_language); if (!sizeof($a_all_categories)) { //user has no right on categories so he can't edit/create items header("Location: " . $cms_module->getAdminFrontendPath(PATH_RELATIVETO_WEBROOT) . "?cms_message_id=65&" . session_name() . "=" . session_id()); exit;
if (!$startRoot) { die("Tree : root page not defined"); } //pageProperty : must be inside the page_properties array $page_properties = array("last_creation_date", "template"); if ($pageProperty && !SensitiveIO::isInSet($pageProperty, $page_properties)) { die("Tree : unknown page property"); } $dialog = new CMS_dialog(); if ($hideMenu) { $dialog->setMenu(false); } //add title $title = $title ? SensitiveIO::sanitizeHTMLString($title) : $cms_language->getMessage(MESSAGE_PAGE_TITLE); $pageTitle = $frame && !$onClick ? '<a href="' . CMS_session::getSessionVar('treeHref') . '" target="_self" class="admin_frame">' . $title . '</a>' : $title; $dialog->setTitle($pageTitle); $dialog->changeColor(); //add message if any if ($cms_message) { $dialog->setActionMessage($cms_message); } //add back link if ($backLink) { //links are coded in query string and so ? are replaced by §§ and ampersands are replaced with § to avoid confusion $bl = str_replace(chr(167) . chr(167), "?", $backLink); $bl = str_replace(chr(167), "&", $bl); $dialog->setBackLink(SensitiveIO::sanitizeHTMLString($bl)); } //first make a diff beetween current queried Root and all user sections to see wich sections missing. $getRoot = array($startRoot); $displayed = array();
define('MESSAGE_PAGE_MODULE_ERROR_CLEANING_DIR', 1659); define('MESSAGE_PAGE_MODULE_IMPORT_LOG', 1660); define('MESSAGE_PAGE_ERROR_MODULE_RIGHTS', 65); define('MESSAGE_PAGE_EXPORT_XML_FORMAT', 1636); define('MESSAGE_PAGE_EXPORT_PHP_FORMAT', 1637); define('MESSAGE_PAGE_EXPORT_OPTIONS', 1638); //Create page object $dialog = new CMS_dialog(); //checks rights if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_MODULE_RIGHTS)); $dialog->show(); exit; } $import = new CMS_module_import(); $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_MODULE_IMPORT_TITLE)); $format = io::post('format', '', 'xml'); $options = io::post('options', 'is_array', !io::post('action') ? $import->getDefaultParameters() : array()); $dialog->setBackLink('modules_admin.php'); $content = '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data"> <input type="hidden" name="action" value="import" /> <fieldset> <legend>' . $cms_language->getMessage(MESSAGE_PAGE_EXPORT_OPTIONS) . '</legend>'; $importParams = $import->getAvailableParameters($cms_language); foreach ($importParams as $param => $label) { $content .= '<label> <input type="checkbox" name="options[]" value="' . $param . '"' . (in_array($param, $options) ? ' checked="checked"' : '') . ' /> ' . $label . ' </label><br />'; } $content .= ' </fieldset><br />
$oembedDefinition->setParameter(io::post('parameter')); $oembedDefinition->setLabel(io::post('label')); if ($oembedDefinition->validate()) { $oembedDefinition->writeToPersistence(); } else { $errors = $oembedDefinition->getValidationFailures(); foreach ($errors as $error) { $cms_message .= "\n" . $error; } } break; case "switchexplanation": break; } $dialog = new CMS_dialog(); $dialog->setTitle("Création / modification d'une définition oembed", 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $objectDefinition->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } $scriptname = $_SERVER['SCRIPT_NAME']; $definitionHtml = htmlspecialchars($oembedDefinition->getHtml()); // Automne dialog system forces us to use a $content variable and so to mix everything... $content = <<<HTML <link rel="stylesheet" type="text/css" href="./css/admin-bootstrap.css" /> <link rel="stylesheet" type="text/css" href="../codemirror/codemirror.css" /> <script type="text/javascript" src="../codemirror/codemirror.js"></script> <script type="text/javascript" src="../codemirror/indent.js"></script> <script type="text/javascript" src="../codemirror/xml.js"></script> <script type="text/javascript" src="../codemirror/javascript.js"></script> <script type="text/javascript" src="../codemirror/clike.js"></script>
// // $Id: stat.php,v 1.9 2010/03/08 16:41:21 sebastien Exp $ /** * Automne Debug Statistics viewver * * @package Automne * @subpackage admin * @author Sébastien Pauchet <*****@*****.**> */ require_once dirname(__FILE__) . '/../../cms_rc_admin.php'; error_reporting(E_ALL & ~E_NOTICE); $SQL_TIME_MARK = $_REQUEST["SQL_TIME_MARK"] ? $_REQUEST["SQL_TIME_MARK"] : '0.001'; $statName = $_REQUEST['stat'] ? $_REQUEST['stat'] : ''; $dialog = new CMS_dialog(); if (!$statName) { $dialog->setTitle('Automne :: Debug :: Statistics', 'pic_meta.gif'); $dialog->setContent('Cannot find stats datas ...'); $dialog->show(); exit; } //get stats from cache object $cache = new CMS_cache($statName, 'atm-stats', 600, false); //load cache content if (!$cache->exist() || !($datas = $cache->load())) { $dialog->setTitle('Automne :: Debug :: Statistics', 'pic_meta.gif'); $dialog->setContent('Cannot find stats datas ...'); $dialog->show(); exit; } $sql_table = $datas['stat_sql_table']; $files_loaded = $datas['stat_files_table'];
$pg->regenerate(true); $validation = new CMS_resourceValidation(MOD_STANDARD_CODENAME, RESOURCE_EDITION_SIBLINGSORDER + RESOURCE_EDITION_CONTENT, $father); $mod = CMS_modulesCatalog::getByCodename(MOD_STANDARD_CODENAME); $mod->processValidation($validation, VALIDATION_OPTION_ACCEPT); } $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); $archives = CMS_tree::getArchivedPagesData(); $log = new CMS_log(); $log->logResourceAction(CMS_log::LOG_ACTION_RESOURCE_UNARCHIVE, $cms_user, MOD_STANDARD_CODENAME, $pg->getStatus(), "", $pg); } } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE), 'pic_archives.gif'); if ($cms_message) { $dialog->setActionMessage($cms_message); $dialog->reloadTree(); } if (is_array($archives) && $archives) { $content .= ' <table border="0" cellpadding="2" cellspacing="2"> <tr> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_REFERENCE) . '</th> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_TITLE) . '</th> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LASTCREATION) . '</th> <th class="admin" colspan="2">' . $cms_language->getMessage(MESSAGE_PAGE_ACTIONS) . '</th> </tr> '; $count = 0;
CMS_file::copyTo(PATH_HTACCESS_FS . '/htaccess_file', PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/public/.htaccess'); CMS_file::chmodFile(FILES_CHMOD, PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/public/.htaccess'); } header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } else { $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_DIRECTORY_CREATION, array($moduledir->getName(), $moduleDeleted->getName(), $moduleEdited->getName(), $modulePublic->getName())); } } } break; } //page dialog $dialog = new CMS_dialog(); if (is_object($module)) { $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_EDIT, array($module->getLabel($cms_language)))); $dialog->setBackLink('modules_admin.php?moduleCodename=' . $moduleCodename); } else { $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_CREATE)); $dialog->setBackLink('modules_admin.php'); } if ($cms_message) { $dialog->setActionMessage($cms_message); } $content = ' <form action="' . $_SERVER["SCRIPT_NAME"] . '" method="post"> <input type="hidden" name="cms_action" value="validate" /> <input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" /> <table border="0" cellpadding="2" cellspacing="2"> <tr> <td class="admin" align="right">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LABEL) . '</td>
$dialog->show(); exit; } $moduleCodename = io::request('moduleCodename'); if (!$moduleCodename) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_UNKNOWN_MODULE)); $dialog->show(); exit; } $module = CMS_modulesCatalog::getByCodename($moduleCodename); if (!is_object($module) || $module->hasError()) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_UNKNOWN_MODULE)); $dialog->show(); exit; } $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_MODULE_EXPORT_TITLE, array($module->getLabel($cms_language)))); $dialog->setBackLink('modules_admin.php?moduleCodename=' . $moduleCodename); $export = new CMS_module_export($moduleCodename); if (!$export->hasExport()) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_MODULE_NO_EXPORT)); $dialog->show(); exit; } $format = io::post('format', array('xml', 'php', 'patch'), 'patch'); $options = io::post('options', 'is_array', !io::post('action') ? $export->getDefaultParameters() : array()); $content = '<form action="' . $_SERVER['SCRIPT_NAME'] . '#exportDatas" method="post"> <input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" /> <input type="hidden" name="action" value="export" /> <fieldset> <legend>' . $cms_language->getMessage(MESSAGE_PAGE_EXPORT_FORMAT) . '</legend> <label>
case "delete": //change the article proposed location and send emails to all the validators $item = CMS_module_cms_forms::getResourceByID($_POST["item"]); if ($item->destroy()) { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); } else { $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_DELETE_ERROR, false, MOD_CMS_FORMS_CODENAME); } break; } // +----------------------------------------------------------------------+ // | Render | // +----------------------------------------------------------------------+ $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_MODULE, array($cms_module->getLabel($cms_language))) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE)); //$dialog->setBacklink("index.php"); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Search for all forms in current language $search = new CMS_forms_search(); // Param : userpermisison on module $search->addWhereCondition("profile", $cms_user); // Param : Language $search->addWhereCondition("language", $items_language); // Param : With categories if (CMS_session::getSessionVar("items_ctg") != '') { $search->addWhereCondition("category", CMS_session::getSessionVar("items_ctg")); } //language selection