本文整理汇总了PHP中EnvUtil类的典型用法代码示例。如果您正苦于以下问题:PHP EnvUtil类的具体用法?PHP EnvUtil怎么用?PHP EnvUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EnvUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例3: actionAddComment
public function actionAddComment()
{
if (EnvUtil::submitCheck("formhash")) {
$widget = Ibos::app()->getWidgetFactory()->createWidget($this, "IWOfficialdocComment");
return $widget->addComment();
}
}
示例4: 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);
}
}
示例5: 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++;
}
}
}
}
}
示例6: 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);
}
}
示例7: 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"));
}
}
示例8: 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);
}
示例9: 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));
}
}
示例10: 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);
}
示例11: 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;
}
}
示例12: 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;
}
}
示例13: 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);
}
示例14: 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;
}
示例15: 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();
}