本文整理汇总了PHP中EnvUtil::submitCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP EnvUtil::submitCheck方法的具体用法?PHP EnvUtil::submitCheck怎么用?PHP EnvUtil::submitCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnvUtil
的用法示例。
在下文中一共展示了EnvUtil::submitCheck方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCropBg
public function actionCropBg()
{
if (EnvUtil::submitCheck("bgSubmit") && !empty($_POST["src"])) {
$params = $_POST;
if (!isset($params) && empty($params)) {
return null;
}
$tempBg = $params["src"];
$bgPath = "data/home/";
$bgBig = UserUtil::getBg($params["uid"], "big");
$bgMiddle = UserUtil::getBg($params["uid"], "middle");
$bgSmall = UserUtil::getBg($params["uid"], "small");
if (LOCAL) {
FileUtil::makeDirs($bgPath . dirname($bgBig));
}
FileUtil::createFile("data/home/" . $bgBig, "");
FileUtil::createFile("data/home/" . $bgMiddle, "");
FileUtil::createFile("data/home/" . $bgSmall, "");
Ibos::import("ext.ThinkImage.ThinkImage", true);
$imgObj = new ThinkImage(THINKIMAGE_GD);
if (!isset($params["noCrop"])) {
$imgObj->open($tempBg)->crop($params["w"], $params["h"], $params["x"], $params["y"], 1000, 300)->save($tempBg);
}
$imgObj->open($tempBg)->thumb(1000, 300, 1)->save($bgPath . $bgBig);
$imgObj->open($tempBg)->thumb(520, 156, 1)->save($bgPath . $bgMiddle);
$imgObj->open($tempBg)->thumb(400, 120, 1)->save($bgPath . $bgSmall);
if (isset($params["commonSet"]) && $params["commonSet"]) {
$this->setCommonBg($bgPath . $bgBig);
}
$this->ajaxReturn(array("isSuccess" => true));
exit;
}
}
示例2: actionEdit
public function actionEdit()
{
if (EnvUtil::submitCheck("emailSubmit")) {
$setting = array();
foreach ($this->_fields as $field) {
if (array_key_exists($field, $_POST)) {
$setting[$field] = intval($_POST[$field]);
} else {
$setting[$field] = 0;
}
}
$roles = array();
if (isset($_POST["role"])) {
foreach ($_POST["role"] as $role) {
if (!empty($role["positionid"]) && !empty($role["size"])) {
$positionId = StringUtil::getId($role["positionid"]);
$roles[implode(",", $positionId)] = intval($role["size"]);
}
}
}
$setting["emailroleallocation"] = serialize($roles);
foreach ($setting as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例3: 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);
}
}
示例4: actionPost
public function actionPost()
{
if (EnvUtil::submitCheck("formhash")) {
$return = array("data" => Ibos::lang("Operation succeed", "message"), "IsSuccess" => true);
if (empty($_POST["touid"])) {
$return["data"] = Ibos::lang("Message receiver cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
if (trim(StringUtil::filterCleanHtml($_POST["content"])) == "") {
$return["data"] = Ibos::lang("Message content cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
$_POST["touid"] = implode(",", StringUtil::getUid($_POST["touid"]));
if (isset($_POST["type"])) {
!in_array($_POST["type"], array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT)) && ($_POST["type"] = null);
} else {
$_POST["type"] = null;
}
$_POST["content"] = StringUtil::filterDangerTag($_POST["content"]);
$res = MessageContent::model()->postMessage($_POST, Yii::app()->user->uid);
if ($res) {
$this->ajaxReturn($return);
} else {
$return["IsSuccess"] = false;
$return["data"] = MessageContent::model()->getError("message");
$this->ajaxReturn($return);
}
}
}
示例5: actionEdit
public function actionEdit()
{
if (EnvUtil::getRequest("op") == "setDefault") {
$webId = EnvUtil::getRequest("webid");
return $this->setDefault($webId);
}
$id = EnvUtil::getRequest("id");
if (EnvUtil::submitCheck("emailSubmit")) {
$data = $_POST["web"];
$this->submitCheck($data, false);
$web = $this->beforeSave($data);
$web["ssl"] = isset($web["ssl"]) ? 1 : 0;
$web["smtpssl"] = isset($web["smtpssl"]) ? 1 : 0;
EmailWeb::model()->modify($id, $web);
if (!empty($web["foldername"])) {
EmailFolder::model()->updateAll(array("name" => StringUtil::filterCleanHtml($web["foldername"])), "webid = " . $id . " AND uid = " . $this->uid);
}
$this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("web/index"));
} else {
$web = EmailWeb::model()->fetch("webid = {$id} AND uid = " . $this->uid);
if ($web) {
$web["foldername"] = EmailFolder::model()->fetchFolderNameByWebId($id);
$web["password"] = StringUtil::authCode($web["password"], "DECODE", Yii::app()->user->salt);
$this->setPageTitle(Ibos::lang("Edit web email"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang(Ibos::lang("Personal Office"))), array("name" => Ibos::lang(Ibos::lang("Email center")), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang(Ibos::lang("Edit web email")))));
$this->render("edit", array("web" => $web));
} else {
$this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("web/index"));
}
}
}
示例6: actionSave
public function actionSave()
{
if (EnvUtil::submitCheck("formhash")) {
$data =& $_POST;
if (isset($data["type"])) {
foreach ($data["type"] as $id => $type) {
if (empty($data["uid"][$id]) || empty($data["remindtime"][$id])) {
continue;
}
$type = intval($type);
$attr = array("type" => intval($type));
if (!in_array($type, array(1, 5))) {
$attr["reminddate"] = $data["reminddate"][$id];
}
$attr["remindtime"] = $data["remindtime"][$id];
if (substr($id, 0, 1) == "n") {
$uid = StringUtil::getId($data["uid"][$id]);
$attr["uid"] = implode(",", $uid);
$attr["flowid"] = $this->flowid;
FlowTimer::model()->add($attr);
} else {
FlowTimer::model()->modify($id, $attr);
}
}
}
if (!empty($data["delid"])) {
$id = StringUtil::filterStr($data["delid"]);
FlowTimer::model()->deleteAll("FIND_IN_SET(tid,'{$id}')");
}
$this->ajaxReturn(array("isSuccess" => true));
}
exit;
}
示例7: 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"));
}
}
示例8: actionIndex
public function actionIndex()
{
$unit = Setting::model()->fetchSettingValueByKey("unit");
$formSubmit = EnvUtil::submitCheck("unitSubmit");
if ($formSubmit) {
$postData = array();
if (!empty($_FILES["logo"]["name"])) {
!empty($unit["logourl"]) && FileUtil::deleteFile($unit["logourl"]);
$postData["logourl"] = $this->imgUpload("logo");
} elseif (!empty($_POST["logourl"])) {
$postData["logourl"] = $_POST["logourl"];
} else {
$postData["logourl"] = "";
}
$keys = array("phone", "fullname", "shortname", "fax", "zipcode", "address", "adminemail", "systemurl");
foreach ($keys as $key) {
if (isset($_POST[$key])) {
$postData[$key] = StringUtil::filterCleanHtml($_POST[$key]);
} else {
$postData[$key] = "";
}
}
Setting::model()->updateSettingValueByKey("unit", $postData);
CacheUtil::update(array("setting"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$license = Setting::model()->fetchSettingValueByKey("license");
$data = array("unit" => unserialize($unit), "license" => $license);
$this->render("index", $data);
}
}
示例9: actionComment
public function actionComment()
{
$op = EnvUtil::getRequest("op");
if (EnvUtil::submitCheck("formhash")) {
if (!in_array($op, array("delComment", "deleteComment", "commentRecover"))) {
exit;
}
$ids = EnvUtil::getRequest("ids");
foreach (explode(",", $ids) as $id) {
Comment::model()->doEditComment($id, $op);
}
$this->ajaxReturn(array("isSuccess" => true));
} else {
if (!in_array($op, array("list", "recycle"))) {
$op = "list";
}
$map = "";
if ($op == "list") {
$map = "isdel = 0";
} else {
$map = "isdel = 1";
}
if (EnvUtil::getRequest("search")) {
$key = StringUtil::filterCleanHtml(EnvUtil::getRequest("search"));
$map .= " AND content LIKE '%{$key}%'";
}
$count = Comment::model()->count($map);
$pages = PageUtil::create($count);
$list = Comment::model()->getCommentList($map, "cid DESC", $pages->getLimit(), $pages->getOffset());
$data = array("op" => $op, "list" => $list, "pages" => $pages, "moduleAssetUrl" => Ibos::app()->assetManager->getAssetsUrl("weibo"));
$this->render("comment", $data);
}
}
示例10: actionSetup
public function actionSetup()
{
$formSubmit = EnvUtil::submitCheck("formhash");
if ($formSubmit) {
$data =& $_POST;
foreach (array("sendemail", "sendsms", "sendmessage") as $field) {
if (!empty($data[$field])) {
$ids = array_keys($data[$field]);
$idstr = implode(",", $ids);
Notify::model()->updateAll(array($field => 1), sprintf("FIND_IN_SET(id,'%s')", $idstr));
Notify::model()->updateAll(array($field => 0), sprintf("NOT FIND_IN_SET(id,'%s')", $idstr));
} else {
Notify::model()->updateAll(array($field => 0));
}
}
CacheUtil::update("NotifyNode");
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$nodeList = Notify::model()->getNodeList();
foreach ($nodeList as &$node) {
$node["moduleName"] = Module::model()->fetchNameByModule($node["module"]);
}
$this->render("setup", array("nodeList" => $nodeList));
}
}
示例11: actionRule
public function actionRule()
{
$formSubmit = EnvUtil::submitCheck("creditRuleSubmit");
if ($formSubmit) {
$cycles = $_POST["cycles"];
$credits = $_POST["credits"];
$rewardNums = $_POST["rewardnums"];
$rulesParam = array();
foreach ($cycles as $ruleId => $cycle) {
$rulesParam[$ruleId]["cycletype"] = $cycle;
}
foreach ($credits as $ruleId => $credit) {
foreach ($credit as $extcreditOffset => $creditValue) {
$rulesParam[$ruleId]["extcredits" . $extcreditOffset] = $creditValue;
}
}
foreach ($rewardNums as $ruleId => $rewardNum) {
$rulesParam[$ruleId]["rewardnum"] = $rewardNum;
}
foreach ($rulesParam as $ruleId => $updateValue) {
CreditRule::model()->modify($ruleId, $updateValue);
}
CacheUtil::update(array("creditRule"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$rules = CreditRule::model()->fetchAll();
$credits = Credit::model()->fetchAll();
$data = array("rules" => $rules, "credits" => $credits);
$this->render("rule", $data);
}
}
示例12: actionCropImg
public function actionCropImg()
{
if (EnvUtil::submitCheck("userSubmit")) {
$params = $_POST;
if (!isset($params) && empty($params)) {
return null;
}
$tempAvatar = $params["src"];
$avatarPath = "data/avatar/";
$avatarBig = UserUtil::getAvatar($params["uid"], "big");
$avatarMiddle = UserUtil::getAvatar($params["uid"], "middle");
$avatarSmall = UserUtil::getAvatar($params["uid"], "small");
if (LOCAL) {
FileUtil::makeDirs($avatarPath . dirname($avatarBig));
}
FileUtil::createFile("data/avatar/" . $avatarBig, "");
FileUtil::createFile("data/avatar/" . $avatarMiddle, "");
FileUtil::createFile("data/avatar/" . $avatarSmall, "");
Ibos::import("ext.ThinkImage.ThinkImage", true);
$imgObj = new ThinkImage(THINKIMAGE_GD);
$imgObj->open($tempAvatar)->crop($params["w"], $params["h"], $params["x"], $params["y"])->save($tempAvatar);
$imgObj->open($tempAvatar)->thumb(180, 180, 1)->save($avatarPath . $avatarBig);
$imgObj->open($tempAvatar)->thumb(60, 60, 1)->save($avatarPath . $avatarMiddle);
$imgObj->open($tempAvatar)->thumb(30, 30, 1)->save($avatarPath . $avatarSmall);
$this->success(Ibos::lang("Upload avatar succeed"), $this->createUrl("home/personal", array("op" => "avatar")));
exit;
}
}
示例13: actionAddComment
public function actionAddComment()
{
if (EnvUtil::submitCheck("formhash")) {
$widget = Ibos::app()->getWidgetFactory()->createWidget($this, "IWOfficialdocComment");
return $widget->addComment();
}
}
示例14: actionIndex
public function actionIndex()
{
$types = EnvUtil::getRequest("updatetype");
$data = array();
if (EnvUtil::submitCheck("formhash")) {
$type = implode(",", $types);
if (!empty($type)) {
$this->redirect($this->createUrl("update/index", array("doupdate" => 1, "updatetype" => $type)));
}
}
if (Ibos::app()->request->getIsAjaxRequest()) {
$op = EnvUtil::getRequest("op");
if (LOCAL) {
@set_time_limit(0);
}
if ($op == "data") {
CacheUtil::update();
}
if ($op == "static") {
LOCAL && Ibos::app()->assetManager->republicAll();
OrgUtil::update();
}
if ($op == "module") {
ModuleUtil::updateConfig();
}
Ibos::app()->cache->clear();
$this->ajaxReturn(array("isSuccess" => true));
}
if (EnvUtil::getRequest("doupdate") == 1) {
$type = explode(",", trim($types, ","));
$data["doUpdate"] = true;
foreach ($type as $index => $act) {
if (!empty($act)) {
if (in_array("data", $type)) {
unset($type[$index]);
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Data cache");
$data["op"] = "data";
break;
}
if (in_array("static", $type)) {
unset($type[$index]);
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Static cache");
$data["op"] = "static";
break;
}
if (in_array("module", $type)) {
$data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Module setting");
$data["op"] = "module";
unset($type[$index]);
break;
}
}
}
$data["next"] = $this->createUrl("update/index", array("doupdate" => intval(!empty($type)), "updatetype" => implode(",", $type)));
} else {
$data["doUpdate"] = false;
}
$this->render("index", $data);
}
示例15: actionDel
public function actionDel()
{
if (EnvUtil::submitCheck("formhash")) {
$sid = EnvUtil::getRequest("sid");
FlowQueryTpl::model()->deleteByPk(intval($sid));
$this->ajaxReturn(array("isSuccess" => true));
}
}