本文整理汇总了PHP中EnvUtil::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP EnvUtil::getRequest方法的具体用法?PHP EnvUtil::getRequest怎么用?PHP EnvUtil::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnvUtil
的用法示例。
在下文中一共展示了EnvUtil::getRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCommonTimeScope
public static function getCommonTimeScope()
{
static $timeScope = array();
if (empty($timeScope)) {
$time = EnvUtil::getRequest("time");
$start = EnvUtil::getRequest("start");
$end = EnvUtil::getRequest("end");
if (!empty($time)) {
if (!in_array($time, array("thisweek", "lastweek", "thismonth", "lastmonth"))) {
$time = "thisweek";
}
} else {
if (!empty($start) && !empty($end)) {
$start = strtotime($start);
$end = strtotime($end);
if ($start && $end) {
$timeScope = array("timestr" => "custom", "start" => $start, "end" => $end);
}
} else {
$time = "thisweek";
}
}
if (empty($timeScope)) {
$timeScope = DateTimeUtil::getStrTimeScope($time);
$timeScope["timestr"] = $time;
}
}
return $timeScope;
}
示例2: actionIndex
public function actionIndex()
{
if (isset($_GET["pagesize"])) {
$this->setListPageSize($_GET["pagesize"]);
}
$key = StringUtil::filterCleanHtml(EnvUtil::getRequest("keyword"));
$fields = array("frp.runid", "frp.processid", "frp.flowprocess", "frp.flag", "frp.opflag", "frp.processtime", "ft.freeother", "ft.flowid", "ft.name as typeName", "ft.type", "ft.listfieldstr", "fr.name as runName", "fr.beginuser", "fr.begintime", "fr.endtime", "fr.focususer");
$sort = "frp.processtime";
$group = "frp.runid";
$condition = array("and", "fr.delflag = 0", "frp.childrun = 0", sprintf("frp.uid = %d", $this->uid), sprintf("FIND_IN_SET(fr.focususer,'%s')", $this->uid));
if ($key) {
$condition[] = array("like", "fr.runid", "%{$key}%");
$condition[] = array("or like", "fr.name", "%{$key}%");
}
$count = Ibos::app()->db->createCommand()->select("count(*) as count")->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->group($group)->queryScalar();
$pages = PageUtil::create($count, $this->getListPageSize());
if ($key && $count) {
$pages->params = array("keyword" => $key);
}
$offset = $pages->getOffset();
$limit = $pages->getLimit();
$list = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->group($group)->offset($offset)->limit($limit)->queryAll();
$data = array_merge(array("pages" => $pages), $this->handleList($list));
$this->setPageTitle(Ibos::lang("My focus"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang(Ibos::lang("My focus")), "url" => $this->createUrl("focus/index")), array("name" => Ibos::lang("List"))));
$this->render("index", $data);
}
示例3: actionDel
public function actionDel()
{
if (Ibos::app()->request->isAjaxRequest) {
$typeid = intval(EnvUtil::getRequest("typeid"));
if (empty($typeid)) {
$this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Parameters error", "error")));
}
$removeSuccess = ReportType::model()->remove($typeid);
if ($removeSuccess) {
$reports = Report::model()->fetchRepidAndAidByTypeids($typeid);
if (!empty($reports)) {
if ($reports["aids"]) {
AttachUtil::delAttach($reports["aids"]);
}
ReportRecord::model()->deleteAll("repid IN('{$reports["repids"]}')");
Report::model()->deleteAll("repid IN('{$reports["repids"]}')");
}
$return["isSuccess"] = true;
$return["msg"] = Ibos::lang("Del succeed", "message");
} else {
$return["isSuccess"] = false;
$return["msg"] = Ibos::lang("Del failed", "message");
}
$this->ajaxReturn($return);
}
}
示例4: actionIndex
public function actionIndex()
{
$op = EnvUtil::getRequest("op");
$op = in_array($op, array("dept", "letter")) ? $op : "dept";
$params = array();
if ($op == "letter") {
$params["datas"] = $this->getDataByLetter();
} else {
$params["datas"] = $this->getDataByDept();
}
$userDatas = array();
if (!empty($params["datas"])) {
foreach ($params["datas"] as $datas) {
$userDatas = $op == "dept" ? array_merge($userDatas, $datas["users"]) : array_merge($userDatas, $datas);
}
}
$params["uids"] = implode(",", ConvertUtil::getSubByKey($userDatas, "uid"));
$uid = Ibos::app()->user->uid;
$params["cuids"] = Contact::model()->fetchAllConstantByUid($uid);
$this->setPageTitle(Ibos::lang("Contact"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Contact"), "url" => $this->createUrl("defalut/index")), array("name" => Ibos::lang("Company contact"))));
$view = $op == "letter" ? "letter" : "dept";
$params["allLetters"] = $this->allLetters;
$this->render($view, $params);
}
示例5: handleBeginRequest
public function handleBeginRequest($event)
{
$allowedGuestUserUrls = array();
foreach ($this->allowedGuestUserRoutes as $allowedGuestUserRoute) {
$allowedGuestUserUrls[] = Ibos::app()->createUrl($allowedGuestUserRoute);
}
$reqestedUrl = Ibos::app()->getRequest()->getUrl();
$isUrlAllowedToGuests = false;
foreach ($allowedGuestUserUrls as $url) {
if (strpos($reqestedUrl, $url) === 0) {
$isUrlAllowedToGuests = true;
break;
}
}
$uid = EnvUtil::getRequest("uid");
$swfHash = EnvUtil::getRequest("hash");
if ($uid && $swfHash) {
define("IN_SWFHASH", true);
$authKey = Ibos::app()->setting->get("config/security/authkey");
if (empty($uid) || $swfHash != md5(substr(md5($authKey), 8) . $uid)) {
exit;
}
} elseif (Ibos::app()->user->isGuest) {
define("IN_SWFHASH", false);
if (!$isUrlAllowedToGuests) {
if (IN_DASHBOARD) {
Ibos::app()->request->redirect(Ibos::app()->createUrl("dashboard/default/login"));
} else {
Ibos::app()->user->loginRequired();
}
}
}
}
示例6: actionIndex
public function actionIndex()
{
$shareInfo["sid"] = intval(EnvUtil::getRequest("sid"));
$shareInfo["stable"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("stable"));
$shareInfo["initHTML"] = StringUtil::filterDangerTag(EnvUtil::getRequest("initHTML"));
$shareInfo["curid"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("curid"));
$shareInfo["curtable"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("curtable"));
$shareInfo["module"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("module"));
$shareInfo["isrepost"] = intval(EnvUtil::getRequest("isrepost"));
if (empty($shareInfo["stable"]) || empty($shareInfo["sid"])) {
echo "类型和资源ID不能为空";
exit;
}
if (!($oldInfo = Source::getSourceInfo($shareInfo["stable"], $shareInfo["sid"], false, $shareInfo["module"]))) {
echo "此信息不可以被转发";
exit;
}
empty($shareInfo["module"]) && ($shareInfo["module"] = $oldInfo["module"]);
if (empty($shareInfo["initHTML"]) && !empty($shareInfo["curid"])) {
if ($shareInfo["curid"] != $shareInfo["sid"] && $shareInfo["isrepost"] == 1) {
$curInfo = Source::getSourceInfo($shareInfo["curtable"], $shareInfo["curid"], false, "weibo");
$userInfo = $curInfo["source_user_info"];
$shareInfo["initHTML"] = " //@" . $userInfo["realname"] . ":" . $curInfo["source_content"];
$shareInfo["initHTML"] = str_replace(array("\n", "\r"), array("", ""), $shareInfo["initHTML"]);
}
}
$shareInfo["shareHtml"] = !empty($oldInfo["shareHtml"]) ? $oldInfo["shareHtml"] : "";
$data = array("shareInfo" => $shareInfo, "oldInfo" => $oldInfo);
$this->renderPartial("index", $data);
}
示例7: actionLogin
public function actionLogin()
{
$access = $this->getAccess();
$defaultUrl = $this->createUrl("default/index");
if (0 < $access) {
$this->success(Ibos::lang("Login succeed"), $defaultUrl);
}
if (!EnvUtil::submitCheck("formhash")) {
$data = array("userName" => !empty($this->user) ? $this->user["username"] : "");
$this->render("login", $data);
} else {
$userName = EnvUtil::getRequest("username");
$passWord = EnvUtil::getRequest("password");
if (!$passWord || $passWord != addslashes($passWord)) {
$this->error(Ibos::lang("Passwd illegal"));
}
$identity = new ICUserIdentity($userName, $passWord);
$result = $identity->authenticate(true);
if (0 < $result) {
Ibos::app()->user->login($identity);
if (Ibos::app()->user->uid != 1) {
MainUtil::checkLicenseLimit(true);
}
$this->success(Ibos::lang("Login succeed"), $defaultUrl);
} else {
$passWord = preg_replace("/^(.{" . round(strlen($passWord) / 4) . "})(.+?)(.{" . round(strlen($passWord) / 6) . "})\$/s", "***", $passWord);
$log = array("user" => $userName, "password" => $passWord, "ip" => Ibos::app()->setting->get("clientip"));
Log::write($log, "illegal", "module.dashboard.login");
$this->error(Ibos::lang("Login failed"));
}
}
}
示例8: actionUpdate
public function actionUpdate()
{
if (EnvUtil::submitCheck("formhash")) {
$fieldArr = array("reporttypemanage" => "", "stampenable" => 0, "stampdetails" => "", "pointsystem" => 5, "autoreview" => 0, "autoreviewstamp" => 1);
foreach ($_POST as $key => $value) {
if (in_array($key, array_keys($fieldArr))) {
$fieldArr[$key] = $value;
}
}
$stampStr = "";
if (!empty($fieldArr["stampdetails"])) {
foreach ($fieldArr["stampdetails"] as $score => $stampId) {
$stampId = empty($stampId) ? 0 : $stampId;
$stampStr .= $stampId . ":" . $score . ",";
}
}
$fieldArr["stampdetails"] = rtrim($stampStr, ",");
$apprise = EnvUtil::getRequest("apprise");
if (empty($_POST["stampdetails"][$apprise])) {
$fieldArr["autoreview"] = 0;
} else {
$fieldArr["autoreviewstamp"] = $_POST["stampdetails"][$apprise];
}
Setting::model()->modify("reportconfig", array("svalue" => serialize($fieldArr)));
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例9: init
public function init()
{
$uid = intval(EnvUtil::getRequest("uid"));
$this->uid = $uid ? $uid : Ibos::app()->user->uid;
$this->upuid = Ibos::app()->user->uid;
parent::init();
}
示例10: getData
private function getData()
{
$id = EnvUtil::getRequest("id");
$aidString = base64_decode(rawurldecode($id));
if (empty($aidString)) {
$this->error(Ibos::lang("Parameters error", "error"), "", array("autoJump" => 0));
}
$salt = Ibos::app()->user->salt;
$decodeString = StringUtil::authCode($aidString, "DECODE", $salt);
$decodeArr = explode("|", $decodeString);
$count = count($decodeArr);
if ($count < 3) {
$this->error(Ibos::lang("Data type invalid", "error"), "", array("autoJump" => 0));
} else {
$aid = $decodeArr[0];
$tableId = $decodeArr[1];
if (0 <= $tableId && $tableId < 10) {
$attach = AttachmentN::model()->fetch($tableId, $aid);
}
$return = array("decodeArr" => $decodeArr, "attach" => array());
if (!empty($attach)) {
$return["attach"] = $attach;
}
return $return;
}
}
示例11: actionAdd
public function actionAdd()
{
$flowId = intval(EnvUtil::getRequest("flowid"));
$flow = new ICFlowType($flowId);
if (EnvUtil::submitCheck("formhash")) {
$this->checkFlowAccess($flowId, 1, $this->createUrl("new/add"));
$this->beforeAdd($_POST, $flow);
$run = array("name" => $_POST["name"], "flowid" => $flowId, "beginuser" => $this->uid, "begintime" => TIMESTAMP);
$runId = FlowRun::model()->add($run, true);
$runProcess = array("runid" => $runId, "processid" => 1, "uid" => $this->uid, "flag" => FlowConst::PRCS_UN_RECEIVE, "flowprocess" => 1, "createtime" => TIMESTAMP);
FlowRunProcess::model()->add($runProcess);
if (strstr($flow->autoname, "{N}")) {
FlowType::model()->updateCounters(array("autonum" => 1), sprintf("flowid = %d", $flowId));
CacheUtil::rm("flowtype_" . $flowId);
}
$runData = array("runid" => $runId, "name" => $_POST["name"], "beginuser" => $this->uid, "begin" => TIMESTAMP);
$this->handleRunData($flow, $runData);
$param = array("flowid" => $flowId, "runid" => $runId, "processid" => 1, "flowprocess" => 1, "fromnew" => 1);
$jumpUrl = $this->createUrl("form/index", array("key" => WfCommonUtil::param($param)));
$this->ajaxReturn(array("isSuccess" => true, "jumpUrl" => $jumpUrl));
} else {
$this->checkFlowAccess($flowId, 1);
if (!empty($flow->autoname)) {
$runName = WfNewUtil::replaceAutoName($flow, $this->uid);
} else {
$runName = sprintf("%s (%s)", $flow->name, date("Y-m-d H:i:s"));
}
$data = array("flow" => $flow->toArray(), "runName" => $runName, "lang" => Ibos::getLangSources());
$this->renderPartial("add", $data);
}
}
示例12: actionSearch
public function actionSearch()
{
$condition = array();
if (Yii::app()->request->getIsPostRequest()) {
$search = $_POST["search"];
$condition = EmailUtil::mergeSearchCondition($search, $this->uid);
$conditionStr = base64_encode(serialize($condition));
} else {
$conditionStr = EnvUtil::getRequest("condition");
$condition = unserialize(base64_decode($conditionStr));
}
if (empty($condition)) {
$this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("list/index"));
}
$emailData = Email::model()->fetchAllByArchiveIds("*", $condition["condition"], $condition["archiveId"], array("e", "eb"), null, null, SORT_DESC, "emailid");
$count = count($emailData);
$pages = PageUtil::create($count, $this->getListPageSize(), false);
$pages->params = array("condition" => $conditionStr);
$list = array_slice($emailData, $pages->getOffset(), $pages->getLimit(), false);
foreach ($list as $index => &$mail) {
$mail["fromuser"] = $mail["fromid"] ? User::model()->fetchRealnameByUid($mail["fromid"]) : "";
}
$data = array("list" => $list, "pages" => $pages, "condition" => $conditionStr, "folders" => $this->folders);
$this->setPageTitle(Ibos::lang("Search result"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Email center"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Search result"))));
$this->render("search", $data);
}
示例13: actionSearch
public function actionSearch()
{
if (LOCAL) {
$sphinxFields = "sphinxon,sphinxmsgindex,sphinxsubindex,sphinxmaxquerytime,sphinxlimit,sphinxrank";
$sphinx = Setting::model()->fetchSettingValueByKeys($sphinxFields);
$formSubmit = EnvUtil::submitCheck("searchSubmit");
if ($formSubmit) {
$operation = $_POST["operation"];
$data = array("sphinxon" => isset($_POST["sphinxon"][$operation]) ? 1 : 0, "sphinxsubindex" => $_POST["sphinxsubindex"][$operation], "sphinxmsgindex" => $_POST["sphinxmsgindex"][$operation], "sphinxmaxquerytime" => $_POST["sphinxmaxquerytime"][$operation], "sphinxlimit" => $_POST["sphinxlimit"][$operation], "sphinxrank" => $_POST["sphinxrank"][$operation]);
foreach ($sphinx as $sKey => $sValue) {
$value = unserialize($sValue);
$value[$operation] = $data[$sKey];
Setting::model()->updateSettingValueByKey($sKey, $value);
}
CacheUtil::update(array("setting"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$operation = EnvUtil::getRequest("op");
$moduleList = explode(",", self::DEFAULT_SEARCH_MODULE);
if (!in_array($operation, $moduleList)) {
$operation = $moduleList[0];
}
$data["operation"] = $operation;
$data["moduleList"] = $moduleList;
foreach ($sphinx as $sKey => $sValue) {
$data[$sKey] = unserialize($sValue);
}
$this->render("search", $data);
}
} else {
echo Ibos::lang("Not compatible service", "message");
}
}
示例14: actionDestroy
public function actionDestroy()
{
$id = EnvUtil::getRequest("id");
$runId = StringUtil::filterStr(StringUtil::filterCleanHtml($id));
WfHandleUtil::destroy($runId);
$this->ajaxReturn(array("isSuccess" => true));
}
示例15: actionImageManager
public function actionImageManager()
{
$path = "data/editor/image/" . Ibos::app()->user->uid;
$action = EnvUtil::getRequest("action");
if ($action == "get") {
if (!defined("SAE_TMP_PATH")) {
$files = $this->getfiles($path);
if (!$files) {
return null;
}
rsort($files, SORT_STRING);
$str = "";
foreach ($files as $file) {
$str .= "../../../../../../" . $file . "ue_separate_ue";
}
echo $str;
} else {
$st = new SaeStorage();
$num = 0;
while ($ret = $st->getList("data", $path, 100, $num)) {
foreach ($ret as $file) {
if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
echo $st->getUrl("data", $file) . "ue_separate_ue";
}
$num++;
}
}
}
}
}