本文整理汇总了PHP中EnvUtil::getClientIp方法的典型用法代码示例。如果您正苦于以下问题:PHP EnvUtil::getClientIp方法的具体用法?PHP EnvUtil::getClientIp怎么用?PHP EnvUtil::getClientIp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnvUtil
的用法示例。
在下文中一共展示了EnvUtil::getClientIp方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLog
public function addLog($assignmentId, $type, $content)
{
$uid = Ibos::app()->user->uid;
$realname = User::model()->fetchRealnameByUid($uid);
$data = array("assignmentid" => $assignmentId, "uid" => $uid, "time" => TIMESTAMP, "ip" => EnvUtil::getClientIp(), "type" => $type, "content" => $realname . $content);
return $this->add($data);
}
示例2: handleInitEnvironment
public function handleInitEnvironment($event)
{
Ibos::app()->performance->startClock();
Ibos::app()->performance->startMemoryUsageMarker();
define("STATICURL", Ibos::app()->assetManager->getBaseUrl());
define("IN_MOBILE", EnvUtil::checkInMobile());
define("IN_DASHBOARD", EnvUtil::checkInDashboard());
define("TIMESTAMP", time());
define("IN_APP", EnvUtil::checkInApp());
$this->setTimezone();
if (function_exists("ini_get")) {
$memorylimit = @ini_get("memory_limit");
if ($memorylimit && ConvertUtil::ConvertBytes($memorylimit) < 33554432 && function_exists("ini_set")) {
ini_set("memory_limit", "128m");
}
}
$global = array("timestamp" => TIMESTAMP, "version" => VERSION, "clientip" => EnvUtil::getClientIp(), "referer" => "", "charset" => CHARSET, "authkey" => "", "newversion" => 0, "config" => array(), "setting" => array(), "user" => array(), "cookie" => array(), "session" => array(), "lunar" => DateTimeUtil::getlunarCalendar(), "title" => MainUtil::getIncentiveWord(), "staticurl" => STATICURL);
$global["phpself"] = $this->getScriptUrl();
$sitePath = substr($global["phpself"], 0, strrpos($global["phpself"], "/"));
$global["isHTTPS"] = isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off" ? true : false;
$global["siteurl"] = StringUtil::ihtmlSpecialChars("http" . ($global["isHTTPS"] ? "s" : "") . "://" . $_SERVER["HTTP_HOST"] . $sitePath . "/");
$url = parse_url($global["siteurl"]);
$global["siteroot"] = isset($url["path"]) ? $url["path"] : "";
$global["siteport"] = empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443" ? "" : ":" . $_SERVER["SERVER_PORT"];
$config = @(include PATH_ROOT . "/system/config/config.php");
if (empty($config)) {
throw new NotFoundException(Ibos::Lang("Config not found", "error"));
} else {
$global["config"] = $config;
}
Ibos::app()->setting->copyFrom($global);
}
示例3: afterLogin
public function afterLogin($fromCookie)
{
$uid = $this->getId();
MainUtil::setCookie("lastactivity", TIMESTAMP);
UserStatus::model()->updateByPk($uid, array("lastip" => EnvUtil::getClientIp(), "lastvisit" => TIMESTAMP, "lastactivity" => TIMESTAMP, "invisible" => 1));
if (!$fromCookie) {
Ibos::app()->session->isNew = true;
Ibos::app()->session->updateSession();
}
}
示例4: exit
if (empty($openId) || empty($hashskey) || empty($cid)) {
exit("参数错误");
}
$uid = UserBinding::model()->fetchUidByValue(StringUtil::filterCleanHtml($openId), "bqq");
if ($uid) {
$checkCId = strcmp($imCfg["id"], $cid) == 0;
$properties = array("company_id" => $cid, "company_token" => $imCfg["token"], "app_id" => $imCfg["appid"], "client_ip" => EnvUtil::getClientIp());
$api = new BQQApi($properties);
$status = $api->getVerifyStatus(array("open_id" => $openId, "hashskey" => $hashskey));
if ($status["ret"] == 0) {
$config = @(include PATH_ROOT . "/system/config/config.php");
if (empty($config)) {
throw new Exception(Ibos::Lang("Config not found", "error"));
} else {
define("IN_MOBILE", EnvUtil::checkInMobile());
$global = array("clientip" => EnvUtil::getClientIp(), "config" => $config, "timestamp" => time());
Ibos::app()->setting->copyFrom($global);
handleloadsyscache();
$saltkey = MainUtil::getCookie("saltkey");
if (empty($saltkey)) {
$saltkey = StringUtil::random(8);
MainUtil::setCookie("saltkey", $saltkey, 86400 * 30, 1, 1);
}
$curUser = User::model()->fetchByUid($uid);
$identity = new ICUserIdentity($curUser["username"], $curUser["password"]);
$identity->setId($uid);
$identity->setPersistentStates($curUser);
$ip = Ibos::app()->setting->get("clientip");
foreach ($_COOKIE as $k => $v) {
$cookiePath = $config["cookie"]["cookiepath"];
$cookieDomain = $config["cookie"]["cookiedomain"];
示例5: runlog
public static function runlog($runId, $processId, $flowProcess, $uid, $logtype, $content, $toid = "")
{
$userip = EnvUtil::getClientIp();
$run = new ICFlowRun($runId);
$data = array("runid" => $runId, "runname" => $run->name, "flowid" => $run->flowid, "processid" => $processId, "flowprocess" => $flowProcess, "uid" => $uid, "time" => TIMESTAMP, "type" => $logtype, "ip" => $userip, "content" => $content, "toid" => $toid);
if (FlowRunLog::model()->add($data)) {
UserUtil::updateCreditByAction("wfnextpost", $uid);
return true;
}
return false;
}
示例6: log
public function log($flowId, $flowName, $uid, $logType, $content)
{
$data = array("flowid" => $flowId, "flowname" => $flowName, "uid" => $uid, "time" => TIMESTAMP, "type" => $logType, "ip" => EnvUtil::getClientIp(), "content" => $content);
return $this->add($data, true);
}
示例7: autoProcessor
public function autoProcessor($item, $readOnly)
{
$field = $item["data-field"];
$width = isset($item["data-width"]) ? $item["data-width"] : "200";
$autoValue = "";
$value = $this->getValue($item);
$hourTime = date("H:i:s", TIMESTAMP);
$date = date("Y-m-d");
$time = $date . " " . $hourTime;
$isTextAuto = substr($field, 0, 8) !== "sys_list";
$lang = Ibos::getLangSource("workflow.default");
if ($isTextAuto) {
switch ($field) {
case "sys_date":
$autoValue = $date;
break;
case "sys_date_cn":
$autoValue = ConvertUtil::formatDate(TIMESTAMP, "Y" . $lang["Year"] . "m" . $lang["Month"] . "d" . $lang["Chinese day"]);
break;
case "sys_date_cn_short1":
$autoValue = ConvertUtil::formatDate(TIMESTAMP, "Y" . $lang["Year"] . "m" . $lang["month"]);
break;
case "sys_date_cn_short2":
$autoValue = ConvertUtil::formatDate(TIMESTAMP, "m" . $lang["Month"] . "d" . $lang["Chinese day"]);
break;
case "sys_date_cn_short3":
$autoValue = ConvertUtil::formatDate(TIMESTAMP, "Y" . $lang["Year"]);
break;
case "sys_date_cn_short4":
$autoValue = date("Y", TIMESTAMP);
break;
case "sys_time":
$autoValue = $hourTime;
break;
case "sys_datetime":
$autoValue = $time;
break;
case "sys_week":
$autoValue = WfCommonUtil::getWeek();
break;
case "sys_userid":
$autoValue = Ibos::app()->user->uid;
break;
case "sys_realname":
$autoValue = Ibos::app()->user->realname;
break;
case "sys_userpos":
$autoValue = Ibos::app()->user->posname;
break;
case "sys_realname_date":
$autoValue = Ibos::app()->user->realname . " " . $date;
break;
case "sys_realname_datetime":
$autoValue = Ibos::app()->user->realname . " " . $time;
break;
case "sys_deptname":
$autoValue = Department::model()->fetchDeptNameByDeptId(Ibos::app()->user->alldeptid);
break;
case "sys_deptname_short":
$autoValue = Ibos::app()->user->deptname;
break;
case "sys_formname":
$autoValue = $this->form->formname;
break;
case "sys_runname":
$autoValue = $this->inDebug ? "" : $this->run->name;
break;
case "sys_rundate":
$autoValue = $this->inDebug ? "" : ConvertUtil::formatDate($this->run->begintime, "d");
break;
case "sys_rundatetime":
$autoValue = $this->inDebug ? "" : ConvertUtil::formatDate($this->run->begintime);
break;
case "sys_runid":
$autoValue = $this->inDebug ? "" : $this->run->runid;
break;
case "sys_autonum":
$autoValue = $this->inApp ? $this->flow->autonum : "";
break;
case "sys_ip":
$autoValue = EnvUtil::getClientIp();
break;
case "sys_sql":
$sql = $item["data-src"];
$tempopt = array("uid" => Ibos::app()->user->uid, "deptid" => Ibos::app()->user->deptid, "positionid" => Ibos::app()->user->positionid, "runid" => $this->inDebug ? "" : $this->run->runid);
$autoValue = $this->execSysSql($sql, $tempopt, false);
break;
case "sys_manager1":
$main = Ibos::app()->user->deptid;
$deptCache = DepartmentUtil::loadDepartment();
$managerID = $deptCache[$main]["manager"];
if ($managerID != 0) {
$autoValue = User::model()->fetchRealnameByUid($managerID);
}
break;
case "sys_manager2":
$main = Ibos::app()->user->deptid;
$deptCache = DepartmentUtil::loadDepartment();
$upid = $deptCache[$main]["upid"];
if ($upid != 0) {
//.........这里部分代码省略.........
示例8: doEditFeed
public function doEditFeed($feedid, $type, $uid = null)
{
$return = array("isSuccess" => false);
if (empty($feedid)) {
} else {
$feedid = is_array($feedid) ? implode(",", $feedid) : intval($feedid);
$con = sprintf("feedid = %d", $feedid);
$isdel = $type == "delFeed" ? 1 : 0;
if ($type == "deleteFeed") {
$msg = array("user" => Ibos::app()->user->username, "ip" => EnvUtil::getClientIp(), "id" => $feedid, "value" => $this->get($feedid));
Log::write($msg, "db", "module.weibo.deleteFeed");
$res = $this->deleteAll($con);
$res && $this->_deleteFeedAttach($feedid);
} else {
$ids = explode(",", $feedid);
$feedList = $this->getFeeds($ids);
$res = $this->updateAll(array("isdel" => $isdel), $con);
if ($type == "feedRecover") {
foreach ($feedList as $v) {
UserData::model()->updateKey("feed_count", 1, true, $v["user_info"]["uid"]);
UserData::model()->updateKey("weibo_count", 1, true, $v["user_info"]["uid"]);
}
} else {
foreach ($feedList as $v) {
UserData::model()->updateKey("feed_count", -1, false, $v["user_info"]["uid"]);
UserData::model()->updateKey("weibo_count", -1, false, $v["user_info"]["uid"]);
}
}
$this->cleanCache($ids);
$query = $this->fetchAll(array("select" => "feedid", "condition" => sprintf("rowid = %d", $feedid)));
$sids = ConvertUtil::getSubByKey($query, "feedid");
$sids && $this->cleanCache($sids);
}
$commentQuery = $this->getDbConnection()->createCommand()->select("cid")->from("{{comment}}")->where(sprintf("`module` = 'weibo' AND `table` = 'feed' AND `rowid` = %d", $feedid))->queryAll();
$commentIds = ConvertUtil::getSubByKey($commentQuery, "cid");
$commentIds && Comment::model()->deleteComment($commentIds, null, "weibo");
FeedTopic::model()->deleteWeiboJoinTopic($feedid);
Atme::model()->deleteAtme("feed", null, $feedid);
$topics = FeedTopicLink::model()->fetchAll(array("select" => "topicid", "condition" => "feedid=" . $feedid));
$topicId = ConvertUtil::getSubByKey($topics, "topicid");
$topicId && FeedTopic::model()->updateCounters(array("count" => -1), sprintf("FIND_IN_SET(topicid,'%s')", implode(",", $topicId)));
FeedTopicLink::model()->deleteAll("feedid=" . $feedid);
if ($res) {
$return = array("isSuccess" => true);
$uid && UserUtil::updateCreditByAction("deleteweibo", $uid);
}
}
return $return;
}