diff --git a/_admin.php b/_admin.php index 224078e..328feb3 100644 --- a/_admin.php +++ b/_admin.php @@ -52,14 +52,25 @@ class tweakStoresBehaviors $plugins[$module['name'] . ' '. $module['version']] = $id; } - if (!empty($_POST['build_xml']) && !empty($_POST['buildxml_id']) && in_array($_POST['buildxml_id'], $plugins)) { + if (!empty($_POST['buildxml_id']) && in_array($_POST['buildxml_id'], $plugins)) { $xml_content = tweakStores::generateXML($_POST['buildxml_id'], $modules[$_POST['buildxml_id']], $file_pattern); } + if (!empty($_POST['write_xml'])) { + if (empty($_POST['your_pwd']) || !$core->auth->checkPassword($_POST['your_pwd'])) { + $core->error->add(__('Password verification failed')); + } else { + $ret = tweakStores::writeXML($_POST['buildxml_id'], $modules[$_POST['buildxml_id']], $file_pattern); + if (!empty(tweakStores::$failed)) { + $core->error->add(implode(' ', tweakStores::$failed)); + } + } + } + echo '
' . @@ -126,7 +149,6 @@ class tweakStoresBehaviors } echo - '' . '