本文整理汇总了PHP中Utility::GetRemoteIp方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::GetRemoteIp方法的具体用法?PHP Utility::GetRemoteIp怎么用?PHP Utility::GetRemoteIp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::GetRemoteIp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UseCard
public static function UseCard($order, $card_id)
{
if ($order['card_id']) {
return self::ERR_ORDER;
}
$card = Table::Fetch('card', $card_id);
if (!$card) {
return self::ERR_NOCARD;
}
if ($card['consume'] == 'Y') {
return self::ERR_USED;
}
$today = strtotime(date('Y-m-d'));
if ($card['begin_time'] > $today || $card['end_time'] < $today) {
return self::ERR_EXPIRE;
}
$team = Table::Fetch('team', $order['team_id']);
if ($card['partner_id'] > 0 && $card['partner_id'] != $team['partner_id']) {
return self::ERR_TEAM;
}
if ($team['card'] < $card['credit']) {
return self::ERR_CREDIT;
}
$finalcard = $card['credit'] > $order['origin'] ? $order['origin'] : $card['credit'];
Table::UpdateCache('order', $order['id'], array('card_id' => $card_id, 'card' => $finalcard, 'origin' => array("origin - {$finalcard}")));
Table::UpdateCache('card', $card_id, array('consume' => 'Y', 'team_id' => $team['id'], 'order_id' => $order['id'], 'ip' => Utility::GetRemoteIp()));
return true;
}
示例2: submit_reg
public function submit_reg()
{
$email = htmlspecialchars($this->_param("email"));
if (!Utility::ValidEmail($email)) {
Session::Set("error", "邮箱格式有误");
redirect("/register");
}
// $code = M("InviteCodes")->getByCode($this->_post('invite_code'));
// if(!$code) {
// Session::Set("error", "无效邀请码");
// redirect("/register");
// }
$userModel = D("CmsUsers");
if ($userModel->create()) {
$userModel->username = $userModel->email;
$userModel->password = D("CmsUsers")->genPassword($userModel->password);
$userModel->secret = md5(generate_password());
$userModel->ip = Utility::GetRemoteIp();
$userModel->partner_id = intval($this->_param('partner_id'));
$secret = $userModel->secret;
$id = $userModel->add();
} else {
Session::Set("error", "注册失败,请重新尝试或者联系网站管理员");
redirect("/register");
}
// 绑定邮箱到邀请码
// $code_data['id'] = $code['id'];
// $code_data['email'] = $this->_param("email");
// $code_data['bind_time'] = date('Y-m-d H:i:s');
// M("InviteCodes")->save($code_data);
//发验证邮件
$this->send_verify_mail($id, $email, $secret);
redirect('/register/preview_verify_email?token=' . Crypt::en($id . '||' . $email));
}
示例3: Create
public static function Create($user_row, $uc = true)
{
if (function_exists('zuitu_uc_register') && $uc) {
$pp = $user_row['password'];
$em = $user_row['email'];
$un = $user_row['username'];
$ret = zuitu_uc_register($em, $un, $pp);
if (!$ret) {
return false;
}
}
$user_row['password'] = self::GenPassword($user_row['password']);
$user_row['create_time'] = $user_row['login_time'] = time();
$user_row['ip'] = Utility::GetRemoteIp();
$user_row['secret'] = md5(Utility::GenSecret(12));
$user_row['id'] = DB::Insert('user', $user_row);
$_rid = abs(intval(cookieget('_rid')));
if ($_rid) {
$r_user = Table::Fetch('user', $_rid);
if ($r_user) {
ZInvite::Create($r_user, $user_row);
}
}
if ($user_row['id'] == 1) {
Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
}
return $user_row['id'];
}
示例4: Consume
static public function Consume($coupon,$store_id,$doer_id,$verifytype=4) {
if ( !$coupon['consume']=='N' ) return false;
$u = array(
'ip' => Utility::GetRemoteIp(),
'consume_time' => time(),
'consume' => 'Y',
'verifytype'=>$verifytype,
'store_id'=>$store_id,
'doer_id'=>$doer_id,
);
DB::Update('order',$coupon['order_id'],array('had_consume'=>1));
Table::UpdateCache('coupon', $coupon['id'], $u);
//判断是否点评返利成功,点评并返利成功的订单的消费券可以继续返利
$orderdp=DB::LimitQuery('order_dp',array(
'condition'=>array('order_id'=>$coupon['order_id'],'has_return'=>1)
));
if(!empty($orderdp)){
ZFlow::CreateFromCoupon($coupon);
}
ZCredit::CreateFromConsume($coupon);
return true;
}
示例5: Consume
public static function Consume($coupon)
{
if (!$coupon['consume'] == 'N') {
return false;
}
$u = array('ip' => Utility::GetRemoteIp(), 'consume_time' => time(), 'consume' => 'Y');
Table::UpdateCache('coupon', $coupon['id'], $u);
ZFlow::CreateFromCoupon($coupon);
return true;
}
示例6: IncreaseBan
public static function IncreaseBan($ip)
{
$banned = M("BannedIp")->getByIp($ip);
if ($banned) {
$banned['count'] = $banned['count'] + 1;
// $banned['date'] = date("Y-m-d H:i:s");
M("BannedIp")->save($banned);
} else {
$param = array("ip" => Utility::GetRemoteIp(), "date" => date("Y-m-d H:i:s"), "count" => 1, "type" => "login");
M("BannedIp")->add($param);
}
}
示例7: saveVisit
public function saveVisit($module, $module_id, $extra_data)
{
//暂时去掉 2013年6月18日
return;
$insert['user_id'] = $this->getLoginUserId();
$insert['ipaddress'] = Utility::GetRemoteIp();
$insert['module'] = $module;
// 分list,detail
$insert['module_id'] = $module_id;
// 如果是list 标示第几页,如果是detail,是detailid
$insert['timestamp'] = time();
$insert['extra_data'] = $extra_data;
$obj = D('AdminVisits');
$obj->create($insert);
return $obj->add();
}
示例8: Create
public static function Create($user_row)
{
$user_row['password'] = self::GenPassword($user_row['password']);
$user_row['create_time'] = $user_row['login_time'] = time();
$user_row['ip'] = Utility::GetRemoteIp();
$user_row['secret'] = md5(Utility::GenSecret(12));
$user_row['id'] = DB::Insert('user', $user_row);
if ($_COOKIE['_rid']) {
$r_user = Table::Fetch('user', $_COOKIE['_rid']);
if ($r_user) {
ZInvite::Create($r_user, $user_row);
}
}
if ($user_row['id'] == 1) {
Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
}
return $user_row['id'];
}
示例9: Create
public static function Create($user_row, $uc = true)
{
$user_row['password'] = self::GenPassword($user_row['password']);
$user_row['create_time'] = $user_row['login_time'] = time();
$user_row['ip'] = Utility::GetRemoteIp();
$user_row['secret'] = md5(rand(1000000, 9999999) . time() . $user_row['email']);
$user_row['id'] = DB::Insert('user', $user_row);
$_rid = abs(intval(cookieget('_rid')));
if ($_rid) {
$r_user = Table::Fetch('user', $_rid);
if ($r_user) {
ZInvite::Create($r_user, $user_row);
}
}
if ($user_row['id'] == 1) {
Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
}
return $user_row['id'];
}
示例10: CreateRenRen
public static function CreateRenRen($user_row, $renren_uid, $uc = true)
{
if (function_exists('zuitu_uc_register') && $uc) {
$pp = $user_row['password'];
$un = $user_row['username'];
$ret = zuitu_uc_register($em, $un, $pp);
if (!$ret) {
return false;
}
}
$user_row['password'] = self::GenPassword($user_row['password']);
$user_row['create_time'] = $user_row['login_time'] = time();
$user_row['ip'] = Utility::GetRemoteIp();
$user_row['secret'] = $user_row['email'];
$user_row['id'] = DB::Insert('user', $user_row);
if ($user_row['id']) {
$_rid = abs(intval(cookieget('_rid')));
$user_renren_row['uid'] = $user_row['id'];
$user_renren_row['renren_uid'] = $renren_uid;
DB::Insert('user_renren', $user_renren_row);
}
return $user_row['id'];
}
示例11: array
'condition' => array(
'team_id' => $id,
'user_id' => $login_user_id,
'state' => 'unpay',
'rstate' => 'normal',
),
'one' => true,
));
}
/* end order */
/* change attentions */
$current_team = DB::LimitQuery('team', array('condition' => array('id' => $id),'select' => 'attention, ips'));
if(strpos($current_team[0]['ips'], Utility::GetRemoteIp()) === false){
DB::Update('team', array('id' => $id), array(
'ips' => '-'. Utility::GetRemoteIp(),
'attention' => $current_team[0]['attention'] + 1,
));
}
/* end change attentions */
/*kxx team_type */
if ($team['team_type'] == 'seconds') {
die(include template('team_view_seconds'));
}
if ($team['team_type'] == 'goods') {
die(include template('team_view_goods'));
}
/*xxk*/
$ll = $partner['longlat'];
if ($ll) list($lati,$longi) = preg_split('/[,\s]+/',$ll,-1,PREG_SPLIT_NO_EMPTY);
示例12: Check_alifast
public static function Check_alifast($alipay_id, $alipay_name, $alipay_email = null)
{
$aliuser = DB::GetTableRow('user', array('alipay_id' => $alipay_id));
if ($aliuser) {
if (!empty($alipay_email)) {
$email_user = DB::GetTableRow('user', array('email' => $alipay_email));
if (!$email_user) {
Table::UpdateCache('user', $aliuser['id'], array('email' => $alipay_email));
}
}
return $aliuser;
}
$user['username'] = $alipay_id;
$user['realname'] = $alipay_name;
$user['alipay_id'] = $alipay_id;
if ($alipay_email) {
$email_user = DB::GetTableRow('user', array('email' => $alipay_email));
if (!$email_user) {
$user['email'] = $alipay_email;
}
}
$user['create_time'] = $user['login_time'] = time();
$user['ip'] = Utility::GetRemoteIp();
$ali_user['id'] = DB::Insert('user', $user);
$aliuser = DB::GetTableRow('user', array('id' => $ali_user['id']));
return $aliuser;
}
示例13: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
//今日接受调查人次
$daytime = strtotime(date('Y-m-d'));
$ip = Utility::GetRemoteIp();
$action = $_GET['action'] ? $_GET['action'] : '';
if ($action == 'addSuccess') {
Session::Set('notice', '提交数据成功,感谢您的参与。');
redirect(WEB_ROOT . '/vote/index.php');
}
$question_list = DB::LimitQuery('vote_question', array('condition' => array("`is_show` = '1'"), 'order' => 'ORDER BY `order` , id', 'size' => 100, 'offset' => $offset));
foreach ($question_list as $key => $question) {
$options_list = DB::LimitQuery('vote_options', array('condition' => array("`question_id` = '{$question['id']}'", "`is_show` = '1'"), 'order' => 'ORDER BY `order` , id', 'size' => 100, 'offset' => $offset));
$question_list[$key]['options_list'] = $options_list;
}
$pagetitle = '用户调查';
include template('vote_index');
示例14: pay_charge_gopay
function pay_charge_gopay($total_money, $charge_id)
{
global $INI;
if ($total_money <= 0 || !$charge_id) {
return null;
}
$tranCode = '8888';
$merchantID = $INI['gopay']['mid'];
$order_id = 'charge';
$merOrderNum = $charge_id;
//$merOrderNum = preg_replace('/\-/', '_', $merOrderNum);
$tranAmt = $total_money;
$ticketAmt = '';
$feeAmt = '';
$orgtranDateTime = '';
$orgOrderNum = '';
$authID = '';
$orgtranAmt = '';
$currencyType = '156';
$merURL = $INI['system']['wwwprefix'] . '/order/gopay/return.php';
$tranDateTime = date("YmdHis");
$virCardNoIn = $INI['gopay']['acc'];
$VerficationCode = $INI['gopay']['code'];
$tranIP = Utility::GetRemoteIp();
$msgExt = '';
$isLocked = '';
$virCardNo = '';
$orgTxnStat = '';
$orgTxnType = '';
$actionUrl = 'https://www.gopay.com.cn/PGServer/Trans/WebClientAction.do';
$source = "tranCode=[{$tranCode}]merchantID=[{$merchantID}]merOrderNum=[{$merOrderNum}]tranAmt=[{$tranAmt}]ticketAmt=[{$ticketAmt}]tranDateTime=[{$tranDateTime}]currencyType=[{$currencyType}]merURL=[{$merURL}]customerEMail=[]authID=[{$authID}]orgOrderNum=[{$orgOrderNum}]orgtranDateTime=[{$orgtranDateTime}]orgtranAmt=[{$orgtranAmt}]orgTxnType=[{$orgTxnType}]orgTxnStat=[{$orgTxnStat}]msgExt=[]virCardNo=[]virCardNoIn=[{$virCardNoIn}]tranIP=[{$tranIP}]isLocked=[]feeAmt=[{$feeAmt}]respCode=[]VerficationCode=[{$VerficationCode}]";
$signValue = MD5($source);
if (is_post() && $_POST['paytype'] != 'gopay') {
$bankCode = $_POST['paytype'];
$userType = '1';
}
return render('block_pay_gopay', array('order_id' => $order_id, 'tranCode' => $tranCode, 'merchantID' => $merchantID, 'merOrderNum' => $merOrderNum, 'tranAmt' => $tranAmt, 'ticketAmt' => $ticketAmt, 'feeAmt' => $feeAmt, 'orgtranDateTime' => $orgtranDateTime, 'orgOrderNum' => $orgOrderNum, 'authID' => $authID, 'orgtranAmt' => $orgtranAmt, 'currencyType' => $currencyType, 'merURL' => $merURL, 'tranDateTime' => $tranDateTime, 'virCardNoIn' => $virCardNoIn, 'tranIP' => $tranIP, 'msgExt' => $msgExt, 'isLocked' => $isLocked, 'virCardNo' => $virCardNo, 'orgTxnStat' => $orgTxnStat, 'orgTxnType' => $orgTxnType, 'signValue' => $signValue, 'bankCode' => $bankCode, 'userType' => $userType, 'actionUrl' => $actionUrl));
}
示例15: date
/* must */
$sp_billno = $v_oid;
$transaction_id = $v_mid . date('Ymd') . date('His') . rand(1000, 9999);
$desc = $title;
/* end */
$reqHandler = new PayRequestHandler();
$reqHandler->init();
$reqHandler->setKey($key);
$reqHandler->setParameter("bargainor_id", $v_mid);
$reqHandler->setParameter("cs", "UTF-8");
$reqHandler->setParameter("sp_billno", $sp_billno);
$reqHandler->setParameter("transaction_id", $transaction_id);
$reqHandler->setParameter("total_fee", $v_amount);
$reqHandler->setParameter("return_url", $v_url);
$reqHandler->setParameter("desc", $desc);
$reqHandler->setParameter("spbill_create_ip", Utility::GetRemoteIp());
$reqUrl = $reqHandler->getRequestURL();
include template('order_charge');
} else {
if ($_POST['paytype'] == 'alipay') {
$_input_charset = 'utf-8';
$service = 'create_direct_pay_by_user';
$partner = $INI['alipay']['mid'];
$security_code = $INI['alipay']['sec'];
$seller_email = $INI['alipay']['acc'];
$sign_type = 'MD5';
$out_trade_no = "charge-{$login_user_id}-{$now}-{$randno}";
$return_url = $INI['system']['wwwprefix'] . '/order/alipay/return.php';
$notify_url = $INI['system']['wwwprefix'] . '/order/alipay/notify.php';
$show_url = $INI['system']['wwwprefix'] . "/credit/index.php";
$subject = $title;