exec("INSERT INTO `$dbname`.`csrf_token` (`token`,`timestamp`,`sessionid`) VALUES ('$csrf_token','".time()."','".session_id()."')") === false) { $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; } if (($db_csrf = $mysqlcon->query("SELECT * FROM `$dbname`.`csrf_token` WHERE `sessionid`='".session_id()."'")->fetchALL(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; } if(($channellist = $mysqlcon->query("SELECT * FROM `$dbname`.`channel` ORDER BY `pid`,`channel_order`,`channel_name` ASC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)) === false) { $err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3; } $channelinfo_toplist_active = 0; if (isset($_POST['update']) && isset($db_csrf[$_POST['csrf_token']])) { if (isset($_POST['channelinfo_toplist_active'])) $channelinfo_toplist_active = 1; if(is_array($_POST['channelid'])) $_POST['channelid'] = $_POST['channelid'][0]; if(!isset($err_lvl) || $err_lvl < 3) { $sqlexec = $mysqlcon->prepare("INSERT INTO `$dbname`.`addons_config` (`param`,`value`) VALUES ('channelinfo_toplist_active', :channelinfo_toplist_active), ('channelinfo_toplist_desc', :channelinfo_toplist_desc), ('channelinfo_toplist_delay', :channelinfo_toplist_delay), ('channelinfo_toplist_channelid', :channelinfo_toplist_channelid), ('channelinfo_toplist_modus', :channelinfo_toplist_modus) ON DUPLICATE KEY UPDATE `value`=VALUES(`value`); DELETE FROM `$dbname`.`csrf_token` WHERE `token`= :csrf_token"); $sqlexec->bindParam(':channelinfo_toplist_active', $channelinfo_toplist_active, PDO::PARAM_STR); $sqlexec->bindParam(':channelinfo_toplist_desc', $_POST['channelinfo_toplist_desc'], PDO::PARAM_STR); $sqlexec->bindParam(':channelinfo_toplist_delay', $_POST['channelinfo_toplist_delay'], PDO::PARAM_STR); $sqlexec->bindParam(':channelinfo_toplist_channelid', $_POST['channelid'], PDO::PARAM_STR); $sqlexec->bindParam(':channelinfo_toplist_modus', $_POST['channelinfo_toplist_modus'], PDO::PARAM_STR); $sqlexec->bindParam(':csrf_token', $_POST['csrf_token']); $sqlexec->execute(); if ($sqlexec->errorCode() != 0) { $err_msg = print_r($sqlexec->errorInfo(), true); $err_lvl = 3; } else { $err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], '
'); $err_lvl = NULL; } } $addons_config['channelinfo_toplist_active']['value'] = $channelinfo_toplist_active; $addons_config['channelinfo_toplist_channelid']['value'] = $_POST['channelid']; $addons_config['channelinfo_toplist_modus']['value'] = $_POST['channelinfo_toplist_modus']; $addons_config['channelinfo_toplist_delay']['value'] = $_POST['channelinfo_toplist_delay']; $addons_config['channelinfo_toplist_desc']['value'] = $_POST['channelinfo_toplist_desc']; } elseif(isset($_POST['update'])) { echo '
',$lang['errcsrf'],'
'; rem_session_ts3(); exit; } ?>

'; } else { echo ''; } ?>