<?php
//Copyright (c) Florian Grannemann
//Last change in version: 2.0 RC 2
/*
******************************************************************************
ADbNewsSender 2
Copyright (C) 2009 Florian Grannemann (hide@address.com)
Website: http://adbnewssender.sf.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
******************************************************************************
*/
//Do not edit anything unless you realy REALY know what you are doing!
$NLConfOption=$_POST["NLConfOption"];
if($NLConfOption !="update")
{
$NLConf_map=array();
$NLConf_map["Time_on_ML"]= $MyNL->get_NLconfig_setting("Time_on_ML");
$NLConf_map["Time_on_PL"]= $MyNL->get_NLconfig_setting("Time_on_PL");
$NLConf_map["NL_name"]= $MyNL->get_NLconfig_setting("NL_name");
$NLConf_map["Email"]= $MyNL->get_NLconfig_setting("Email");
$NLConf_map["Language"]= $MyNL->get_NLconfig_setting("Language");
}
else
{
$NLConf_map=array();
$NLConf_map["Time_on_ML"]= $_POST["Time_on_ML"];
$NLConf_map["Time_on_PL"]= $_POST["Time_on_PL"];
if(!$NLConf_map["Time_on_ML"] || intval($NLConf_map["Time_on_ML"]) <2)
{
$NLConf_map["Time_on_ML"]="2";
}
if(intval($NLConf_map["Time_on_ML"]) > 60)
{
$NLConf_map["Time_on_ML"]="60";
}
if(!$NLConf_map["Time_on_PL"] || intval($NLConf_map["Time_on_ML"]) <1)
{
$NLConf_map["Time_on_PL"]="1";
}
if(intval($NLConf_map["Time_on_PL"]) > 14)
{
$NLConf_map["Time_on_PL"]="14";
}
$NLConf_map["NL_name"]= htmlentities($_POST["NL_name"]);
$NLConf_map["Email"]= $_POST["Email"];
$NLConf_map["Language"]= addslashes($_POST["Language"]);
$NLConf_map["Language"]= preg_replace("/\.\./","",$NLConf_map["Language"]);
$error="";
foreach($NLConf_map as $key=>$val)
{
if(!$val)
{
$error=$error.$MSG_Map[$key]."<br>";
}
}
if(!$error)
{
foreach($NLConf_map as $key=>$val)
{
$MyNL->replace_setting($key,"$val");
}
print "<b>".$MSG_Success."</b><br>";
}
else
{
print $ErrorMSG_1."<br>".$error;
}
print "<br><br>";
}
print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=post>";
print "<input type=\"hidden\" name=\"cur_NLcof_modul\" value=\"$cur_NLcof_modul\">";
//for security reasons, submiting current admin modul and newsletter
print "<input type=\"hidden\" name=\"modul\" value=\"".$_SESSION["currentModulType"]."|".intval($_SESSION["currentModulNr"])."\">";
print "<input type=\"hidden\" name=\"SelectNL\" value=\"".$_SESSION["CurrentNL"]."\">";
print $MSG1."<br>";
print "<table border=0>";
print "<tr><td>".$MSG_Map["NL_name"].":</td><td><input type=text name=\"NL_name\"size=40 value=\"".$NLConf_map["NL_name"]."\"></td></tr>";
print "<tr><td>".$MSG_Map["Email"].":</td><td><input type=text name=\"Email\" size=40 value=\"".$NLConf_map["Email"]."\"></td></tr>";
print "<tr><td></td><td></td></tr>";
print "<tr><td></td><td></td></tr>";
print "<tr><td>".$MSG_Map["Time_on_ML"].":</td><td>";
print "<select name=\"Time_on_ML\">";
$i=2;
while ($i <=60)
{
print "<option value=\"$i\"";
if ($i == $NLConf_map["Time_on_ML"])
{
print " selected";
}
print ">$i </option>";
$i++;
}
print "</select>$Months</td></tr>";
print "<tr><td>".$MSG_Map["Time_on_PL"].":</td><td>";
print "<select name=\"Time_on_PL\">";
$i=1;
while ($i <=14)
{
print "<option value=\"$i\"";
if ($i == $NLConf_map["Time_on_PL"])
{
print " selected";
}
print ">$i </option>";
$i++;
}
print "</select>$Days</td></tr>";
print "<tr><td>".$MSG_Map["Language"].":</td>";
include "$path_to_protected/localisation/Language_Reg.php.inc";
print "<td><p><select name=\"Language\">";
$i=0;
while ($i < count($Lang_pack_name))
{
print "<option value=\"".$Lang_pack_dir[$i]."\"";
if($Lang_pack_dir[$i]==$NLConf_map["Language"])
{
print " selected";
}
print ">".$Lang_pack_name[$i]."</option>";
$i++;
}
print "</select></td></tr>";
print "<tr><td>";
print "<input type=\"hidden\" name=\"NLConfOption\" value=\"update\"></td><td><input type=\"Submit\" value=\"$MSG_Submit\"></form></td></tr></table>";
?>