diff --git a/apps/SimplePages/backend/edit.php b/apps/SimplePages/backend/edit.php index a163232..517c849 100755 --- a/apps/SimplePages/backend/edit.php +++ b/apps/SimplePages/backend/edit.php @@ -20,77 +20,6 @@ if (hasPerm('manage_pages')) $content = strip_tags($content); } - /*if (!$confirmationRequierd) - { - $time = time(); - $seite = str_replace('-', ' ', $seite); - $seite = str_replace('ä', 'ä', $seite); - $seite = str_replace('ö', 'ö', $seite); - $seite = str_replace('ü', 'ü', $seite); - //echo $seite; - $stmt = $DBH->prepare("UPDATE " . $MCONF['db_prefix'] . "seiten SET inhalt=:inhalt, datel=:datel, userl=:userl WHERE name=:seite"); - $stmt->bindParam(':inhalt', $content); - $stmt->bindParam(':datel', $time); - $stmt->bindParam(':userl', $_SESSION['user']); - $stmt->bindParam(':seite', $seite); - - if ($stmt->execute()) - { - echo msg('succes', 'Die Seite "' . $seite . '" wurde erfolgreich geändert. Zurück'); - } else - { - echo msg('fail'); - } - } else - { - $bnutzrid = $_SESSION['user']; - //echo $seite; - $seite = str_replace('-', ' ', $seite); - $seite = str_replace('ä', 'ä', $seite); - $seite = str_replace('ö', 'ö', $seite); - $seite = str_replace('ü', 'ü', $seite); - //echo $seite; - if ($_SESSION['user'] === $confirmationUser) - { - $time = time(); - $STH = $DBH->prepare("UPDATE " . $MCONF['db_prefix'] . "seiten SET inhalt=:inhalt, datel=:datel, userl=:userl WHERE name=:seite"); - $STH->bindParam(':inhalt', $content); - $STH->bindParam(':datel', $time); - $STH->bindParam(':userl', $_SESSION['user']); - $STH->bindParam(':seite', $seite); - - if ($STH->execute()) - { - $STH2 = $DBH->prepare("DELETE FROM " . $MCONF['db_prefix'] . "seitenneu WHERE name=:name"); - $STH2->bindParam(':name', $seite); - if ($STH2->execute()) - { - echo msg('succes', 'Die Seite "' . $seite . '" wurde erfolgreich geändert. Zurück'); - } else - { - echo msg('fail'); - } - } else - { - echo msg('fail'); - } - } else - { - $time = time(); - $stmt2 = $DBH->prepare("INSERT INTO " . $MCONF['db_prefix'] . "seitenneu (name, inhalt, geaendertby, datum) VALUES (:name, :inhalt, :geaendertby, :datum)"); - $stmt2->bindParam(':name', $seite); - $stmt2->bindParam(':inhalt', $content); - $stmt2->bindParam(':geaendertby', $bnutzrid); - $stmt2->bindParam(':datum', $time); - - if ($stmt2->execute() and freischaltemail($seite)) - { - echo msg('succes', 'Die Seite ' . $seite . ' wurde erfolgreich geändert. Diese Änderungen werden öffentlich, sobald ' . $confirmationUser . ' sie Freigegeben hat. Zurück'); - } else - { - echo msg('fail'); - } - }*/ // $db->clear(); //If a confirmation by user is requiered, insert it in another table and send an email @@ -146,6 +75,8 @@ if (hasPerm('manage_pages')) $db->data['lastedit'] = time(); if(isset($_GET['new'])) $db->data['created'] = time(); + //print_r($_POST); + //$db->update(['id' => $_GET['id']]); $id = 0; if (isset($_GET['new'])) diff --git a/inc/config.php b/inc/config.php index 10b79a9..035f030 100755 --- a/inc/config.php +++ b/inc/config.php @@ -46,11 +46,14 @@ $MCONF['update_uri'] = $config['Versioning']['update_uri']; //Mailer $MCONF['smtp'] = $config['Mail']['smtp']; -$MCONF['smtp_host'] = $config['Mail']['host']; -$MCONF['smtp_user'] = $config['Mail']['username']; -$MCONF['smtp_pass'] = $config['Mail']['password']; -$MCONF['smtp_secure'] = $config['Mail']['secure']; -$MCONF['smtp_port'] = $config['Mail']['port']; +if($MCONF['smtp'] === true) +{ + $MCONF['smtp_host'] = $config['Mail']['host']; + $MCONF['smtp_user'] = $config['Mail']['username']; + $MCONF['smtp_pass'] = $config['Mail']['password']; + $MCONF['smtp_secure'] = $config['Mail']['secure']; + $MCONF['smtp_port'] = $config['Mail']['port']; +} require_once 'libs/lang.class.php'; diff --git a/inc/footer.php b/inc/footer.php index 64560ce..286f3a2 100755 --- a/inc/footer.php +++ b/inc/footer.php @@ -70,10 +70,19 @@ if (!isset($_GET['direct'])) var isAjax = false; var requestData = 'direct=true'; + var editorname = ''; + if (typeof(tinyMCE) != "undefined") {editorname = $('#' + tinyMCE.activeEditor.id).attr("name");}//Get the new Content, not the old + for (var key in ctx.body) { if (!ctx.body.hasOwnProperty(key)) continue; - requestData += '&' + key + '=' + ctx.body[key]; + //If we have content edited with tinymce, we want the new content to be passed with the POST-Request + if(key == editorname) { + console.log(tinyMCE.activeEditor.getContent()); + requestData += '&' + key + '=' + tinyMCE.activeEditor.getContent(); + } else { + requestData += '&' + key + '=' + ctx.body[key]; + } if(key == 'ajax') isAjax = true; }