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); }
public function actionDestroy() { $id = EnvUtil::getRequest("id"); $runId = StringUtil::filterStr(StringUtil::filterCleanHtml($id)); WfHandleUtil::destroy($runId); $this->ajaxReturn(array("isSuccess" => true)); }
public function addDigg($feedId, $uid) { $data["feedid"] = $feedId; $data["uid"] = $uid; $data["uid"] = !$data["uid"] ? Ibos::app()->user->uid : $data["uid"]; if (!$data["uid"]) { $this->addError("addDigg", "未登录不能赞"); return false; } $isExit = $this->getIsExists($feedId, $uid); if ($isExit) { $this->addError("addDigg", "你已经赞过"); return false; } $data["ctime"] = time(); $res = $this->add($data); if ($res) { $feed = Source::getSourceInfo("feed", $feedId); Feed::model()->updateCounters(array("diggcount" => 1), "feedid = " . $feedId); Feed::model()->cleanCache($feedId); $user = User::model()->fetchByUid($uid); $config["{user}"] = $user["realname"]; $config["{sourceContent}"] = StringUtil::filterCleanHtml($feed["source_body"]); $config["{sourceContent}"] = str_replace("◆", "", $config["{sourceContent}"]); $config["{sourceContent}"] = StringUtil::cutStr($config["{sourceContent}"], 34); $config["{url}"] = $feed["source_url"]; $config["{content}"] = Ibos::app()->getController()->renderPartial("application.modules.message.views.remindcontent", array("recentFeeds" => Feed::model()->getRecentFeeds()), true); Notify::model()->sendNotify($feed["uid"], "message_digg", $config); UserUtil::updateCreditByAction("diggweibo", $uid); UserUtil::updateCreditByAction("diggedweibo", $feed["uid"]); } return $res; }
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); }
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); } }
public function updateKey($key, $nums, $add = true, $uid = "") { if ($nums == 0) { $this->addError("updateKey", Ibos::lang("Dont need to modify", "message.default")); return false; } $nums < 0 && ($add = false); $key = StringUtil::filterCleanHtml($key); $data = $this->getUserData($uid); if (empty($data) || !$data) { $data = array(); $data[$key] = $nums; } else { $data[$key] = $add ? (int) @$data[$key] + abs($nums) : (int) @$data[$key] - abs($nums); } $data[$key] < 0 && ($data[$key] = 0); $map["uid"] = empty($uid) ? Ibos::app()->user->uid : $uid; $map["key"] = $key; $this->deleteAll("`key` = :key AND uid = :uid", array(":key" => $key, ":uid" => $map["uid"])); $map["value"] = $data[$key]; $map["mtime"] = date("Y-m-d H:i:s"); $this->add($map); CacheUtil::rm("userData_" . $map["uid"]); return $data; }
public function actionUnFollow() { if (EnvUtil::submitCheck("formhash")) { $fid = StringUtil::filterCleanHtml($_POST["fid"]); $res = Follow::model()->unFollow(Ibos::app()->user->uid, intval($fid)); $this->ajaxReturn(array("isSuccess" => !!$res, "msg" => Follow::model()->getError("unFollow"))); } }
public function actionSetText() { $formID = intval(EnvUtil::getRequest("formid")); $field = StringUtil::filterCleanHtml(EnvUtil::getRequest("field")); $content = EnvUtil::getRequest("content"); Ibos::app()->db->createCommand()->update("{{flow_form_type}}", array($field => $content), "formid = " . $formID); exit("1"); }
public function actionLicense() { if (EnvUtil::submitCheck("formhash")) { $licensekey = StringUtil::filterCleanHtml(EnvUtil::getRequest("licensekey")); $filename = PATH_ROOT . "/data/licence.key"; @file_put_contents($filename, $licensekey); $this->success(Ibos::lang("Save succeed", "message")); } }
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; }
public function actionGetCommentList() { if (EnvUtil::submitCheck("formhash")) { $module = StringUtil::filterCleanHtml($_POST["module"]); $table = StringUtil::filterCleanHtml($_POST["table"]); $rowid = intval($_POST["rowid"]); $moduleuid = intval($_POST["moduleuid"]); $properties = array("module" => $module, "table" => $table, "attributes" => array("rowid" => $rowid, "limit" => 10, "moduleuid" => $moduleuid)); $widget = Ibos::app()->getWidgetFactory()->createWidget($this, "IWWeiboComment", $properties); $list = $widget->fetchCommentList(); $this->ajaxReturn(array("isSuccess" => true, "data" => $list)); } }
public function sendSms($data) { $s["uid"] = intval($data["uid"]); $s["touid"] = intval($data["touid"]); $s["mobile"] = StringUtil::filterCleanHtml($data["mobile"]); $s["posturl"] = StringUtil::filterCleanHtml($data["posturl"]); $s["node"] = StringUtil::filterCleanHtml($data["node"]); $s["module"] = StringUtil::filterCleanHtml($data["module"]); $s["return"] = StringUtil::filterCleanHtml($data["return"]); $s["content"] = StringUtil::filterDangerTag($data["content"]); $s["ctime"] = time(); return $this->add($s, true); }
public function addPlans($plans, $repid, $begindate, $enddate, $uid, $type, $exedetail = "") { foreach ($plans as $plan) { $remindDate = empty($plan["reminddate"]) ? 0 : strtotime($plan["reminddate"]); $record = array("repid" => $repid, "content" => StringUtil::filterCleanHtml($plan["content"]), "uid" => $uid, "flag" => isset($plan["process"]) && $plan["process"] == 10 ? 1 : 0, "planflag" => $type, "process" => isset($plan["process"]) ? $plan["process"] : 0, "exedetail" => StringUtil::filterCleanHtml($exedetail), "begindate" => $begindate, "enddate" => $enddate, "reminddate" => $remindDate); $rid = $this->add($record, true); $isInstallCalendar = ModuleUtil::getIsEnabled("calendar"); if ($isInstallCalendar && $remindDate) { $calendar = array("subject" => $record["content"], "starttime" => $remindDate, "endtime" => $remindDate, "uid" => $uid, "upuid" => $uid, "lock" => 1, "category" => 4, "isalldayevent" => 1); $cid = Calendars::model()->add($calendar, true); CalendarRepRecord::model()->add(array("rid" => $rid, "cid" => $cid, "repid" => $repid)); } } }
public function actionGetCommentList() { if (EnvUtil::submitCheck("formhash")) { $module = StringUtil::filterCleanHtml($_POST["module"]); $table = StringUtil::filterCleanHtml($_POST["table"]); $limit = EnvUtil::getRequest("limit"); $offset = EnvUtil::getRequest("offset"); $rowid = intval($_POST["rowid"]); $type = EnvUtil::getRequest("type"); $properties = array("module" => $module, "table" => $table, "attributes" => array("rowid" => $rowid, "limit" => $limit ? intval($limit) : 10, "offset" => $offset ? intval($offset) : 0, "type" => $type)); $widget = Ibos::app()->getWidgetFactory()->createWidget($this, "IWOfficialdocComment", $properties); $list = $widget->fetchCommentList(); $this->ajaxReturn(array("isSuccess" => true, "data" => $list)); } }
public function sendMessage($data) { if (empty($data["uid"])) { return false; } $s["uid"] = intval($data["uid"]); $s["node"] = StringUtil::filterCleanHtml($data["node"]); $s["module"] = StringUtil::filterCleanHtml($data["module"]); $s["isread"] = 0; $s["title"] = StringUtil::filterCleanHtml($data["title"]); $s["body"] = StringUtil::filterDangerTag($data["body"]); $s["ctime"] = time(); $s["url"] = $data["url"]; return $this->add($s, true); }
protected function beforeAdd(&$data, ICFlowType $type) { $name = $data["name"]; if (isset($data["prefix"])) { $name = $data["prefix"] . $name; } if (isset($data["suffix"])) { $name = $name . $data["suffix"]; } $runName = StringUtil::filterCleanHtml($name); $runNameExists = FlowRun::model()->checkExistRunName($type->getID(), $runName); if ($runNameExists) { $this->error(Ibos::lang("Duplicate run name")); } $data["name"] = $runName; }
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; }
public function actionSend() { $content = StringUtil::filterCleanHtml($_GET["content"]); $id = intval(isset($_GET["id"]) ? $_GET["id"] : 0); $touid = intval(isset($_GET["touid"]) ? $_GET["touid"] : 0); if (!$id && $touid) { $data = array("content" => $content, "touid" => $touid, "type" => 1); $res = MessageContent::model()->postMessage($data, Yii::app()->user->uid); $message = array("listid" => $res, "IsSuccess" => true); } else { $res = MessageContent::model()->replyMessage($id, $content, Yii::app()->user->uid); if ($res) { $message = array("IsSuccess" => true, "data" => Ibos::lang("Private message send success")); } else { $message = array("IsSuccess" => false, "data" => Ibos::lang("Private message send fail")); } } $this->ajaxReturn($message, "JSONP"); }
public function sendNotify($toUid, $node, $config) { empty($config) && ($config = array()); $nodeInfo = $this->getNode($node); if (!$nodeInfo) { return false; } !is_array($toUid) && ($toUid = explode(",", $toUid)); $userInfo = User::model()->fetchAllByUids($toUid); $data["node"] = $node; $data["module"] = $nodeInfo["module"]; $data["url"] = isset($config["{url}"]) ? $config["{url}"] : ""; $data["title"] = Ibos::lang($nodeInfo["titlekey"], "", $config); if (empty($nodeInfo["contentkey"])) { $data["body"] = $data["title"]; $hasContent = false; } else { $data["body"] = Ibos::lang($nodeInfo["contentkey"], "", $config); $hasContent = true; } MessageUtil::push("notify", $toUid, array("message" => $data["title"], "url" => $data["url"])); foreach ($userInfo as $v) { $data["uid"] = $v["uid"]; !empty($nodeInfo["sendmessage"]) && NotifyMessage::model()->sendMessage($data); $data["email"] = $v["email"]; $remindSetting = !empty($v["remindsetting"]) ? unserialize($v["remindsetting"]) : array(); if (isset($remindSetting[$node]) && isset($remindSetting[$node]["app"]) && $remindSetting[$node]["app"] == 1) { MessageUtil::appPush($toUid, $data["title"]); } if (!empty($nodeInfo["sendemail"])) { if (isset($remindSetting[$node]) && isset($remindSetting[$node]["email"]) && $remindSetting[$node]["email"] == 1) { NotifyEmail::model()->sendEmail($data, $hasContent); } } if (!empty($nodeInfo["sendsms"])) { if (isset($remindSetting[$node]) && isset($remindSetting[$node]["sms"]) && $remindSetting[$node]["sms"] == 1) { MessageUtil::sendSms($v["mobile"], StringUtil::filterCleanHtml($data["title"]), $nodeInfo["module"], $v["uid"]); } } } }
public function actionUpdate() { $profileField = array("birthday", "bio", "telephone", "address", "qq"); $userField = array("mobile", "email"); $model = array(); foreach ($_POST as $key => $value) { if (in_array($key, $profileField)) { if ($key == "birthday" && !empty($value)) { $value = strtotime($value); } $model["UserProfile"][$key] = StringUtil::filterCleanHtml($value); } elseif (in_array($key, $userField)) { $model["User"][$key] = StringUtil::filterCleanHtml($value); } } foreach ($model as $modelObject => $value) { $modelObject::model()->modify(Yii::app()->user->uid, $value); } UserUtil::cleanCache(Yii::app()->user->uid); exit; }
private function addKey($key, $feedId, $type) { $map["topicname"] = trim(preg_replace("/#/", "", StringUtil::filterCleanHtml($key))); $topic = $this->fetchByAttributes($map); if ($topic) { $this->updateCounters(array("count" => 1), sprintf("topicname = '%s'", $map["topicname"])); if ($topic["recommend"] == 1) { CacheUtil::rm("feed_topic_recommend"); } if ($feedId) { $this->addFeedJoinTopic($map["topicname"], $feedId, $type, true); } } else { $map["count"] = 1; $map["ctime"] = time(); $topicId = $this->add($map, true); if ($feedId) { $this->addFeedJoinTopic($topicId, $feedId, $type); } return $topicId; } }
public function sendEmail($data, $hasContent = false) { if (empty($data["email"])) { return false; } $s["uid"] = intval($data["uid"]); $s["node"] = StringUtil::filterCleanHtml($data["node"]); $s["email"] = StringUtil::filterCleanHtml($data["email"]); $s["module"] = StringUtil::filterCleanHtml($data["module"]); $s["issend"] = $s["sendtime"] = 0; $s["title"] = StringUtil::filterCleanHtml($data["title"]); $baseUrl = Ibos::app()->setting->get("siteurl"); $fullName = Ibos::app()->setting->get("setting/unit/fullname"); $user = User::model()->fetchByUid($s["uid"]); $named = $user["realname"] . ($user["gender"] == 1 ? " 先生" : " 女士"); $body = html_entity_decode($data["body"]); if ($hasContent) { //$bodystr = " <tr>\r\n\t\t\t<td colspan=\"2\">\r\n\t\t\t\t<div style=\"width:493px; padding:25px; margin:0 auto; background:#FFF; border:1px solid #ededed\">\r\n\t\t\t\t\t$body\r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t</tr> "; $bodystr = ' <tr> <td colspan="2"> <div style="width:493px; padding:25px; margin:0 auto; background:#FFF; border:1px solid #ededed"> $body </div> </td> </tr> '; } else { $bodystr = ""; } $s["body"] = "<!DOCTYPE HTML>\r\n<html lang=\"en-US\">\r\n<head>\r\n\t<meta charset=\"UTF-8\">\r\n\t<title>邮件提醒</title>\r\n</head>\r\n<body>\r\n\t<style type=\"text/css\">\r\n\t\ta{ text-decoration:none; }\r\n\t\ta:hover{ text-decoration:underline; }\r\n\t</style>\r\n\t<table style=\"width:598px; border:1px solid #e8e8e8; background:#fcfcfc; margin:0 auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t<tr>\r\n\t\t\t<!-- 公司名称 -->\r\n\t\t\t<td style=\"width:425px; height:49px; line-height:49px; overflow:hidden; background:#1180c6; font-size:18px; font-weight:bold; color:#FFF; font-family:'Microsoft YaHei';\"> {$fullName}</td>\r\n\t\t\t<td style=\"width:173px; height:49px; line-height:49px; overflow:hidden; background:#1180c6; font-size:12px; color:#FFF\">IBOS云服务中心·邮件提醒</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:30px; overflow:hidden;\"> </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 收件人姓名 -->\r\n\t\t\t<td colspan=\"2\" style=\"width:548px; height:40px; line-height:40px; overflow:hidden;font-size:16px; font-family:'b8bf53';\"><div style=\"width:543px; margin:0 auto; font-size:16px;\">HELLO!{$named}:</div></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:80px; overflow:hidden; \">\r\n\t\t\t\t<div style=\"width:543px; margin:0 auto;\">\r\n\t\t\t\t\t<!-- 通知标题 -->\r\n\t\t\t\t\t<p align=\"center\" style=\"width:493px; margin:0 auto; font-size:14px; line-height:20px; font-family:'b8bf53';color:#50545f;\">{$s["title"]}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n {$bodystr}\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:50px; overflow:hidden;\"> </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:40px; overflow:hidden;\">\r\n\t\t\t\t<!-- 登录按钮 -->\r\n\t\t\t\t<div style=\"width:380px; height:40px; line-height:40px; background:#1180c6; margin:0 auto; color:#fff; text-align:center\">\r\n <a href=\"{$baseUrl}{$data["url"]}\" target=\"_blank\" style=\" color:#fff;font-size:16px;\">现在就登录 IBOS协同办公平台,处理相关事宜!</a>\r\n </div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:40px; overflow:hidden;\"> </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 提示 -->\r\n\t\t\t<td colspan=\"2\" align=\"center\" style=\"width:598px; height:80px; overflow:hidden; font-size:12px;\">\r\n <span style=\"color:#1180c6\">■ </span>您可以在<span style=\"color:#1180c6\"> \r\n <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/index\">个人中心</a> -> \r\n <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/personal\">个人资料</a> -> \r\n <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/personal&op=remind\">提醒设置</a> \r\n </span>中管理来自IBOS协同办公平台的邮件提醒\r\n </td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<table style=\"width:600px; margin:0 auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td style=\"width:600px; height:30px; font-size:12px; font-family:'b8bf53';color:#50545f;\">\r\n <div style=\"line-height:30px; padding-top:5px;\">2014 © IBOS协同办公平台</div>\r\n </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 其他链接 -->\r\n\t\t\t<td style=\"width:600px; height:30px; font-size:12px; font-family:'b8bf53';color:#50545f; line-height:30px;\">\r\n <a href=\"http://www.ibos.com.cn\" style=\"color:#50545f;\" target=\"_blank\">开发者平台</a> / \r\n <a href=\"http://bbs.ibos.com.cn\" style=\"color:#50545f;\" target=\"_blank\">问答社区</a> / \r\n <a href=\"http://www.ibos.com.cn/wiki\" style=\"color:#50545f;\" target=\"_blank\">文档中心</a>  客户支持: 400-838-1185   support@ibos.com.cn\r\n </td>\r\n\t\t</tr>\r\n\t</table>\r\n</body>\r\n</html>"; $s["ctime"] = time(); if (CloudApi::getInstance()->isOpen() && CloudApi::getInstance()->exists("mail_send")) { MailUtil::sendCloudMail($s["email"], $s["title"], $s["body"]); } else { MailUtil::sendMail($s["email"], $s["title"], $s["body"]); } return $this->add($s, true); }
public function init() { $var = array(); $var["cancomment"] = 1; $var["canrepost"] = 1; $var["cancomment_old"] = 1; $var["showlist"] = 0; $var["tpl"] = "application.modules.weibo.views.comment.loadcomment"; $var["module"] = "weibo"; $var["table"] = "feed"; $var["limit"] = 10; $var["order"] = "cid DESC"; $var["inAjax"] = 0; $attr = $this->getAttributes(); if (empty($attr) && EnvUtil::submitCheck("formhash")) { $attr["moduleuid"] = intval($_POST["moduleuid"]); $attr["rowid"] = intval($_POST["rowid"]); $attr["module_rowid"] = intval($_POST["module_rowid"]); $attr["module_table"] = StringUtil::filterCleanHtml($_POST["module_table"]); $attr["inAjax"] = intval($_POST["inAjax"]); $attr["showlist"] = intval($_POST["showlist"]); $attr["cancomment"] = intval($_POST["cancomment"]); $attr["cancomment_old"] = intval($_POST["cancomment_old"]); $attr["module"] = StringUtil::filterCleanHtml($_POST["module"]); $attr["table"] = StringUtil::filterCleanHtml($_POST["table"]); $attr["canrepost"] = intval($_POST["canrepost"]); } is_array($attr) && ($var = array_merge($var, $attr)); $var["moduleuid"] = intval($var["moduleuid"]); $var["rowid"] = intval($var["rowid"]); if ($var["table"] == "feed" && Ibos::app()->user->uid != $var["moduleuid"]) { $sourceInfo = Feed::model()->get($var["rowid"]); $var["feedtype"] = $sourceInfo["type"]; $moduleRowData = Feed::model()->get(intval($var["module_rowid"])); $var["user_info"] = $moduleRowData["user_info"]; } $this->setAttributes($var); }
public function actionCategory() { if (EnvUtil::submitCheck("formhash")) { if (isset($_POST["name"])) { foreach ($_POST["name"] as $id => $val) { if (!empty($val)) { $data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["sort"][$id]), "deptid" => !empty($_POST["deptid"][$id]) ? implode(",", StringUtil::getId($_POST["deptid"][$id])) : ""); FlowCategory::model()->modify(intval($id), $data); } } } if (isset($_POST["newname"])) { foreach ($_POST["newname"] as $id => $val) { if (!empty($val)) { $data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["newsort"][$id]), "deptid" => !empty($_POST["newdeptid"][$id]) ? implode(",", StringUtil::getId($_POST["newdeptid"][$id])) : ""); FlowCategory::model()->add($data); } } } if (!empty($_POST["delid"])) { $id = StringUtil::filterStr($_POST["delid"]); if (!FlowCategory::model()->del($id)) { $this->error(Ibos::lang("Category delete require")); } } $this->success(Ibos::lang("Operation succeed", "message")); } else { $categorys = FlowCategory::model()->fetchAll(array("order" => "sort ASC")); foreach ($categorys as $key => &$cat) { if ($cat["deptid"] !== "") { $cat["deptid"] = StringUtil::wrapId($cat["deptid"], "d"); } $cat["flownums"] = FlowType::model()->countByAttributes(array("catid" => $cat["catid"])); $cat["formnums"] = FlowFormType::model()->countByAttributes(array("catid" => $cat["catid"])); } $this->render("category", array("list" => $categorys)); } }
public function actionIndex() { $keyword = EnvUtil::getRequest("keyword"); if (!empty($keyword)) { $keyword = StringUtil::filterCleanHtml($keyword); } else { $keyword = ""; } if (isset($_GET["pagesize"])) { $this->setListPageSize($_GET["pagesize"]); } $catId = $this->getCatId(); $condition = $catId ? "ft.catid = " . intval($catId) : "1"; if (!empty($keyword)) { $condition .= " AND ft.name LIKE '%{$keyword}%'"; } $count = FlowType::model()->countByList($condition); $pages = PageUtil::create($count, $this->getListPageSize()); $list = FlowType::model()->fetchAllByList($this->uid, $condition, $pages->getOffset(), $pages->getLimit()); $data = array("list" => $list, "pages" => $pages, "category" => $this->category, "catId" => $this->catid, "pageSize" => $this->getListPageSize()); $this->setPageTitle(Ibos::lang("Workflow manager")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang("Workflow manager"), "url" => $this->createUrl("type/index")), array("name" => Ibos::lang("List")))); $this->render("index", $data); }
public function actionIndex() { $op = EnvUtil::getRequest("op"); $id = intval(EnvUtil::getRequest("id")); if (EnvUtil::submitCheck("formhash")) { if ($op == "edit") { $dayNew = $_POST["weekdaynew"] != -1 ? -1 : $_POST["daynew"]; if (strpos($_POST["minutenew"], ",") !== false) { $minuteNew = explode(",", $_POST["minutenew"]); foreach ($minuteNew as $key => $val) { $minuteNew[$key] = $val = intval($val); if ($val < 0 || 59 < $val) { unset($minuteNew[$key]); } } $minuteNew = array_slice(array_unique($minuteNew), 0, 12); $minuteNew = implode("\t", $minuteNew); } else { $minuteNew = intval($_POST["minutenew"]); $minuteNew = 0 <= $minuteNew && $minuteNew < 60 ? $minuteNew : ""; } $cronfile = $this->getRealCronFile($_POST["type"], $_POST["filenamenew"], $_POST["module"]); if (preg_match("/[\\\\\\/\\:\\*\\?\"\\<\\>\\|]+/", $_POST["filenamenew"])) { $this->error(Ibos::lang("Crons filename illegal")); } elseif (!is_readable($cronfile)) { $this->error(Ibos::lang("Crons filename invalid", "", array("{cronfile}" => $cronfile))); } else { if ($_POST["weekdaynew"] == -1 && $dayNew == -1 && $_POST["hournew"] == -1 && $minuteNew === "") { $this->error(Ibos::lang("Crons time invalid")); } } $data = array("weekday" => $_POST["weekdaynew"], "day" => $dayNew, "hour" => $_POST["hournew"], "minute" => $minuteNew, "filename" => trim($_POST["filenamenew"])); $id && Cron::model()->modify($id, $data); Ibos::app()->cron->run($id); } elseif ($op == "delete") { if (!empty($_POST["delete"])) { $ids = StringUtil::iImplode($_POST["delete"]); Cron::model()->deleteAll(sprintf("cronid IN (%s) AND type='user'", $ids)); } } else { if (isset($_POST["namenew"]) && !empty($_POST["namenew"])) { foreach ($_POST["namenew"] as $id => $name) { $newCron = array("name" => StringUtil::filterCleanHtml($_POST["namenew"][$id]), "available" => isset($_POST["availablenew"][$id]) ? 1 : 0); if (isset($_POST["availablenew"][$id]) && empty($_POST["availablenew"][$id])) { $newCron["nextrun"] = "0"; } Cron::model()->modify($id, $newCron); } } if (!empty($_POST["newname"])) { $data = array("name" => StringUtil::ihtmlSpecialChars($_POST["newname"]), "type" => "user", "available" => "0", "weekday" => "-1", "day" => "-1", "hour" => "-1", "minute" => "", "nextrun" => TIMESTAMP); Cron::model()->add($data); } $list = Cron::model()->fetchAll(array("select" => "cronid,filename,type,module")); foreach ($list as $cron) { $cronFile = $this->getRealCronFile($cron["type"], $cron["filename"], $cron["module"]); if (!file_exists($cronFile)) { Cron::model()->modify($cron["cronid"], array("available" => 0, "nextrun" => 0)); } } CacheUtil::update("setting"); } $this->success(Ibos::lang("Crons succeed"), $this->createUrl("cron/index")); } else { if ($op && in_array($op, array("edit", "run"))) { $cron = Cron::model()->fetchByPk($id); if (!$cron) { $this->error("Cron not found"); } $cron["filename"] = str_replace(array("..", "/", "\\"), array("", "", ""), $cron["filename"]); if ($op == "edit") { $this->render("edit", array("cron" => $cron)); } elseif ($op == "run") { $file = $this->getRealCronFile($cron["type"], $cron["filename"], $cron["module"]); if (!file_exists($file)) { $this->error(Ibos::lang("Crons run invalid", "", array("{cronfile}" => $file))); } else { Ibos::app()->cron->run($cron["cronid"]); $this->success(Ibos::lang("Crons run succeed"), $this->createUrl("cron/index")); } } } else { $list = Cron::model()->fetchAll(array("order" => "type desc")); $this->handleCronList($list); $this->render("index", array("list" => $list)); } } }
require_once $defines; require_once $yii; require_once $ibosApplication; $ibos = Yii::createApplication("ICApplication", $config); $im = Setting::model()->fetchSettingValueByKey("im"); $im = unserialize($im); $imCfg = $im["qq"]; $cid = filter_input(INPUT_GET, "company_id", FILTER_SANITIZE_STRING); $openId = filter_input(INPUT_GET, "open_id", FILTER_SANITIZE_STRING); $hashskey = filter_input(INPUT_GET, "hashskey", FILTER_SANITIZE_STRING); $hashkey = filter_input(INPUT_GET, "hashkey", FILTER_SANITIZE_STRING); $returnurl = filter_input(INPUT_GET, "returnurl", FILTER_SANITIZE_STRING); 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");
private function update() { if (EnvUtil::submitCheck("formhash")) { $repid = $_POST["repid"]; $typeid = $_POST["typeid"]; $uid = Ibos::app()->user->uid; $editRepData = array("uid" => $uid, "begindate" => strtotime($_POST["begindate"]), "enddate" => strtotime($_POST["enddate"]), "typeid" => $typeid, "subject" => StringUtil::filterCleanHtml($_POST["subject"]), "content" => $_POST["content"], "attachmentid" => $_POST["attachmentid"], "toid" => implode(",", StringUtil::getId($_POST["toid"]))); Report::model()->modify($repid, $editRepData); if (isset($_POST["orgPlan"])) { foreach ($_POST["orgPlan"] as $recordid => $orgPlan) { $updateData = array("process" => intval($orgPlan["process"]), "exedetail" => StringUtil::filterCleanHtml($orgPlan["exedetail"])); if ($updateData["process"] == self::COMPLETE_FALG) { $updateData["flag"] = 1; } ReportRecord::model()->modify($recordid, $updateData); } } ReportRecord::model()->deleteAll("repid=:repid AND planflag!=:planflag", array(":repid" => $repid, ":planflag" => 0)); $isInstallCalendar = ModuleUtil::getIsEnabled("calendar"); if ($isInstallCalendar) { Calendars::model()->deleteALL("`calendarid` IN(select `cid` from {{calendar_rep_record}} where `repid`={$repid})"); CalendarRepRecord::model()->deleteAll("repid = {$repid}"); } if (isset($_POST["outSidePlan"])) { $outSidePlan = array_filter($_POST["outSidePlan"], create_function("\$v", "return !empty(\$v[\"content\"]);")); if (!empty($outSidePlan)) { ReportRecord::model()->addPlans($outSidePlan, $repid, $editRepData["begindate"], $editRepData["enddate"], $uid, 1); } } if (isset($_POST["nextPlan"])) { $nextPlan = array_filter($_POST["nextPlan"], create_function("\$v", "return !empty(\$v[\"content\"]);")); if (!empty($nextPlan)) { ReportRecord::model()->addPlans($nextPlan, $repid, strtotime($_POST["planBegindate"]), strtotime($_POST["planEnddate"]), $uid, 2); } } $attachmentid = trim($_POST["attachmentid"], ","); AttachUtil::updateAttach($attachmentid); $this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("default/index")); } }
public function actionConfirmPost() { if (EnvUtil::submitCheck("formhash")) { $key = EnvUtil::getRequest("key"); $param = WfCommonUtil::param($key, "DECODE"); $runId = intval($param["runid"]); $processId = intval($param["processid"]); $flowId = intval($param["flowid"]); $flowProcess = intval($param["flowprocess"]); $opflag = intval($_POST["opflag"]); $oldUid = intval($_POST["oldUid"]); $this->checkRunAccess($runId); $this->checkEntrustType($flowId); $referer = EnvUtil::referer(); $frp = FlowRunProcess::model()->fetchRunProcess($runId, $processId, $flowProcess, $oldUid); if ($frp) { $parent = $frp["parent"]; $topflag = $frp["topflag"]; } $toid = implode(",", StringUtil::getId($_POST["prcs_other"])); $tempFRP = FlowRunProcess::model()->fetchRunProcess($runId, $processId, $flowProcess, $toid); if (!$tempFRP) { $data = array("runid" => $runId, "processid" => $processId, "uid" => $toid, "flag" => 1, "flowprocess" => $flowProcess, "opflag" => $opflag, "topflag" => $topflag, "parent" => $parent, "createtime" => TIMESTAMP); FlowRunProcess::model()->add($data); } else { if ($tempFRP["opflag"] == 0 && $opflag == 1) { FlowRunProcess::model()->updateAll(array("opflag" => 1, "flag" => 2), sprintf("runid = %d AND processid = %d AND flowprocess = %d AND uid = %d", $runId, $processId, $flowProcess, $toid)); } else { $name = User::model()->fetchRealnameByUid($toid); $this->error(Ibos::lang("Already are opuser", "", array("{name}" => $name)), $referer); } } FlowRunProcess::model()->updateProcessTime($runId, $processId, $flowProcess, $oldUid); FlowRunProcess::model()->updateAll(array("flag" => 4, "opflag" => 0, "delivertime" => TIMESTAMP), "runid = :runid AND processid = :prcsid AND flowprocess = :fp AND uid = :uid", array(":runid" => $runId, ":prcsid" => $processId, ":fp" => $flowProcess, ":uid" => $oldUid)); $toName = User::model()->fetchRealnameByUid($toid); $userName = User::model()->fetchRealnameByUid($oldUid); $content = Ibos::lang("Entrust to desc", "", array("{username}" => $userName, "{toname}" => $toName)); WfCommonUtil::runlog($runId, $processId, $flowProcess, $this->uid, 2, $content, $toid); $message = StringUtil::filterCleanHtml($_POST["message"]); if (!empty($message)) { Notify::model()->sendNotify($toid, "workflow_entrust_notice", array("{message}" => $message)); } $this->redirect($referer); } }
public function addComment() { $return = array("isSuccess" => false, "data" => Ibos::lang("Post comment fail", "message")); $data = $_POST; foreach ($data as $key => $val) { $data[$key] = StringUtil::filterCleanHtml($data[$key]); } $data["uid"] = Ibos::app()->user->uid; $data["content"] = StringUtil::filterDangerTag($data["content"]); $table = ucfirst($data["table"]); $pk = $table::model()->getTableSchema()->primaryKey; $sourceInfo = $table::model()->fetch(array("condition" => "`{$pk}` = {$data["rowid"]}")); if (!$sourceInfo) { $return["isSuccess"] = false; $return["data"] = Ibos::lang("Comment has been delete", "message.default"); $this->getOwner()->ajaxReturn($return); } $data["cid"] = Comment::model()->addComment($data); if (!empty($data["attachmentid"])) { AttachUtil::updateAttach($data["attachmentid"]); } $data["ctime"] = TIMESTAMP; if ($data["cid"]) { $this->afterAdd($data, $sourceInfo); $return["isSuccess"] = true; $return["data"] = $this->parseComment($data); } $this->getOwner()->ajaxReturn($return); }