************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
+
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
// Add option for userlog
$cacheArray['admins'] = ADD_OPTION_LINES("admins", "id", "login", "", "email");
$SW = 2; $rowNameS = "";
- foreach ($_POST['sel'] as $template=>$sel)
+ foreach ($_POST['sel'] as $template => $sel)
{
// First of all load data from DB
$result = SQL_QUERY_ESC("SELECT admin_id, id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY id",
array($template), __FILE__, __LINE__);
- $OUT = ""; $aid = "0"; $aid2 = "0";
+ $OUT = ""; $aid = 0; $aid2 = 0;
while (list($aid, $id) = SQL_FETCHROW($result))
{
$OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
if (isset($_POST['change']))
{
// Ok, update database
- foreach ($_POST['admin_id'] as $id=>$aid)
+ foreach ($_POST['admin_id'] as $id => $aid)
{
// Secure IDs
$id = bigintval($id);
$aid = bigintval($aid);
// Update entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_mails SET admin_id=%d WHERE id=%d ORDER BY id LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_mails SET admin_id=%s WHERE id=%s ORDER BY id LIMIT 1",
array($aid, $id), __FILE__, __LINE__);
if (($aid < 1) && (!empty($_POST['template'][$id])))
if ($_POST['admin_new'][$_POST['template'][$id]] > 0)
{
// Add new admin
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_mails (admin_id, mail_template) VALUES ('%s', '%s')",
+ $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_mails (admin_id, mail_template) VALUES ('%s','%s')",
array($aid, $_POST['template'][$id]), __FILE__, __LINE__);
}
}