/** * Count the requests by IP * * Format of a record ( $content ) when extracted to $data is expected to be * ` [0] => /oik_api/_deprecated_argument/ [1] => [2] => 0.648111 [3] => 7.0.8 [4] => 1947 [5] => 4212 [6] => 333 [7] => 19 [8] => 361 [9] => 50 [10] => 23 [11] => 11 [12] => 51 [13] => [14] => [15] => [16] => 66.249.66.179 [17] => 0.648082 [18] => 2016-07-27T00:00:06+00:00 [19] => Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) [20] => GET ` * */ function count_ips($contents, $match_request = 'wp-login.php') { foreach ($contents as $content) { $data = str_getcsv($content); //print_r( $data ); //gob(); $request = $data[0]; $ip = $data[16]; $elapsed = $data[2]; $http_user_agent = $data[19]; add_ip($ip, $elapsed, $http_user_agent, $request, $match_request); } }
function check_ip($ip) { $ip = mysql_real_escape_string($ip); $select = "SELECT * FROM ip_address WHERE address = '{$ip}' AND deleted = 'n'"; $result = mysql_query($select); $info = mysql_fetch_assoc($result); if ($info['address']) { return false; } else { add_ip($ip); return true; } }
include_once 'ressources/class.templates.inc'; include_once 'ressources/class.ldap.inc'; include_once 'ressources/class.users.menus.inc'; include_once 'ressources/class.artica.inc'; include_once 'ressources/class.ini.inc'; include_once 'ressources/class.amavis.inc'; $user = new usersMenus(); if ($user->AsPostfixAdministrator == false) { $tpl = new templates(); echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');"; die; exit; } if (isset($_GET["add-ip"])) { add_ip(); exit; } if (isset($_GET["ip-list"])) { ip_list(); exit; } if (isset($_GET["del-ip"])) { ip_del(); exit; } page(); //EnableAmavisInMasterCF function page() { $page = CurrentPageName();
$ip_number = trim($ip_number_1) . '.' . trim($ip_number_2) . '.' . trim($ip_number_3) . '.' . trim($ip_number_4); $query = <<<SQL_QUERY select * from server_ips where ip_number = ? SQL_QUERY; $rs = exec_query($sql, $query, array($ip_number)); if ($rs->RowCount() == 0) { return false; } return true; } /* * * static page messages. * */ gen_admin_menu($tpl); add_ip($tpl, $sql); show_IPs($tpl, $sql); $tpl->assign(array('MANAGE_IPS' => tr('Manage IPs'), 'TR_AVAILABLE_IPS' => tr('Available IPs'), 'TR_IP' => tr('IP'), 'TR_DOMAIN' => tr('Domain'), 'TR_ALIAS' => tr('Alias'), 'TR_ACTION' => tr('Action'), 'TR_UNINSTALL' => tr('Uninstall'), 'TR_ADD' => tr('Add'), 'TR_ADD_NEW_IP' => tr('Add new IP'), 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete'))); gen_page_message($tpl); $tpl->parse('PAGE', 'page'); $tpl->prnt(); if (isset($cfg['DUMP_GUI_DEBUG'])) { dump_gui_debug(); } unset_messages();
$numa = md5($numa); $sid = $login . ':'; $num = rand(1, 9); $sid .= $num; $sid .= substr($numa, 0, $num); $num2 = rand(1, 9); $sid .= $num2; $sid .= substr($numa, $num); // udalim staruju sessiju mysql_query("DELETE FROM session WHERE login = '******';", $dbcnx); // sozdadim novuju //$ip = $_SERVER['HTTP_X_REAL_IP']; // (!$ip) $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; $ip = $_SERVER['REMOTE_ADDR']; $ua = $_SERVER['HTTP_USER_AGENT']; add_ip($ip, $ua, $login); $ip .= '|' . $ua; mysql_query("INSERT INTO session VALUES ('" . $sid . "', '" . $login . "', '" . $pass . "', NOW(), '" . $ip . "', '" . $numa . "');", $dbcnx); //////// $q = mysql_query("SELECT last, admin FROM players WHERE login = '******';", $dbcnx); $l = mysql_fetch_assoc($q); $last = explode('|', $l['last']); // poslednij razegeneracija sejchas bud: $last[2] = time(); $nlast = $last[0] . '|' . $last[1] . '|' . $last[2] . '|' . $last[3] . '|' . $last[4] . '|' . $last[5] . '|' . $last[6] . '|' . $last[7] . '|' . $last[8]; mysql_query("UPDATE players SET active = '1', last = '" . $nlast . "' WHERE login = '******';", $dbcnx); // tem kto v polnom bloke -3 wiw: if ($l['admin'] == -3) { exit('вы в абсолютном блоке!'); } // proverka otkryta li igra
* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @link http://www.easyscp.net * @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); $tpl = EasySCP_TemplateEngine::getInstance(); $template = 'admin/ip_manage.tpl'; $interfaces = new EasySCP_NetworkCard(); show_Network_Cards($tpl, $interfaces); add_ip($tpl); show_IPs($tpl); // static page messages $tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Admin/IP manage'), 'TR_SETTINGS' => tr('Settings'), 'MANAGE_IPS' => tr('Manage IPs'), 'TR_AVAILABLE_IPS' => tr('Available IPs'), 'TR_IP' => tr('IP'), 'TR_IPv6' => tr('IPv6'), 'TR_DOMAIN' => tr('Domain'), 'TR_ALIAS' => tr('Alias'), 'TR_ACTION' => tr('Action'), 'TR_NETWORK_CARD' => tr('Network interface'), 'TR_ADD' => tr('Add'), 'TR_ADD_NEW_IP' => tr('Add new IP'), 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete this IP: %s?', true, '%s'))); gen_admin_mainmenu($tpl, 'admin/main_menu_settings.tpl'); gen_admin_menu($tpl, 'admin/menu_settings.tpl'); gen_page_message($tpl); if ($cfg->DUMP_GUI_DEBUG) { dump_gui_debug($tpl); } $tpl->display($template); unset_messages(); function gen_ip_action($ip_id, $status) { $cfg = EasySCP_Registry::get('Config'); if ($status == $cfg->ITEM_OK_STATUS) {
$votes = $_POST['year_end_votes']; $poll_form = $_POST['poll']; $vote_count = $_POST['write_in_value'] == '' ? count($votes) : count($votes) + 1; if ($vote_count != max_picks_for($poll_form)) { echo "<div class=\"row\" id=\"flash\">\n\n <div class=\"twelve columns top-spacer_20 center error\">Wow, this is embarrassing...<br>It seems that you didn't pick enough, please try again.</div>\n\n \n</div>"; } else { if (has_voted($ip, $poll_form) == false) { $insert = add_votes_for($poll_form, $votes); if ($poll_form == 'songs') { add_song_votes_for($ip, $votes, $_POST['write_in_value']); } if ($_POST['write_in_value']) { $insert = add_manual_vote_for($ip, $poll_form, $_POST['write_in_value']); } if ($insert) { add_ip($ip, $poll_form); echo "<div class=\"row\" id=\"flash\">\n\n <div class=\"twelve columns top-spacer_20 center success\">Thanks!<br>Your votes have been recorded!</div>\n\n \n</div>"; } } } if ($_POST['contest_form']) { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $hometown = $_POST['hometown']; $contest = $_POST['contest']; $newsletter = $_POST['newsletter']; if (!$name || !$email || !$phone || !$hometown || !$contest || !$newsletter) { $new_contestant = 'missing_values'; } else { $new_contestant = add_contestant($name, $email, $phone, $hometown, $contest, $newsletter, $ip);