<?php
$myMedia = new MediaManagement();
$myMedia->userID = $HTTP_SESSION_VARS[user];
$myMedia->setOptionObject($nlOption);
$nlError = false;
if(!(ADMIN & $cbPerms)) {
$nlError = true;
}
if(isset($nlSettingEdit) && !$nlError) {
/*
* Absender Adresse updaten
*/
$nlOption->updateOption("from", mysql_escape_string($nlSettingFrom));
/*
* Versand Methode und deren Optionen updaten
*/
$_correctMethod = false;
if($nlMethod == "mail") {
$_correctMethod = true;
}
if($nlMethod == "smtp") {
$_correctMethod = true;
$nlOption->updateOption("smtp", mysql_escape_string($nlSMTPHost), "host");
$nlOption->updateOption("smtp", mysql_escape_string($nlSMTPPort), "port");
$nlOption->updateOption("smtp", mysql_escape_string($nlSMTPAuthentication), "auth");
$nlOption->updateOption("smtp", mysql_escape_string($nlSMTPUsername), "username");
$nlOption->updateOption("smtp", mysql_escape_string($nlSMTPPassword), "password");
}
if($nlMethod == "sendmail") {
$_correctMethod = true;
$nlOption->updateOption("sendmail", mysql_escape_string($nlSendmailPath), "sendmail_path");
$nlOption->updateOption("sendmail", mysql_escape_string($nlSendmailArgs), "sendmail_args");
}
if($_correctMethod != false) {
$nlOption->updateOption("sendMethod", $nlMethod);
}
$_nlResultsPerPage = 0;
if(preg_match("/^([0-9]*)$/", $nlResultsPerPage)) {
$_nlResultsPerPage = $nlResultsPerPage;
}
/*
* Template SeitenLimit, Medien Verzeichnis und Template Typ updaten
*/
$nlOption->updateOption("nlMediaID", mysql_escape_string($nlMediaID));
$nlOption->updateOption("nlTplTypeID", mysql_escape_string($nlTplTypeID));
$nlOption->updateOption("nlResultsPerPage", $_nlResultsPerPage);
$nlOption->getOptionList();
}
if(!$nlError) {
/*
* Versand Methoden und deren Einstellungen definieren
*/
$nlSendMethods = array (
"mail" => 1,
"smtp" => $nlOption->getMultipleOption("smtp"),
"sendmail" => $nlOption->getMultipleOption("sendmail")
);
/*
* Setting Array aufbauen
*/
$nlSettingArr = array(
"mediaTypes" => $myMedia->getMediaTypes(),
"mediaTypeSelected" => $nlOption->getSingleOption("nlTplTypeID"),
"mediaBranches" => $myMedia->getAllowedBranches("newsletter"),
"mediaBranchSelected" => $nlOption->getSingleOption("nlMediaID"),
"sendMethods" => $nlSendMethods,
"sendMethodSelected" => $nlOption->getSingleOption("sendMethod"),
"fromAdress" => $nlOption->getSingleOption("from"),
"resultsPerPage" => $nlOption->getSingleOption("nlResultsPerPage")
);
$tpl->assign("nlSettings_set", "1");
$tpl->assign("nlSettings", $nlSettingArr);
$mainPluginContent[] = $tpl->fetch($config['templates']."newsletter.template", null, "pluginNL".$cbUserID);
$mainMessageContent[] = $tpl->fetch($config['templates']."messages.template", null, "pluginNL".$cbUserID);
}
?>