Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed the possibility to delete FAQs from edit view

  • Loading branch information...
commit d9be77efb0b098f19cae8ddd999a3b4f70b699c0 1 parent fb44bea
@thorsten thorsten authored
View
7 phpmyfaq/admin/record.add.php
@@ -34,9 +34,6 @@
if ($permission['editbt']) {
- // Get submit action
- $submit = PMF_Filter::filterInputArray(INPUT_POST, array('submit' => array('filter' => FILTER_VALIDATE_INT,
- 'flags' => FILTER_REQUIRE_ARRAY)));
// FAQ data
$dateStart = PMF_Filter::filterInput(INPUT_POST, 'dateStart', FILTER_SANITIZE_STRING);
$dateEnd = PMF_Filter::filterInput(INPUT_POST, 'dateEnd', FILTER_SANITIZE_STRING);
@@ -67,7 +64,7 @@
$categories['rubrik'] = array();
}
- if (isset($submit['submit'][1]) && !is_null($question) && !is_null($categories['rubrik'])) {
+ if (!is_null($question) && !is_null($categories['rubrik'])) {
// new entry
$logging = new PMF_Logging();
$logging->logAdmin($user, 'Beitragcreatesave');
@@ -215,7 +212,7 @@
<?php
} else {
- print $PMF_LANG['ad_entry_savedfail'].$db->error();
+ printf('<p class="error">%s</p>',$PMF_LANG['ad_entry_savedfail'] . $db->error());
}
} else {
View
15 phpmyfaq/admin/record.edit.php
@@ -522,19 +522,10 @@
</fieldset>
-<?php
- if ($selectedRevisionId == $faqData['revision_id']) {
-?>
- <input class="submit" type="submit" value="<?php print $PMF_LANG["ad_entry_save"]; ?>" name="submit[1]" />
+ <?php if ($selectedRevisionId == $faqData['revision_id']): ?>
+ <input class="submit" type="submit" value="<?php print $PMF_LANG["ad_entry_save"]; ?>" name="submit" />
<input class="submit" type="reset" value="<?php print $PMF_LANG["ad_gen_reset"]; ?>" />
-<?php
- }
- if ($queryString != "insertentry") {
-?>
- <input class="submit" type="submit" value="<?php print $PMF_LANG["ad_entry_delete"]; ?>" name="submit[0]" />
-<?php
- }
-?>
+ <?php endif; ?>
</p>
<?php
if (is_numeric($faqData['id'])) {
View
23 phpmyfaq/admin/record.save.php
@@ -34,9 +34,6 @@
if ($permission['editbt']) {
- // Get submit action
- $submit = PMF_Filter::filterInputArray(INPUT_POST, array('submit' => array('filter' => FILTER_VALIDATE_INT,
- 'flags' => FILTER_REQUIRE_ARRAY)));
// FAQ data
$dateStart = PMF_Filter::filterInput(INPUT_POST, 'dateStart', FILTER_SANITIZE_STRING);
$dateEnd = PMF_Filter::filterInput(INPUT_POST, 'dateEnd', FILTER_SANITIZE_STRING);
@@ -65,7 +62,7 @@
$group_permission = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
$restricted_groups = ('all' == $group_permission) ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
- if (isset($submit['submit'][1]) && !is_null($question) && !is_null($categories)) {
+ if (!is_null($question) && !is_null($categories)) {
// Save entry
$logging = new PMF_Logging();
$logging->logAdmin($user, 'Beitragsave ' . $record_id);
@@ -210,24 +207,6 @@
});
</script>
<?php
- } elseif (isset($submit['submit'][0])) {
-
- $logging = new PMF_Logging();
- $logging->logAdmin($user, 'Beitragdel, ' . $record_id);
-
- $path = PMF_ROOT_DIR . DIRECTORY_SEPARATOR . PMF_ATTACHMENTS_DIR . DIRECTORY_SEPARATOR . $record_id . '/';
- if (@is_dir($path)) {
- $do = dir($path);
- while ($dat = $do->read()) {
- if ($dat != "." && $dat != "..") {
- unlink($path . $dat);
- }
- }
- rmdir($path);
- }
-
- $faq->deleteRecord($record_id, $record_lang);
- printf('<p class="success">%s</p>', $PMF_LANG['ad_entry_delsuc']);
}
} else {
print $PMF_LANG['err_NotAuth'];
Please sign in to comment.
Something went wrong with that request. Please try again.