예제 #1
0
 public function insertUser($data)
 {
     $data["ctime"] = time();
     $data["ip"] = get_real_ip();
     $this->db->insert($this->database, $data);
     return $this->db->insert_id();
 }
예제 #2
0
파일: util.php 프로젝트: CamTosh/blogotext
function check_session()
{
    if ($GLOBALS['use_ip_in_session'] == 1) {
        $ip = get_real_ip();
    } else {
        $ip = date('m');
    }
    @session_start();
    ini_set('session.cookie_httponly', TRUE);
    // use a cookie to remain logged in
    $user_id = hash_password($GLOBALS['mdp'] . $GLOBALS['identifiant'] . $GLOBALS['salt'], md5($_SERVER['HTTP_USER_AGENT'] . $ip . $GLOBALS['salt']));
    if (isset($_COOKIE['BT-admin-stay-logged']) and $_COOKIE['BT-admin-stay-logged'] == $user_id) {
        $_SESSION['user_id'] = md5($user_id);
        session_set_cookie_params(365 * 24 * 60 * 60);
        // set new expiration time to the browser
        session_regenerate_id(true);
        // Send cookie
        return TRUE;
    }
    if (!isset($_SESSION['user_id']) or $_SESSION['user_id'] != $GLOBALS['identifiant'] . $GLOBALS['mdp'] . md5($_SERVER['HTTP_USER_AGENT'] . $ip)) {
        return FALSE;
    } else {
        return TRUE;
    }
}
 function GetTracker($serverID = "")
 {
     $result = array();
     if (!empty($serverID)) {
         $sql = $this->_serverDB->QueryWithBinds("SELECT NAME, SKILLGAINRATE, ACTIONTIMER, MAXPLAYERS, MAXCREATURES, PERCENT_AGG_CREATURES, PVP, EPIC, MAPNAME FROM SERVERS WHERE SERVER = ?", array($serverID));
         $server = $sql->fetch(PDO::FETCH_ASSOC);
         $server["COUNT"] = $this->GetPlayerCount();
         $server["EXTERNALIP"] = get_real_ip();
         $result = $server;
     }
     return $result;
 }
예제 #4
0
파일: function.php 프로젝트: rainsj/note
 function setLog($data, $_url)
 {
     $new_line = "\r\n";
     $str = "生成时间:" . date("Y-m-d H:i:s") . $new_line;
     $str .= "请求URL:" . $_url . $new_line;
     $str .= "返回数据:" . json_encode($data, JSON_UNESCAPED_UNICODE) . $new_line;
     $str .= "请求IP:" . get_real_ip() . $new_line;
     $str .= $new_line;
     $file_path = Config::get('logPath', '/logs/api_logs/');
     $file_path = rtrim($file_path, "/");
     $filename = $file_path . '/' . date('Ymd') . '/' . date("H") . ".log";
     _write_file($filename, $str);
 }
 if ($txt_name == '' || $txt_email == '' || $txt_comments == '') {
     $err[] = "All fields are required to submit a review.";
 }
 /********************* RECAPTCHA CHECK *******************************
 	This code checks and validates recaptcha
 	****************************************************************/
 $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
 if (!$resp->is_valid) {
     $err[] = "Image Verification failed! (reCAPTCHA said: " . $resp->error . ")";
 }
 if (empty($err)) {
     $to = $a['emai'];
     //$to      = '"Ben Vigl [TEST MODE]" <*****@*****.**>';
     $subject = $a['name'] . ' has been reviewed on AtlantaOccasions.com';
     $headers = 'From: "Occasions Magazine" <*****@*****.**>' . "\r\n" . 'Reply-To: "Occasions Magazine" <*****@*****.**>' . "\r\n" . 'X-Mailer: AO3/PHP/' . phpversion();
     $msg = 'The following review of ' . $a['name'] . ' was submitted:' . "\r\n\r\n" . 'Name: ' . $txt_name . "\r\n" . 'Email: ' . $txt_email . "\r\n" . 'Rating: ' . $rdo_rating . "\r\n" . 'Review: ' . "\r\n\r\n" . $txt_comments . "\r\n\r\n\r\n" . '------------------------------------------------------------' . "\r\n" . 'SENT TO : ' . $a['emai'] . "\r\n" . 'SENT AT : ' . date("D F j, Y, g:i a") . "\r\n" . 'FROM IP : ' . get_real_ip() . "\r\n" . '------------------------------------------------------------' . "\r\n";
     mail($to, $subject, $msg, $headers);
     mail(AO_ADMIN_EMAIL, $subject, $msg, $headers);
     mail(AO_TECH_EMAIL, $subject, $msg, $headers);
     // all clear to save the data to the database
     $api = new PodAPI();
     // since we are saving a new profile, these fields need initializing this one time only
     $comment_data['vendor'] = $a['id'];
     $comment_data['name'] = $txt_name;
     $comment_data['email'] = $txt_email;
     $comment_data['rating'] = $rdo_rating;
     $comment_data['comment'] = $txt_comments;
     $comment_data['comment_date'] = date("Y-m-d H:i:s");
     // safety cleansing
     pods_sanitize($comment_data);
     $params = array('datatype' => 'comments', 'columns' => $comment_data);
예제 #6
0
 private function oplog($addContent)
 {
     if (empty($addContent)) {
         return false;
     }
     //操作日志记录
     $logAdd['app'] = $this->_application;
     $logAdd['controller'] = $this->_controller;
     $logAdd['action'] = $this->_action;
     $logAdd['content'] = json_encode($addContent);
     $logAdd['ip'] = get_real_ip();
     $logAdd['operat'] = UNAME;
     $this->operateLogModel->addOpLog($logAdd);
 }
예제 #7
0
 function save_reply()
 {
     if (!$this->setting->get_conf('system.enable_comment')) {
         form_ajax_failed('text', lang('album_comment_closed'));
     }
     $comment['email'] = safe_convert($this->getPost('email'));
     $comment['author'] = safe_convert($this->getPost('author'));
     $comment['content'] = safe_convert($this->getPost('content'));
     $comment['ref_id'] = intval($this->getPost('ref_id'));
     $comment['type'] = intval($this->getPost('type'));
     $comment['reply_author'] = safe_convert($this->getPost('reply_author'));
     $comment['pid'] = intval($this->getPost('pid'));
     $this->plugin->trigger('before_post_comment');
     if ($this->setting->get_conf('system.enable_comment_captcha') && !$this->user->loggedin()) {
         $captcha =& loader::lib('captcha');
         if (!$captcha->check($this->getPost('captcha'))) {
             form_ajax_failed('text', lang('invalid_captcha_code'));
         }
     }
     if ($comment['email'] && !check_email($comment['email'])) {
         form_ajax_failed('text', lang('error_email'));
     }
     if (!$comment['author']) {
         form_ajax_failed('text', lang('error_comment_author'));
     }
     if (!$comment['content']) {
         form_ajax_failed('text', lang('empty_content'));
     }
     if (!$comment['ref_id'] || !$comment['type'] || !$comment['pid'] || !$comment['reply_author']) {
         form_ajax_failed('text', lang('miss_argument'));
     }
     $comment['post_time'] = time();
     $comment['author_ip'] = get_real_ip();
     if ($this->setting->get_conf('system.comment_audit') == 1 && !$this->user->loggedin()) {
         $comment['status'] = 0;
     } else {
         $comment['status'] = 1;
     }
     if ($reply_id = $this->mdl_comment->save($comment)) {
         $comment['id'] = $reply_id;
         $this->output->set('info', $comment);
         $this->plugin->trigger('reply_comment', $reply_id);
         form_ajax_success('text', loader::view('comments/view', false));
     } else {
         form_ajax_failed('text', lang('reply_failed'));
     }
 }
예제 #8
0
 public function delAction()
 {
     $midArr = daddslashes($this->postVar('mid', ''));
     if (!empty($midArr)) {
         $delArr = $delApiArr = array();
         foreach ($midArr as $key => $val) {
             $apiSendCallBack = '';
             $messageSet['id'] = $val;
             $messageSet['message_type'] = 1;
             // $messageSet['status'] = -1;
             $getMessage = $this->messageModel->getMessage($messageSet);
             if (intval($getMessage['status']) == 0) {
                 $re = $this->messageModel->deleteMessage($val);
             } else {
                 if (!empty($getMessage['callback_info']) && in_array(UID, array(1, 2, 3, 4, 5))) {
                     $re = $this->messageModel->deleteMessage($val);
                     if ($re) {
                         //删除发送成功的公共消息
                         $sendData['msgid'] = $getMessage['callback_info'];
                         $apiData = json_encode($sendData);
                         $apiData = urlencode($apiData);
                         $apiSendJsonRe = file_get_contents(_API_URL_ . "/admin_public_del_msg.do?data={$apiData}");
                         $apiSendRe = json_decode($apiSendJsonRe, true);
                         if (!empty($apiSendRe['data']['rs']) && 1 == $apiSendRe['data']['rs']) {
                             $apiSendCallBack = "succ";
                         } elseif (isset($apiSendRe['errcode']) && isset($apiSendRe['msg'])) {
                             $apiSendCallBack = $apiSendRe['msg'] . "/errcode_" . $apiSendRe['errcode'];
                         }
                         $delArr[$val] = $apiSendCallBack;
                     }
                 } else {
                     $timeInterval = 5 - intval(time() - strtotime($getMessage['createtime'])) / 60;
                     if ($timeInterval < 0) {
                         $timeInterval = 0;
                     }
                     $timeIntervalStr = strval($timeInterval);
                     echo "<script>if (confirm('暂时不能删除,请于审核通过后5分钟尝试,如果失败,请联系开发确认消息状态!'))\n                            location.href = '/admin/message/'; </script>";
                     //                    confirm("暂时不能删除" . "请于" . strval((time() - strtotime($getMessage['createtime'])) / 60) . "分钟后尝试!");
                 }
             }
         }
         if ($delArr) {
             $logAdd['app'] = $this->_application;
             $logAdd['controller'] = $this->_controller;
             $logAdd['action'] = $this->_action;
             $logAdd['content'] = json_encode($delArr);
             $logAdd['ip'] = get_real_ip();
             $logAdd['operat'] = UNAME;
             $this->operateLogModel->addOpLog($logAdd);
             $this->redirect('', '/admin/message/', 0);
         }
     }
     $this->redirect('', '/admin/message/', 0);
 }
예제 #9
0
파일: login.php 프로젝트: liujidong/nei
    $user = $_POST['user'];
    $pwd = $_POST['pwd'];
    //echo (md5($pwd));
    //$rememberme = $_POST['rememberme'] == '1' ? '1':'0';
    if ($user == '' || $pwd == '') {
        admin_msg('login.php', '错误提示:请填写用户名或密码!');
    }
    $result = $db->GetRow("SELECT * FROM mycms_admin_user WHERE (state is null or state !=-2) and username = '******' AND password = '******'");
    if (!$result) {
        admin_msg('login.php', '错误提示:用户名或密码填写错误!');
    } else {
        //session_register("userInfo");
        $_SESSION['userInfo'] = null;
        $_SESSION["userInfo"] = base64_encode(serialize($result));
        //unserialize(base64_decode())
        $db->Execute('UPDATE mycms_admin_user SET lognum=lognum+1 WHERE uid=' . $result['uid']);
        //header('location:index.php');
        $db->Execute("INSERT INTO mycms_admin_log(uid,uname,ltime,lip) VALUES(" . $result['uid'] . ",'" . $result['username'] . "','" . date('Y-m-d h:i:s') . "','" . get_real_ip() . "')");
        header('location:index.php');
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'out') {
    session_destroy();
    header('location:login.php');
} else {
    if (isset($_GET["img"]) || isset($_GET["type"])) {
        $smarty->display('admin/login0.html');
    } else {
        $smarty->display('admin/login.html');
    }
}
$db->close();
예제 #10
0
 public function auditholdAction()
 {
     $payId = (int) $this->reqVar('pay_id', 0);
     $dosubmit = daddslashes($this->postVar('dosubmit', ''));
     $remark = daddslashes($this->postVar('remark', ''));
     $setTimeOut = 0;
     $exchangeRe = $this->exchangeModel->getExchange(array('id' => $payId));
     if (!empty($exchangeRe['id']) && !empty($exchangeRe['uid'])) {
         if (!empty($dosubmit)) {
             $exchangeHSet['exchange_id'] = $exchangeRe['id'];
             $isH = $this->exchangeHModel->getExchangeH($exchangeHSet);
             if ($isH) {
                 $this->exchangeHModel->saveExchangeH($exchangeRe['id'], $remark);
             } else {
                 $exchangeHAdd['exchange_id'] = $exchangeRe['id'];
                 $exchangeHAdd['remark'] = $remark;
                 $this->exchangeHModel->addExchangeH($exchangeHAdd);
             }
             //操作记录
             $logAdd['app'] = $this->_application;
             $logAdd['controller'] = $this->_controller;
             $logAdd['action'] = $this->_action;
             $logAdd['content'] = json_encode(array($payId => "暂缓"));
             $logAdd['ip'] = get_real_ip();
             $logAdd['operat'] = UNAME;
             $this->operateLogModel->addOpLog($logAdd);
             $setTimeOut = 1;
         }
     }
     $this->assign('setTimeOut', $setTimeOut);
     $this->assign('payId', $payId);
     $this->getViewer()->needLayout(false);
     $this->render('audit_hold');
 }
    $txt_name = '';
    $txt_email = '';
    $txt_phone = '';
    $txt_best = '';
    $txt_comments = '';
    if ($_POST['submitted'] == "1") {
        $txt_name = htmlspecialchars($_POST['txt_name']);
        $txt_email = htmlspecialchars($_POST['txt_email']);
        $txt_phone = htmlspecialchars($_POST['txt_phone']);
        $txt_best = htmlspecialchars($_POST['txt_best']);
        $txt_comments = stripcslashes(htmlspecialchars($_POST['txt_comments'], ENT_NOQUOTES));
        $to = $a['emai'];
        //$to      = '"Ben Vigl [TEST MODE]" <*****@*****.**>';
        $subject = 'Found you on AtlantaOccasions.com and would like more information';
        $headers = 'From: "Occasions Magazine Contact Form" <*****@*****.**>' . "\r\n" . 'Reply-To: "Occasions Magazine" <*****@*****.**>' . "\r\n" . 'X-Mailer: AO3/PHP/' . phpversion();
        $msg = 'The following was sent from the Occasions Magazine Contact Form:' . "\r\n\r\n" . 'Name: ' . $txt_name . "\r\n" . 'Email: ' . $txt_email . "\r\n" . 'Phone: ' . $txt_phone . "\r\n" . 'Best Time to Contact: ' . $txt_best . "\r\n" . 'Comment/Details: ' . "\r\n\r\n" . $txt_comments . "\r\n\r\n\r\n" . '------------------------------------------------------------' . "\r\n" . 'SENT TO : ' . $a['emai'] . "\r\n" . 'SENT AT : ' . date("D F j, Y, g:i a") . "\r\n" . 'FROM IP : ' . get_real_ip() . "\r\n" . '------------------------------------------------------------' . "\r\n";
        mail($to, $subject, $msg, $headers);
        mail(AO_ADMIN_EMAIL, $subject, $msg, $headers);
        mail(AO_TECH_EMAIL, $subject, $msg, $headers);
        echo <<<HEREDOC
\t<h3>Thank you!</h3>
\t<p>Your email has been sent to {$a['name']}.</p>
\t<p>If you do not receive a response within 24 hours, we suggest giving them a quick call to make sure your email was delivered successfully.</p>
HEREDOC;
    } else {
        echo <<<HEREDOC
\t<p>To contact this business, please fill out the email form below and click "Send Email" and it will be delivered to the appropriate contact person at <b>{$a['name']}</b> immediately. Please provide as much information as possible to ensure a timely response.</p>
\t<form action="./" method="post">
\t\t<div class="pro_contactrow">
\t\t\t<div class="pro_contactlabel"><label for="txt_name">Name:</label></div>
\t\t\t<div class="pro_contacttxt"><input name="txt_name" type="text" size="50" id="txt_name" value="{$txt_name}" /></div>
예제 #12
0
 public function delAction()
 {
     $cidArr = daddslashes($this->postVar('cid', ''));
     if (!empty($cidArr)) {
         $delArr = array();
         foreach ($cidArr as $key => $val) {
             $re = $this->channelIncomeSetModel->deleteCICS($val);
             if ($re) {
                 $delArr[] = $val;
             }
         }
         if ($delArr) {
             $logAdd['app'] = $this->_application;
             $logAdd['controller'] = $this->_controller;
             $logAdd['action'] = $this->_action;
             $logAdd['content'] = json_encode($delArr);
             $logAdd['ip'] = get_real_ip();
             $logAdd['operat'] = UNAME;
             $this->operateLogModel->addOpLog($logAdd);
         }
     }
     $this->redirect('', '/admin/channel_income/', 0);
 }
예제 #13
0
 /**
  * 登录
  */
 public function login($email, $password)
 {
     $model = $this->getUserByMail($email);
     if (!$model) {
         return false;
     }
     $this->salt = $model['salt'];
     $this->password = $model['password'];
     if (!$this->validatePassword($password)) {
         return false;
     }
     $getRealIp = get_real_ip();
     $obj = null;
     if ($this->save(array('id' => $model['id'], 'login_ip' => $getRealIp, 'last_time' => date('Y-m-d H:i:s')))) {
         $uinfo = $this->encrypt(array('uid' => $model['id'], 'uname' => $model['truename'], 'last' => $model['last_time']));
         $ukey = md5($uinfo . self::IHOUSE_KEY);
         $now = time() + self::COOKIE_EXPIRED;
         $host = $_SERVER['HTTP_HOST'];
         $obj = setcookie(self::UINFO, $uinfo, $now, '/', $host) && setcookie(self::UKEY, $ukey, $now, '/', $host) ? $this : null;
         if ($obj) {
             $this->uid = $model['id'];
             $this->uname = $model['truename'];
             $this->is_pause = $model['is_pause'];
             $this->last_time = $model['last_time'];
         }
     }
     return $obj;
 }
$txt_name = htmlspecialchars($_POST['txt_name']);
$txt_email = htmlspecialchars($_POST['txt_email']);
$txt_phone = htmlspecialchars($_POST['txt_phone']);
$txt_message = stripcslashes(htmlspecialchars($_POST['txt_message'], ENT_NOQUOTES));
if ($txt_name && $txt_email && $txt_phone && $txt_message) {
    $profile = new Pod('vendor_profiles');
    $profile->findRecords('id', -1, "t.id = '{$pid}'");
    //$profile->findRecords( 'id', $pid);
    $total = $profile->getTotalRows();
    if ($total > 0) {
        $profile->fetchRecord();
        $a = get_vendorfields($profile);
        $to = $a['emai'];
        $subject = 'Found you on OccasionsOnline.com Mobile (' . $txt_name . ')';
        $headers = 'From: "Occasions Magazine Contact Form" <*****@*****.**>' . "\r\n" . 'Reply-To: "Occasions Magazine" <*****@*****.**>' . "\r\n" . 'X-Mailer: AO5/PHP/' . phpversion();
        $msg = 'The following was sent from the Occasions Magazine Mobile Contact Form:' . "\r\n\r\n" . 'Name: ' . $txt_name . "\r\n" . 'Email: ' . $txt_email . "\r\n" . 'Phone: ' . $txt_phone . "\r\n" . 'Message: ' . "\r\n\r\n" . $txt_message . "\r\n\r\n\r\n" . '------------------------------------------------------------' . "\r\n" . 'SENT TO : ' . $a['name'] . "\r\n" . 'CONTACT : ' . $a['emai'] . "\r\n" . 'SENT AT : ' . date("D F j, Y, g:i a") . "\r\n" . 'FROM IP : ' . get_real_ip() . "\r\n" . '------------------------------------------------------------' . "\r\n";
        mail($to, $subject, $msg, $headers, AO_EMAIL_FLAGS);
        mail(AO_ADMIN_EMAIL, $subject, $msg, $headers, AO_EMAIL_FLAGS);
        mail(AO_TECH_EMAIL, $subject, $msg, $headers, AO_EMAIL_FLAGS);
        $success = true;
    } else {
        $err_msg = "There was an error locating contact information for this vendor. We are sorry for the inconvenience.";
        $err_title = "We Encountered a Problem";
    }
} else {
    $err_msg = "Please be sure to fill in all fields.";
    $err_title = "Almost there...";
}
if ($success) {
    ?>
<div data-role="page" id="contact_results" data-theme="o">
예제 #15
0
파일: 01CCList.php 프로젝트: Nazg-Gul/gate
 function Save()
 {
     if (!$this->GetAllowed('EDIT')) {
         return;
     }
     if ($this->CheckExistment()) {
         return;
     }
     $arr = $this->dataset->GetFieldValues(true);
     $arr['timestamp'] = time();
     $arr['user_id'] = "'" . user_id() . "'";
     $arr['ip'] = "'" . get_real_ip() . "'";
     db_insert($this->settings['content'], $arr);
 }
예제 #16
0
 function Rollback($id)
 {
     if (!$this->GetAllowed('EDITINFO')) {
         return;
     }
     $r = db_row(db_select($this->settings['content'], array('id')));
     $nid = db_next_field($this->settings['content'], 'id');
     db_update($this->settings['content'], array('id' => $nid, 'timestamp' => time(), 'ip' => '"' . get_real_ip() . '"', 'user_id' => user_id()), '`id`=' . $id);
 }
예제 #17
0
 public function exception_delAction()
 {
     $uidArr = daddslashes($this->postVar('uid', ''));
     if (!empty($uidArr)) {
         $delArr = array();
         foreach ($uidArr as $key => $val) {
             $re = $this->inviteHoldExceptionModel->deleteInviteHoldException($val);
             if ($re) {
                 $delArr[] = $val;
             }
         }
         if ($delArr) {
             $logAdd['app'] = $this->_application;
             $logAdd['controller'] = $this->_controller;
             $logAdd['action'] = $this->_action;
             $logAdd['content'] = json_encode($delArr);
             $logAdd['ip'] = get_real_ip();
             $logAdd['operat'] = UNAME;
             $this->operateLogModel->addOpLog($logAdd);
         }
     }
     $this->redirect('', '/admin/invite_hold/exception', 0);
 }
예제 #18
0
파일: misc.php 프로젝트: rratcliffe/fsen
function get_caller_id()
{
    if (isset($_SESSION['FSEInfo'])) {
        $caller_id = $_SESSION['FSEInfo']['fse_id'];
    } else {
        if (session_id() != '') {
            $caller_id = md5(session_id());
        } else {
            $client_ip = get_real_ip();
            $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
            $caller_id = md5("{$client_ip}-{$user_agent}");
        }
    }
    return $caller_id;
}
예제 #19
0
 function BuildDBArrayFromDataset($dataset, $pid, $uid, $order)
 {
     $arr = $dataset->GetFieldValues(true);
     $arr['timestamp'] = time();
     $arr['user_id'] = user_id();
     $arr['ip'] = db_string(get_real_ip());
     $arr['pid'] = $pid;
     $arr['uid'] = $uid;
     $arr['order'] = $order;
     return $arr;
 }
예제 #20
0
파일: ipv4.php 프로젝트: HostOnNet/iptools
<?php

echo get_real_ip();
function get_real_ip()
{
    if (isset($_SERVER["HTTP_CLIENT_IP"])) {
        return $_SERVER["HTTP_CLIENT_IP"];
    } elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
        return $_SERVER["HTTP_X_FORWARDED_FOR"];
    } elseif (isset($_SERVER["HTTP_X_FORWARDED"])) {
        return $_SERVER["HTTP_X_FORWARDED"];
    } elseif (isset($_SERVER["HTTP_FORWARDED_FOR"])) {
        return $_SERVER["HTTP_FORWARDED_FOR"];
    } elseif (isset($_SERVER["HTTP_FORWARDED"])) {
        return $_SERVER["HTTP_FORWARDED"];
    } else {
        return $_SERVER["REMOTE_ADDR"];
    }
}
예제 #21
0
 public function auditAction()
 {
     $dosubmit = daddslashes($this->postVar('dosubmit', ''));
     $payId = (int) $this->reqVar('pay_id', 0);
     $page = (int) $this->reqVar('page', 1);
     $aidArr = daddslashes($this->postVar('aid', ''));
     if (empty($aidArr) && !empty($payId) && !empty($dosubmit)) {
         $aidArr[] = $payId;
     }
     if (!empty($aidArr)) {
         $auditArr = array();
         foreach ($aidArr as $key => $val) {
             $exchangeRe = $this->exchangeModel->getExchange(array('id' => $val, 'ptype' => 3));
             if (!empty($exchangeRe['id']) && !empty($exchangeRe['uid'])) {
                 //支付状态特殊处理
                 $re = $this->exchangeModel->alipayAudit($exchangeRe['id'], UNAME);
                 if ($re) {
                     $auditArr[] = $val;
                     $url = "http://b.yxpopo.com/admin_quest_bytype.do?uid={$exchangeRe['uid']}&quest_type=6";
                     file_get_contents($url);
                 }
             }
         }
         if ($auditArr) {
             $logAdd['app'] = $this->_application;
             $logAdd['controller'] = $this->_controller;
             $logAdd['action'] = $this->_action;
             $logAdd['content'] = json_encode($auditArr);
             $logAdd['ip'] = get_real_ip();
             $logAdd['operat'] = UNAME;
             $this->operateLogModel->addOpLog($logAdd);
         }
     }
     $this->redirect('', '/admin/audit_pay/?page=' . $page, 0);
 }
예제 #22
0
파일: index.php 프로젝트: hibon62/blog-php
?>
            </ul>
        </div>

        <?php 
//Récuperation des données
$query = "SELECT * FROM articles";
$result = mysql_query($query);
while ($ligne = mysql_fetch_assoc($result)) {
    //Affichage du titre
    echo '<h3>' . $ligne[titre] . '</h3><br>';
    //Affichage de l'image
    echo '<img class = "img-art" src = "assets/images/' . $ligne['img'] . '" width=600px><br>';
    //Affichage du contenu
    echo '<p class="article">' . $ligne[contene] . '</p><p class="rigth"> date : ' . $ligne[date] . '</p>';
    if (check_ip($ligne['id'], get_real_ip()) == 0) {
        ?>
        <a href="javascript:void();" class="like" id="<?php 
        echo $ligne['id'];
        ?>
">Like <span><?php 
        echo likes($ligne['id']);
        ?>
</span></a>
        <?php 
    } else {
        ?>
        <a href="javascript:void();" class="liked">Liked <span><?php 
        echo likes($ligne['id']);
        ?>
</span></a>
예제 #23
0
         $datos = array($_SESSION['usuario']['id'], 1, 1, 0, 1, 1, 1, 1, 1);
         $usr = new mnpBD('campos_visibles');
         $usr->insertar($campos, $datos);
         //-------------establecemos cookie----------------------------------------------------
         mt_srand(time());
         $rand = mt_rand(1000000, 9999999);
         setcookie("id", $_SESSION['usuario']['id'], time() + 60 * 60 * 24 * 365);
         setcookie("marca", $rand, time() + 60 * 60 * 24 * 365);
         $campos = "cookie";
         $valores = array($rand);
         $condicion = " id=" . $_SESSION['usuario']['id'];
         $usr = new mnpBD('usuarios');
         $usr->actualizar($campos, $valores, $condicion);
         //---------------------------------------------------------------------------------------
         $campos = 'usuario_id, ip, dispositivo, fecha_hora';
         $datos = array($_SESSION['usuario']['id'], get_real_ip(), strtolower($_SERVER['HTTP_USER_AGENT']), date("Y-m-d H:i:s"));
         $usr = new mnpBD('logeos');
         $usr->insertar($campos, $datos);
         //------------------------------------------------------------------------------------------
         //------------envio correo de registro---------------
         include 'envioRegistro.php';
         //----------- end cenvio de correo-------------------
         header("location:./");
         exit;
     } else {
         echo "ocurrio un error";
         exit;
     }
 } else {
     header("location:registro.php?duplicate");
 }
예제 #24
0
파일: builtin.php 프로젝트: Nazg-Gul/gate
 function client_info()
 {
     global $HTTP_USER_AGENT;
     $browser = get_browser_cacheable();
     return array('realIP' => get_real_ip(), 'browserEngine' => browser_engine(), 'userAgent' => $_SERVER['HTTP_USER_AGENT']);
 }
예제 #25
0
function getstatinfo($params = array())
{
    $version = MPIC_VERSION;
    $onlineip = get_real_ip();
    $funcurl = 'http://meiupic' . '.mei' . 'u' . '.c' . 'n/stats_in.php';
    $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);
    $url = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api|archiver|wap)?\\/*\$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))));
    $url = substr($url, 0, -8);
    $hash = md5("{$url}{$version}{$onlineip}");
    $q = "url={$url}&version={$version}&ip={$onlineip}&time=" . time() . "&hash={$hash}";
    foreach ($params as $key => $value) {
        $q .= '&' . $key . '=' . $value;
    }
    $q = rawurlencode(base64_encode($q));
    get_remote($funcurl . "?action=newinstall&q={$q}", 5);
}
예제 #26
0
파일: vote.php 프로젝트: reeze/web-bugs
function get_real_ip()
{
    $ip = false;
    // User is behind a proxy and check that we discard RFC1918 IP
    // addresses if they are behind a proxy then only figure out which
    // IP belongs to the user. Might not need any more hacking if
    // there is a squid reverse proxy infront of apache.
    if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ips = explode(", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
        if ($ip) {
            array_unshift($ips, $ip);
            $ip = false;
        }
        for ($i = 0; $i < count($ips); $i++) {
            // Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16
            // -- jim kill me later with my regexp pattern below.
            if (!eregi("^(10|172\\.16|192\\.168)\\.", $ips[$i]) && preg_match("/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/", $ips[$i])) {
                $ip = $ips[$i];
                break;
            }
        }
    }
    return $ip ? $ip : $_SERVER['REMOTE_ADDR'];
}
$ip = ip2long(get_real_ip());
// TODO: check if ip address has been banned. hopefully this will never need to be implemented.
// add the vote
$dbh->prepare("\n\tINSERT INTO bugdb_votes (bug,ip,score,reproduced,tried,sameos,samever)\n\tVALUES (\n\t\t{$id}, {$ip}, {$score}, " . ($reproduced == 1 ? "1," : "0,") . ($reproduced != 2 ? "1," : "0,") . ($reproduced ? "{$sameos}," : "NULL,") . ($reproduced ? "{$samever}" : "NULL") . ')')->execute();
// redirect to the bug page (which will display the success message)
header("Location: bug.php?id={$id}&thanks=6");
exit;
예제 #27
0
파일: res.php 프로젝트: mitv1c/XssRat
{
    if (get_magic_quotes_gpc()) {
        if (is_array($content)) {
            foreach ($content as $key => $value) {
                $content[$key] = stripslashes($value);
            }
        } else {
            $content = stripslashes($content);
        }
    } else {
    }
    return $content;
}
if (!empty($_REQUEST["c"]) && !empty($_REQUEST["t"])) {
    $curtime = date("Y-m-d H:i:s");
    $ip = get_real_ip();
    $useragent = get_user_agent();
    $referer = get_referer();
    $ticket = $_REQUEST["t"];
    $data = $_REQUEST["c"];
    $pmd_id = $_REQUEST["i"];
    $a_id = $_REQUEST["a"];
    $ec = $_REQUEST["ec"];
    if (empty($pmd_id) || $pmd_id == "undefined" || $pmd_id == "null") {
        $pmd_id = 0;
    } else {
        $pmd_id = (int) $pmd_id;
    }
    if (empty($a_id) || $a_id == "undefined" || $a_id == "null") {
        $a_id = 0;
    } else {
function ao_log($item_id, $action, $data = '')
{
    $ip = get_real_ip();
    $ua = getenv("HTTP_USER_AGENT");
    $ua = htmlspecialchars($ua);
    // UserAgent strings compiled from http://user-agent-string.info/rpc/get_data.php?uaslist=csv
    // 76.17.3.14 -- Ben
    // 98.88.13.141 -- Heather office
    // 74.176.242.42 - Heather home
    //$grep_str = "/98\.88\.13\.141|74\.176\.242\.42|76\.17\.3\.14|\bbot|bot\b|crawler|spider|worm|crawl|slurp|downloader|search|verifier|sbider|scout|harvest|sniffer|validator|checker|parser|archiver|tracker|generator|loadcontrol|CSSCheck|Cynthia|checklink|link\w+|Valet|xenu|jeeves|blogpulse|blaiz|browsershots|baypup|robozilla|ccubee|Mediapartners|changedetection|copyrightsheriff|DataFountains|del\.icio\.us\-thumbnails|DepSpid|egothor|dnsdigger|ejupiter|ExactSEEK|FairShare|gonzo|ichiro|iCjobs|InternetSeer|L\.webis|Megatext|Metaspinner|ranking|Netintelligence|Nuhk|Nutch|OpenCalaisSemanticProxy|pingdone|pompos|posterus|scooter|shelob|snappy|Vagabondo|vortex|vermut|watchmouse|wectar|wwwster|heritrix|holmes|livedoor|minirank|metauri|OnetSzukaj|WebImages|wget/i";
    $grep_str = "/\\bbot|bot\\b|crawler|spider|worm|crawl|slurp|downloader|search|verifier|sbider|scout|harvest|sniffer|validator|checker|parser|archiver|tracker|generator|loadcontrol|CSSCheck|Cynthia|checklink|link\\w+|Valet|xenu|jeeves|blogpulse|blaiz|browsershots|baypup|robozilla|ccubee|Mediapartners|changedetection|copyrightsheriff|DataFountains|del\\.icio\\.us\\-thumbnails|DepSpid|egothor|dnsdigger|ejupiter|ExactSEEK|FairShare|gonzo|ichiro|iCjobs|InternetSeer|L\\.webis|Megatext|Metaspinner|ranking|Netintelligence|Nuhk|Nutch|OpenCalaisSemanticProxy|pingdone|pompos|posterus|scooter|shelob|snappy|Vagabondo|vortex|vermut|watchmouse|wectar|wwwster|heritrix|holmes|livedoor|minirank|metauri|OnetSzukaj|WebImages|wget/i";
    // first we match against known spider/crawler/indexer user agent string keywords
    $robot = preg_match($grep_str, $ua);
    if (!$robot) {
        // match against ips in the list
        $robot = preg_match($grep_str, $ip);
    }
    if (!$robot) {
        // now match the hostname against keywords
        // since this in potentially time intensive, we only do this if needed
        //$host = gethostbyaddr_timeout($ip);
        //$robot = preg_match($grep_str, $host);
    }
    if ($robot) {
        $data = "BOT: {$ua}";
    }
    pod_query("INSERT INTO ao_logs VALUES(NULL, NULL, '{$ip}', {$item_id}, '{$action}', '{$data}')");
}
예제 #29
0
파일: counter.php 프로젝트: robocon/iopr
        if (document.all) { //IS IE 4 or 5 (or 6 beta)
            eval( "document.all." + layer_ref + ".style.display = state");
        }
        if (document.layers) { //IS NETSCAPE 4 or below
            document.layers[layer_ref].display = state;
        }
        if (document.getElementById &&!document.all) {
            hza = document.getElementById(layer_ref);
            hza.style.display = state;
        }
    }
    //-->
    </script>

    <?php 
$IPADDRESS = get_real_ip();
//include ("modules/useronline/counter.php");
$ct_ip = $IPADDRESS;
$ct_yyyy = date("Y");
$ct_mm = date("m");
$ct_dd = date("d");
$ct_time = time();
$time_delay = 600;
$timecheck = time() - $time_delay;
$db->connectdb(DB_NAME, DB_USERNAME, DB_PASSWORD);
$sqls = " select COUNT(ct_no) AS ct_count from " . TB_ACTIVEUSER . " where ct_dd = '{$ct_dd}' AND ct_mm = '{$ct_mm}' AND ct_yyyy = '{$ct_yyyy}' AND ct_time >= '{$timecheck}' ";
$results = mysql_query($sqls);
$rows = mysql_fetch_array($results);
$stat_nows = $rows["ct_count"];
?>
    <center><table width="<?php 
    if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ips = explode(", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
        if ($ip) {
            array_unshift($ips, $ip);
            $ip = FALSE;
        }
        for ($i = 0; $i < count($ips); $i++) {
            if (!eregi("^(10|172\\.16|192\\.168)\\.", $ips[$i])) {
                $ip = $ips[$i];
                break;
            }
        }
    }
    return $ip ? $ip : $_SERVER['REMOTE_ADDR'];
}
$getip = mysql_escape_string(get_real_ip());
$userName = $_REQUEST["playername"];
$time = date('Y-m-d H:i:s');
$callback = $_GET['callback'];
if ($userName == "") {
    die('No Player Name');
}
if ($mysql == true) {
    mysql_select_db("castlebashers");
    $sql = "insert into playerid (ip,name,regtime)  values('{$getip}','{$userName}','{$time}')";
    $result = mysql_query($sql, $mysql);
    if (!$result) {
        $arr = array('pid' => "FAILED", 'status' => "106", 'Message' => mysql_error());
        $json = json_encode($arr);
        echo $callback . "({$json})";
    } else {