本文整理汇总了PHP中StringUtil::filterStr方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::filterStr方法的具体用法?PHP StringUtil::filterStr怎么用?PHP StringUtil::filterStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtil
的用法示例。
在下文中一共展示了StringUtil::filterStr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDestroy
public function actionDestroy()
{
$id = EnvUtil::getRequest("id");
$runId = StringUtil::filterStr(StringUtil::filterCleanHtml($id));
WfHandleUtil::destroy($runId);
$this->ajaxReturn(array("isSuccess" => true));
}
示例2: actionEdit
public function actionEdit()
{
$id = intval(EnvUtil::getRequest("id"));
if ($id) {
if (EnvUtil::submitCheck("formhash")) {
$this->beforeSave();
unset($_POST["id"]);
$data = FlowPermission::model()->create();
$status = FlowPermission::model()->modify($id, $data);
$this->ajaxReturn(array("isSuccess" => !!$status));
} else {
$per = FlowPermission::model()->fetchByPk($id);
if (!empty($per)) {
if ($per["deptid"] == "alldept") {
$users = "c_0";
} else {
$users = StringUtil::wrapId($per["uid"], "u") . "," . StringUtil::wrapId($per["deptid"], "d") . "," . StringUtil::wrapId($per["positionid"], "p");
}
$isCustom = !in_array($per["scope"], array("selforg", "alldept", "selfdeptall", "selfdept"));
$data = array("per" => $per, "lang" => Ibos::getLangSources(), "custom" => $isCustom, "users" => StringUtil::filterStr($users));
$this->renderPartial("edit", $data);
} else {
$this->ajaxReturn(Ibos::lang("Parameters error", "error"), "eval");
}
}
}
}
示例3: hasView
public static function hasView($feedid, $uid)
{
$feed = Feed::model()->get($feedid);
$feedUser = User::model()->fetchByUid($feed["uid"]);
$user = User::model()->fetchByUid($uid);
if ($feed && $feed["view"] !== WbConst::SELF_VIEW_SCOPE) {
$fuDeptIds = StringUtil::filterStr($feedUser["alldeptid"] . "," . $feedUser["alldowndeptid"]);
$deptIds = StringUtil::filterStr($user["alldeptid"] . "," . $user["allupdeptid"]);
if ($feed["view"] == WbConst::ALL_VIEW_SCOPE) {
return true;
} elseif ($feed["view"] == WbConst::SELFDEPT_VIEW_SCOPE) {
if (StringUtil::findIn($fuDeptIds, $deptIds)) {
return true;
}
} else {
if (StringUtil::findIn($feed["userid"], $uid)) {
return true;
}
if (StringUtil::findIn($feed["positionid"], $user["allposid"])) {
return true;
}
if (StringUtil::findIn($fuDeptIds, $deptIds)) {
return true;
}
}
}
return false;
}
示例4: 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;
}
示例5: fetchRealnamesByUids
public function fetchRealnamesByUids($uids, $glue = ",")
{
$uid = is_array($uids) ? $uids : explode(",", StringUtil::filterStr($uids));
$names = array();
foreach ($uid as $id) {
if (!empty($id)) {
$names[] = $this->fetchRealnameByUid($id);
}
}
return implode($glue, $names);
}
示例6: beforeSave
protected function beforeSave()
{
$viewExtFields = StringUtil::filterStr($_POST["viewextfields"]);
$sumFields = StringUtil::filterStr($_POST["sumfields"]);
$flowConditions = array("flowquerytype" => $_POST["flow_query_type"], "beginuser" => StringUtil::getId($_POST["begin_user"]), "runname" => StringUtil::filterCleanHtml($_POST["run_name"]), "flowstatus" => $_POST["flow_status"], "time1" => $_POST["time1"], "time2" => $_POST["time2"], "time3" => $_POST["time3"], "time4" => $_POST["time4"], "attachname" => StringUtil::filterCleanHtml($_POST["attach_name"]));
$groupbyFields = array("field" => $_POST["group_field"], "order" => $_POST["group_sort"]);
$name = StringUtil::filterCleanHtml($_POST["tplname"]);
$sid = intval(EnvUtil::getRequest("sid"));
$data = array("flowid" => $this->flowid, "uid" => $this->uid, "tplname" => $this->tplNameExists($name, $sid) ? $name . StringUtil::random(3) : $name, "viewextfields" => $viewExtFields, "sumfields" => $sumFields, "flowconditions" => serialize($flowConditions), "groupbyfields" => serialize($groupbyFields), "condformula" => $_POST["condformula"]);
return $data;
}
示例7: send
public function send($bodyId, $bodyData, $inboxId = EmailBaseController::INBOX_ID)
{
$toids = $bodyData["toids"] . "," . $bodyData["copytoids"] . "," . $bodyData["secrettoids"];
$toid = StringUtil::filterStr($toids);
foreach (explode(",", $toid) as $uid) {
$email = array("toid" => $uid, "fid" => $inboxId, "bodyid" => $bodyId);
$newId = $this->add($email, true);
$config = array("{sender}" => Ibos::app()->user->realname, "{subject}" => $bodyData["subject"], "{url}" => Ibos::app()->urlManager->createUrl("email/content/show", array("id" => $newId)), "{content}" => Ibos::app()->getController()->renderPartial("application.modules.email.views.remindcontent", array("body" => $bodyData), true));
Notify::model()->sendNotify($uid, "email_message", $config);
}
}
示例8: actionDel
public function actionDel()
{
if (EnvUtil::submitCheck("formhash")) {
$id = EnvUtil::getRequest("id");
$ruleId = StringUtil::filterStr($id);
if (!empty($ruleId)) {
$res = FlowRule::model()->deleteAll(sprintf("FIND_IN_SET(ruleid,'%s') AND uid = %d", $ruleId, $this->uid));
$this->ajaxReturn(array("isSuccess" => !!$res));
}
}
}
示例9: actionMark
public function actionMark()
{
$op = EnvUtil::getRequest("op");
$opList = array("todo", "read", "unread", "sendreceipt", "cancelreceipt", "del", "restore", "batchdel", "move");
if (!in_array($op, $opList)) {
exit;
}
$ids = EnvUtil::getRequest("emailids");
$id = StringUtil::filterStr($ids);
$extends = array();
$condition = "toid = " . $this->uid . " AND FIND_IN_SET(emailid,\"" . $id . "\")";
$valueDriver = array("read" => array("isread", 1), "unread" => array("isread", 0), "sendreceipt" => array("isreceipt", 1), "cancelreceipt" => array("isreceipt", 2), "restore" => array("isdel", 0));
switch ($op) {
case "del":
case "batchdel":
if ($op == "del") {
$next = Email::model()->fetchNext($id, $this->uid, $this->fid, $this->archiveId);
if (!empty($next)) {
$extends["url"] = $this->createUrl("content/show", array("id" => $next["emailid"], "archiveid" => $this->archiveId));
} else {
$extends["url"] = $this->createUrl("list/index");
}
}
$status = Email::model()->setField("isdel", 3, $condition);
break;
case "move":
$fid = intval(EnvUtil::getRequest("fid"));
$status = Email::model()->updateAll(array("fid" => $fid, "isdel" => 0), $condition);
break;
case "todo":
$markFlag = EnvUtil::getRequest("ismark");
$ismark = strcasecmp($markFlag, "true") == 0 ? 1 : 0;
$status = Email::model()->setField("ismark", $ismark, $condition);
break;
case "sendreceipt":
$fromInfo = Ibos::app()->db->createCommand()->select("eb.bodyid,eb.subject,eb.fromid")->from("{{email_body}} eb")->leftJoin("{{email}} e", "e.bodyid = eb.bodyid")->where("e.emailid = " . intval($id))->queryRow();
if ($fromInfo) {
$config = array("{reader}" => Ibos::app()->user->realname, "{url}" => Ibos::app()->urlManager->createUrl("email/content/show", array("id" => $fromInfo["bodyid"])), "{title}" => $fromInfo["subject"]);
Notify::model()->sendNotify($fromInfo["fromid"], "email_receive_message", $config);
}
default:
if (isset($valueDriver[$op])) {
$value = $valueDriver[$op][1][0];
$valueDriver;
$status = Email::model()->setField($key, $value, $condition);
} else {
$status = false;
}
break;
}
$errorMsg = !$status ? Ibos::lang("Operation failure", "message") : "";
$this->ajaxReturn(array_merge(array("isSuccess" => !!$status, "errorMsg" => $errorMsg), $extends));
}
示例10: actionDel
public function actionDel()
{
$ids = EnvUtil::getRequest("emailid");
$id = StringUtil::filterStr($ids);
$status = false;
if (!empty($id)) {
$condition = "toid = " . intval(Yii::app()->user->uid) . " AND FIND_IN_SET(emailid,\"" . $id . "\")";
$status = Email::model()->setField("isdel", 1, $condition);
}
$errorMsg = !$status ? Ibos::lang("Operation failure", "message") : "";
$this->ajaxReturn(array("isSuccess" => !!$status, "errorMsg" => $errorMsg), "JSONP");
}
示例11: actionDel
public function actionDel()
{
$id = EnvUtil::getRequest("webids");
if ($id) {
$id = StringUtil::filterStr($id);
$delStatus = EmailWeb::model()->delClear($id, $this->uid);
if ($delStatus) {
if (Yii::app()->request->getIsAjaxRequest()) {
$this->ajaxReturn(array("isSuccess" => true));
} else {
$this->success(Ibos::lang("Del succeed", "message"), $this->createUrl("web/index"));
}
}
}
}
示例12: fetchDeptNameByDeptId
public function fetchDeptNameByDeptId($id, $glue = ",", $returnFirst = false)
{
$deptArr = DepartmentUtil::loadDepartment();
$deptIds = is_array($id) ? $id : explode(",", StringUtil::filterStr($id));
$name = array();
if ($returnFirst) {
if (isset($deptArr[$deptIds[0]])) {
$name[] = $deptArr[$deptIds[0]]["deptname"];
}
} else {
foreach ($deptIds as $deptId) {
$name[] = isset($deptArr[$deptId]) ? $deptArr[$deptId]["deptname"] : null;
}
}
return implode($glue, $name);
}
示例13: fetchPosNameByPosId
public function fetchPosNameByPosId($id, $glue = ",", $returnFirst = false)
{
$posArr = PositionUtil::loadPosition();
$posIds = is_array($id) ? $id : explode(",", StringUtil::filterStr($id));
$name = array();
if ($returnFirst) {
if (isset($posArr[$posIds[0]])) {
$name[] = $posArr[$posIds[0]]["posname"];
}
} else {
foreach ($posIds as $posId) {
$name[] = isset($posArr[$posId]) ? $posArr[$posId]["posname"] : null;
}
}
return implode($glue, $name);
}
示例14: getUid
protected function getUid()
{
if ($this->inPersonal()) {
$uid = array(Ibos::app()->user->uid);
} else {
$id = EnvUtil::getRequest("uid");
$uids = StringUtil::filterCleanHtml(StringUtil::filterStr($id));
if (empty($uids)) {
$uid = User::model()->fetchSubUidByUid(Ibos::app()->user->uid);
if (empty($uid)) {
return array();
}
} else {
$uid = explode(",", $uids);
}
}
return $uid;
}
示例15: handleEmailBody
public function handleEmailBody($data)
{
$data["toids"] = implode(",", StringUtil::getId($data["toids"]));
$data["sendtime"] = TIMESTAMP;
$data["isneedreceipt"] = isset($data["isneedreceipt"]) ? 1 : 0;
if (empty($data["isOtherRec"])) {
$data["copytoids"] = $data["secrettoids"] = "";
} else {
$data["copytoids"] = implode(",", StringUtil::getId($data["copytoids"]));
$data["secrettoids"] = implode(",", StringUtil::getId($data["secrettoids"]));
}
if (empty($data["isWebRec"])) {
$data["towebmail"] = "";
}
if (!isset($data["fromwebmail"])) {
$data["fromwebmail"] = "";
}
!empty($data["attachmentid"]) && ($data["attachmentid"] = StringUtil::filterStr($data["attachmentid"]));
$data["size"] = EmailUtil::getEmailSize($data["content"], $data["attachmentid"]);
return $data;
}