本文整理汇总了PHP中UserUtil::updateCreditByAction方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtil::updateCreditByAction方法的具体用法?PHP UserUtil::updateCreditByAction怎么用?PHP UserUtil::updateCreditByAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtil
的用法示例。
在下文中一共展示了UserUtil::updateCreditByAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addDigg
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;
}
示例2: actionShare
public function actionShare()
{
if (empty($_GET["curid"])) {
$map["feedid"] = EnvUtil::getRequest("sid");
} else {
$map["feedid"] = EnvUtil::getRequest("curid");
}
$map["isdel"] = 0;
$isExist = Feed::model()->countByAttributes($map);
if ($isExist == 0) {
$return["isSuccess"] = false;
$return["data"] = "内容已被删除,转发失败";
$this->ajaxReturn($return);
}
$return = Feed::model()->shareFeed($_GET, "share");
if ($return["isSuccess"]) {
$module = $_GET["module"];
if ($module == "weibo") {
UserUtil::updateCreditByAction("forwardweibo", Ibos::app()->user->uid);
$suid = Ibos::app()->db->createCommand()->select("uid")->from("{{feed}}")->where(sprintf("feedid = %d AND isdel = 0", $map["feedid"]))->queryScalar();
$suid && UserUtil::updateCreditByAction("forwardedweibo", $suid);
}
}
$this->ajaxReturn($return, "JSONP");
}
示例3: doLogin
protected function doLogin($userName, $passWord, $loginType, $account, $autoLogin = 1, $cookieTime = 0, $inajax = 0)
{
if (!$passWord || $passWord != addslashes($passWord)) {
$this->error(Ibos::lang("Passwd illegal"));
}
$errornum = $this->loginCheck($account);
$ip = Ibos::app()->setting->get("clientip");
$identity = new ICUserIdentity($userName, $passWord, $loginType);
$result = $identity->authenticate();
if (0 < $result) {
$user = Ibos::app()->user;
if (empty($autoLogin)) {
$user->setState($user::AUTH_TIMEOUT_VAR, TIMESTAMP + $account["timeout"]);
} else {
MainUtil::setCookie("autologin", 1, $cookieTime);
}
$user->login($identity, $cookieTime);
if ($user->uid != 1) {
MainUtil::checkLicenseLimit(true);
}
if (!$inajax) {
$urlForward = EnvUtil::referer();
$log = array("terminal" => "web", "password" => StringUtil::passwordMask($passWord), "ip" => $ip, "user" => $userName, "loginType" => $loginType, "address" => "", "gps" => "");
Log::write($log, "login", sprintf("module.user.%d", $user->uid));
$rule = UserUtil::updateCreditByAction("daylogin", $user->uid);
if (!$rule["updateCredit"]) {
UserUtil::checkUserGroup($user->uid);
}
$this->success(Ibos::lang("Login succeed", "", array("{username}" => $user->realname)), $urlForward);
} else {
$this->ajaxReturn(array("isSuccess" => true));
}
} elseif ($result === 0) {
$this->error(Ibos::lang("User not fount", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -1) {
$this->error(Ibos::lang("User lock", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -2) {
$this->error(Ibos::lang("User disabled", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -3) {
FailedLogin::model()->updateFailed($ip);
list($ip1, $ip2) = explode(".", $ip);
$newIp = $ip1 . "." . $ip2;
FailedIp::model()->insertIp($newIp);
$log = array("user" => $userName, "password" => StringUtil::passwordMask($passWord), "ip" => $ip);
Log::write($log, "illegal", "module.user.login");
if ($errornum) {
$this->error("登录失败,您还可以尝试" . ($errornum - 1) . "次");
} else {
$this->error(Ibos::lang("User name or password is not correct"), "", array(), array("error" => $result));
}
}
}
示例4: save
private function save()
{
$data = ICResumeDetail::processAddRequestData();
$resume = array("input" => Ibos::app()->user->uid, "positionid" => $data["positionid"], "entrytime" => TIMESTAMP, "uptime" => TIMESTAMP, "status" => $data["status"], "statustime" => strtotime(date("Y-m-d")));
$resumeId = Resume::model()->add($resume, true);
if ($resumeId) {
$data["resumeid"] = $resumeId;
$data["birthday"] = strtotime($data["birthday"]);
ResumeDetail::model()->add($data);
if (!empty($data["avatarid"])) {
AttachUtil::updateAttach($data["avatarid"]);
}
if (!empty($data["attachmentid"])) {
AttachUtil::updateAttach($data["attachmentid"]);
}
$uid = Ibos::app()->user->uid;
UserUtil::updateCreditByAction("addresume", $uid);
$this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("resume/index"));
}
}
示例5: save
private function save()
{
if (EnvUtil::submitCheck("formhash")) {
$postData = $_POST;
$uid = Ibos::app()->user->uid;
$postData["uid"] = $uid;
$postData["subject"] = StringUtil::filterCleanHtml($_POST["subject"]);
$toidArr = StringUtil::getId($postData["toid"]);
$postData["toid"] = implode(",", $toidArr);
$postData["begindate"] = strtotime($postData["begindate"]);
$postData["enddate"] = strtotime($postData["enddate"]);
$reportData = ICReport::handleSaveData($postData);
$repid = Report::model()->add($reportData, true);
if ($repid) {
if (!empty($postData["attachmentid"])) {
AttachUtil::updateAttach($postData["attachmentid"]);
}
$orgPlan = $outSidePlan = array();
if (array_key_exists("orgPlan", $_POST)) {
$orgPlan = $_POST["orgPlan"];
}
if (!empty($orgPlan)) {
foreach ($orgPlan as $recordid => $val) {
$updateData = array("process" => intval($val["process"]), "exedetail" => StringUtil::filterCleanHtml($val["exedetail"]));
if ($updateData["process"] == self::COMPLETE_FALG) {
$updateData["flag"] = 1;
}
ReportRecord::model()->modify($recordid, $updateData);
}
}
if (array_key_exists("outSidePlan", $_POST)) {
$outSidePlan = array_filter($_POST["outSidePlan"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
}
if (!empty($outSidePlan)) {
ReportRecord::model()->addPlans($outSidePlan, $repid, $postData["begindate"], $postData["enddate"], $uid, 1);
}
$nextPlan = array_filter($_POST["nextPlan"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
ReportRecord::model()->addPlans($nextPlan, $repid, strtotime($_POST["planBegindate"]), strtotime($_POST["planEnddate"]), $uid, 2);
$wbconf = WbCommonUtil::getSetting(true);
if (isset($wbconf["wbmovement"]["report"]) && $wbconf["wbmovement"]["report"] == 1) {
$userid = $postData["toid"];
$supUid = UserUtil::getSupUid($uid);
if (0 < intval($supUid) && !in_array($supUid, explode(",", $userid))) {
$userid = $userid . "," . $supUid;
}
$data = array("title" => Ibos::lang("Feed title", "", array("{subject}" => $postData["subject"], "{url}" => Ibos::app()->urlManager->createUrl("report/review/show", array("repid" => $repid)))), "body" => StringUtil::cutStr($_POST["content"], 140), "actdesc" => Ibos::lang("Post report"), "userid" => trim($userid, ","), "deptid" => "", "positionid" => "");
WbfeedUtil::pushFeed($uid, "report", "report", $repid, $data);
}
UserUtil::updateCreditByAction("addreport", $uid);
if (!empty($toidArr)) {
$config = array("{sender}" => User::model()->fetchRealnameByUid($uid), "{subject}" => $reportData["subject"], "{url}" => Ibos::app()->urlManager->createUrl("report/review/show", array("repid" => $repid)));
Notify::model()->sendNotify($toidArr, "report_message", $config, $uid);
}
$this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("default/index"));
} else {
$this->error(Ibos::lang("Save faild", "message"), $this->createUrl("default/index"));
}
}
}
示例6: actionSave
public function actionSave()
{
$uid = Ibos::app()->user->uid;
$originalPlan = $planOutside = "";
if (array_key_exists("originalPlan", $_POST)) {
$originalPlan = $_POST["originalPlan"];
}
if (array_key_exists("planOutside", $_POST)) {
$planOutside = array_filter($_POST["planOutside"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
}
if (!empty($originalPlan)) {
foreach ($originalPlan as $key => $value) {
DiaryRecord::model()->modify($key, array("schedule" => $value));
}
}
$shareUidArr = isset($_POST["shareuid"]) ? StringUtil::getId($_POST["shareuid"]) : array();
$diary = array("uid" => $uid, "diarytime" => strtotime($_POST["todayDate"]), "nextdiarytime" => strtotime($_POST["plantime"]), "addtime" => TIMESTAMP, "content" => $_POST["diaryContent"], "shareuid" => implode(",", $shareUidArr), "readeruid" => "", "remark" => "", "attention" => "");
$diaryId = Diary::model()->add($diary, true);
if (!empty($planOutside)) {
DiaryRecord::model()->addRecord($planOutside, $diaryId, strtotime($_POST["todayDate"]), $uid, "outside");
}
$plan = array_filter($_POST["plan"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
DiaryRecord::model()->addRecord($plan, $diaryId, strtotime($_POST["plantime"]), $uid, "new");
UserUtil::updateCreditByAction("adddiary", $uid);
$this->ajaxReturn($diaryId, "JSONP");
}
示例7: runlog
public static function runlog($runId, $processId, $flowProcess, $uid, $logtype, $content, $toid = "")
{
$userip = EnvUtil::getClientIp();
$run = new ICFlowRun($runId);
$data = array("runid" => $runId, "runname" => $run->name, "flowid" => $run->flowid, "processid" => $processId, "flowprocess" => $flowProcess, "uid" => $uid, "time" => TIMESTAMP, "type" => $logtype, "ip" => $userip, "content" => $content, "toid" => $toid);
if (FlowRunLog::model()->add($data)) {
UserUtil::updateCreditByAction("wfnextpost", $uid);
return true;
}
return false;
}
示例8: actionShareFeed
public function actionShareFeed()
{
if (EnvUtil::submitCheck("formhash")) {
$post = $_POST;
foreach ($post as $key => $val) {
$post[$key] = StringUtil::filterCleanHtml($post[$key]);
}
if (empty($post["curid"])) {
$map["feedid"] = $post["sid"];
} else {
$map["feedid"] = $post["curid"];
}
$map["isdel"] = 0;
$isExist = Feed::model()->countByAttributes($map);
if ($isExist == 0) {
$return["isSuccess"] = false;
$return["data"] = "内容已被删除,转发失败";
$this->ajaxReturn($return);
}
$return = Feed::model()->shareFeed($post, "share");
if ($return["isSuccess"]) {
$module = $post["module"];
if ($module == "weibo") {
UserUtil::updateCreditByAction("forwardweibo", Ibos::app()->user->uid);
$suid = Ibos::app()->db->createCommand()->select("uid")->from("{{feed}}")->where(sprintf("feedid = %d AND isdel = 0", $map["feedid"]))->queryScalar();
$suid && UserUtil::updateCreditByAction("forwardedweibo", $suid);
}
$lang = Ibos::getLangSources();
$return["data"] = $this->renderPartial("feedlist", array("list" => array($return["data"]), "lang" => $lang), true);
}
$this->ajaxReturn($return);
}
}
示例9: verifyComplete
private function verifyComplete($artId, $uid)
{
Article::model()->updateAllStatusAndApproverByPks($artId, $uid, 1);
ArticleApproval::model()->deleteAll("articleid={$artId}");
$article = Article::model()->fetchByPk($artId);
if (!empty($article)) {
$wbconf = WbCommonUtil::getSetting(true);
if (isset($wbconf["wbmovement"]["article"]) && $wbconf["wbmovement"]["article"] == 1) {
$publishScope = array("deptid" => $article["deptid"], "positionid" => $article["positionid"], "uid" => $article["uid"]);
$data = array("title" => Ibos::lang("Feed title", "", array("{subject}" => $article["subject"], "{url}" => Ibos::app()->urlManager->createUrl("article/default/index", array("op" => "show", "articleid" => $article["articleid"])))), "body" => $article["content"], "actdesc" => Ibos::lang("Post news"), "userid" => $publishScope["uid"], "deptid" => $publishScope["deptid"], "positionid" => $publishScope["positionid"]);
if ($article["type"] == self::ARTICLE_TYPE_PICTURE) {
$type = "postimage";
$picture = ArticlePicture::model()->fetchByAttributes(array("articleid" => $article["articleid"]));
$data["attach_id"] = $picture["aid"];
} else {
$type = "post";
}
WbfeedUtil::pushFeed($article["author"], "article", "article", $article["articleid"], $data, $type);
}
UserUtil::updateCreditByAction("addarticle", $article["author"]);
}
}
示例10: save
private function save()
{
$uid = Ibos::app()->user->uid;
$realname = User::model()->fetchRealnameByUid($uid);
$originalPlan = $planOutside = array();
if (array_key_exists("originalPlan", $_POST)) {
$originalPlan = $_POST["originalPlan"];
}
if (array_key_exists("planOutside", $_POST)) {
$planOutside = array_filter($_POST["planOutside"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
}
if (!empty($originalPlan)) {
foreach ($originalPlan as $key => $value) {
DiaryRecord::model()->modify($key, array("schedule" => $value));
}
}
$date = $_POST["todayDate"] . " " . Ibos::lang("Weekday", "date") . DateTimeUtil::getWeekDay(strtotime($_POST["todayDate"]));
$shareUidArr = isset($_POST["shareuid"]) ? StringUtil::getId($_POST["shareuid"]) : array();
$diary = array("uid" => $uid, "diarytime" => strtotime($_POST["todayDate"]), "nextdiarytime" => strtotime($_POST["plantime"]), "addtime" => TIMESTAMP, "content" => $_POST["diaryContent"], "shareuid" => implode(",", $shareUidArr), "readeruid" => "", "remark" => "", "attention" => "");
if (!empty($_POST["attachmentid"])) {
AttachUtil::updateAttach($_POST["attachmentid"]);
}
$diary["attachmentid"] = $_POST["attachmentid"];
$diaryId = Diary::model()->add($diary, true);
if (!empty($planOutside)) {
DiaryRecord::model()->addRecord($planOutside, $diaryId, strtotime($_POST["todayDate"]), $uid, "outside");
}
$plan = array_filter($_POST["plan"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
DiaryRecord::model()->addRecord($plan, $diaryId, strtotime($_POST["plantime"]), $uid, "new");
$wbconf = WbCommonUtil::getSetting(true);
if (isset($wbconf["wbmovement"]["diary"]) && $wbconf["wbmovement"]["diary"] == 1) {
$supUid = UserUtil::getSupUid($uid);
if (0 < intval($supUid)) {
$data = array("title" => Ibos::lang("Feed title", "", array("{subject}" => $realname . " " . $date . " " . Ibos::lang("Work diary"), "{url}" => Ibos::app()->urlManager->createUrl("diary/review/show", array("diaryid" => $diaryId)))), "body" => StringUtil::cutStr($diary["content"], 140), "actdesc" => Ibos::lang("Post diary"), "userid" => $supUid, "deptid" => "", "positionid" => "");
WbfeedUtil::pushFeed($uid, "diary", "diary", $diaryId, $data);
}
}
UserUtil::updateCreditByAction("adddiary", $uid);
$upUid = UserUtil::getSupUid($uid);
if (!empty($upUid)) {
$config = array("{sender}" => User::model()->fetchRealnameByUid($uid), "{title}" => Ibos::lang("New diary title", "", array("{sub}" => $realname, "{date}" => $date)), "{content}" => $this->renderPartial("remindcontent", array("realname" => $realname, "date" => $date, "lang" => Ibos::getLangSources(), "originalPlan" => array_values($originalPlan), "planOutside" => array_values($planOutside), "content" => StringUtil::cutStr(strip_tags($_POST["diaryContent"]), 200), "plantime" => $_POST["plantime"] . " " . Ibos::lang("Weekday", "date") . DateTimeUtil::getWeekDay(strtotime($_POST["plantime"])), "plan" => array_values($plan)), true), "{url}" => Ibos::app()->urlManager->createUrl("diary/review/show", array("diaryid" => $diaryId)));
Notify::model()->sendNotify($upUid, "diary_message", $config, $uid);
}
$this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("default/index"));
}
示例11: updateToWeibo
private function updateToWeibo($data, $sourceInfo, $lessUids)
{
$commentInfo = Source::getSourceInfo($data["table"], $data["rowid"], false, $data["module"]);
$oldInfo = isset($commentInfo["sourceInfo"]) ? $commentInfo["sourceInfo"] : $commentInfo;
$arr = array("post", "postimage");
$scream = "";
if (!in_array($sourceInfo["type"], $arr)) {
$scream = "//@" . $commentInfo["source_user_info"]["realname"] . ":" . $commentInfo["source_content"];
}
if (!empty($data["tocid"])) {
$replyInfo = Comment::model()->getCommentInfo($data["tocid"], false);
$replyScream = "//@" . $replyInfo["user_info"]["realname"] . " :";
$data["content"] .= $replyScream . $replyInfo["content"];
}
$s["body"] = $data["content"] . $scream;
$s["curid"] = null;
$s["sid"] = $oldInfo["source_id"];
$s["module"] = $oldInfo["module"];
$s["type"] = $oldInfo["source_table"];
$s["comment"] = 1;
$s["comment_touid"] = $data["moduleuid"];
if ($sourceInfo["type"] == "post" && empty($data["touid"])) {
$lessUids[] = Ibos::app()->user->uid;
}
Feed::model()->shareFeed($s, "comment", $lessUids);
UserUtil::updateCreditByAction("forwardedweibo", Ibos::app()->user->uid);
}
示例12: save
private function save($bodyId, $bodyData)
{
if (!empty($bodyData["attachmentid"]) && $bodyId) {
AttachUtil::updateAttach($bodyData["attachmentid"], $bodyId);
}
if ($bodyData["issend"]) {
Email::model()->send($bodyId, $bodyData);
if (!empty($bodyData["towebmail"])) {
$toUsers = StringUtil::filterStr($bodyData["towebmail"], ";");
if (!empty($toUsers)) {
$webBox = EmailWeb::model()->fetchByPk($bodyData["fromwebid"]);
WebMailUtil::sendWebMail($toUsers, $bodyData, $webBox);
}
}
UserUtil::updateCreditByAction("postmail", $this->uid);
$message = Ibos::lang("Send succeed");
} else {
$message = Ibos::lang("Save succeed", "message");
}
if (Yii::app()->request->getIsAjaxRequest()) {
$this->ajaxReturn(array("isSuccess" => true, "messsage" => $message));
} else {
$this->success($message, $this->createUrl("list/index"));
}
}
示例13: updateVerify
private function updateVerify($op)
{
$uid = $this->getUid();
$session = new CHttpSession();
$session->open();
$data = $session["verifyData"];
if ($op == "email") {
User::model()->updateByUid($uid, array("validationemail" => 1, "email" => $data));
} elseif ($op == "mobile") {
User::model()->updateByUid($uid, array("validationmobile" => 1, "mobile" => $data));
}
UserUtil::updateCreditByAction("verify" . $op, $this->getUid());
}
示例14: verifyComplete
private function verifyComplete($docid, $uid)
{
Officialdoc::model()->updateAllStatusByDocids($docid, 1, $uid);
OfficialdocApproval::model()->deleteAll("docid={$docid}");
$doc = Officialdoc::model()->fetchByPk($docid);
if (!empty($doc)) {
$wbconf = WbCommonUtil::getSetting(true);
if (isset($wbconf["wbmovement"]["article"]) && $wbconf["wbmovement"]["article"] == 1) {
$publishScope = array("deptid" => $doc["deptid"], "positionid" => $doc["positionid"], "uid" => $doc["uid"]);
$data = array("title" => Ibos::lang("Feed title", "", array("{subject}" => $doc["subject"], "{url}" => Ibos::app()->urlManager->createUrl("officialdoc/officialdoc/show", array("docid" => $doc["docid"])))), "body" => $doc["content"], "actdesc" => Ibos::lang("Post officialdoc"), "userid" => $publishScope["uid"], "deptid" => $publishScope["deptid"], "positionid" => $publishScope["positionid"]);
WbfeedUtil::pushFeed($doc["author"], "officialdoc", "officialdoc", $doc["docid"], $data);
}
UserUtil::updateCreditByAction("addofficialdoc", $doc["author"]);
}
}
示例15: foreach
$ip = Ibos::app()->setting->get("clientip");
foreach ($_COOKIE as $k => $v) {
$cookiePath = $config["cookie"]["cookiepath"];
$cookieDomain = $config["cookie"]["cookiedomain"];
$secure = $_SERVER["SERVER_PORT"] == 443 ? 1 : 0;
@setcookie($k, "", time() - 86400, $cookiePath, $cookieDomain, $secure, false);
}
$account = Ibos::app()->setting->get("setting/account");
$user = Ibos::app()->user;
if ($account["allowshare"] != 1) {
$user->setStateKeyPrefix(Ibos::app()->setting->get("sid"));
}
$user->login($identity);
$log = array("terminal" => "bqqsso", "password" => "", "ip" => $ip, "user" => $curUser["username"], "loginType" => $identity::LOGIN_BY_USERNAME, "address" => "", "gps" => "");
Log::write($log, "login", sprintf("module.user.%d", $uid));
$rule = UserUtil::updateCreditByAction("daylogin", $uid);
if (!$rule["updateCredit"]) {
UserUtil::checkUserGroup($uid);
}
if ($returnurl == "index") {
header("Location: ../../index.php", true);
} else {
$url = parse_url($returnurl);
if (isset($url["scheme"])) {
header("Location:" . $returnurl, true);
} else {
header("Location:../../" . $returnurl, true);
}
}
}
} else {