Location: PHPKode > projects > ADbNewsSender > ADbNewsSender_2.0.4/protected/admin/nl/config_modules/security.php.inc
<?php
//Copyright (c) Florian Grannemann
//Last change in version: 2.0 Beta 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["Limit_Confirmation_Attempts"]= $MyNL->get_NLconfig_setting("Limit_Confirmation_Attempts");
	$NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]= $MyNL->get_NLconfig_setting("Max_no_of_eq_IP_Addr_on_PL");
}
else
{
	$NLConf_map=array();
	$NLConf_map["Limit_Confirmation_Attempts"]= $_POST["Limit_Confirmation_Attempts"];
	
	$NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]= $_POST["Max_no_of_eq_IP_Addr_on_PL"];
	if(intval($NLConf_map["Limit_Confirmation_Attempts"]) <1)
	{
	   $NLConf_map["Limit_Confirmation_Attempts"]="0";
	    //0: unlimited
	}
	if(intval($NLConf_map["Limit_Confirmation_Attempts"]) >30)
	{
	   $NLConf_map["Limit_Confirmation_Attempts"]="30";
	
	}

	if(intval($NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]) <1)
	{
	   $NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]="0";
	    //0: unlimited
	}
	if(intval($NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]) >100)
	{
	   $NLConf_map["Max_no_of_eq_IP_Addr_on_PL"]="100";
	
	}
	$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 "<br><br>";
	print "<table border=0>";
	
	//Limit confirmation attempts:
	print "<tr><td>".$MSG_Map["Limit_Confirmation_Attempts"].":</td><td>";
	print "<select name=\"Limit_Confirmation_Attempts\"><option value=\"0\">$MSG_option_unlimited</option>";
	$i=1;
	while ($i <=30)
	{
		print "<option value=\"$i\"";
		if ($i == $NLConf_map["Limit_Confirmation_Attempts"])
		{
			print " selected";
		}
		print ">$i </option>";
		$i++;
	}

	print "</select></td></tr>";

	//Max_no_of_eq_IP_Addr_in_PL:
	print "<tr><td>".$MSG_Map["Max_no_of_eq_IP_Addr_on_PL"].":</td><td>";
	print "<select name=\"Max_no_of_eq_IP_Addr_on_PL\"><option value=\"0\">$MSG_option_unlimited</option>";
	$i=1;
	while ($i <=100)
	{
		print "<option value=\"$i\"";
		if ($i == $NLConf_map["Max_no_of_eq_IP_Addr_on_PL"])
		{
			print " selected";
		}
		print ">$i </option>";
		$i++;
	}

	print "</select></td></tr>";
	print "<input type=\"hidden\" name=\"NLConfOption\" value=\"update\"></td><td><input type=\"Submit\" value=\"$MSG_Submit\"></form></td></tr></table>";


?>
       

















Return current item: ADbNewsSender