当前位置: 首页>>代码示例>>PHP>>正文


PHP UserUtil::cleanCache方法代码示例

本文整理汇总了PHP中UserUtil::cleanCache方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtil::cleanCache方法的具体用法?PHP UserUtil::cleanCache怎么用?PHP UserUtil::cleanCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserUtil的用法示例。


在下文中一共展示了UserUtil::cleanCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUpdate

 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;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:21,代码来源:settingController.php

示例2: checkUserGroup

 public function checkUserGroup($uid)
 {
     $uid = intval($uid);
     $user = User::model()->fetchByUid($uid);
     if (empty($user)) {
         return 0;
     }
     $credits = $this->countCredit($uid, false);
     $updateArray = array();
     $groupId = $user["groupid"];
     if (0 < $user["groupid"]) {
         $group = UserGroup::model()->fetchByPk($user["groupid"]);
     } else {
         $group = array();
     }
     if ($user["credits"] != $credits) {
         $updateArray["credits"] = $credits;
         $user["credits"] = $credits;
     }
     $user["credits"] = $user["credits"] == "" ? 0 : $user["credits"];
     $sendNotify = false;
     if (empty($group) || !($group["creditshigher"] <= $user["credits"]) && $user["credits"] < $group["creditslower"]) {
         $newGroup = UserGroup::model()->fetchByCredits($user["credits"]);
         if (!empty($newGroup)) {
             if ($user["groupid"] != $newGroup["gid"]) {
                 $updateArray["groupid"] = $groupId = $newGroup["gid"];
                 $sendNotify = true;
             }
         }
     }
     if ($updateArray) {
         User::model()->modify($uid, $updateArray);
         UserUtil::cleanCache($uid);
     }
     if ($sendNotify) {
         Notify::model()->sendNotify($uid, "user_group_upgrade", array("{groupname}" => $newGroup["title"], "{url}" => Ibos::app()->urlManager->createUrl("user/home/credit", array("op" => "level", "uid" => $uid))));
     }
     return $groupId;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:39,代码来源:CreditUtil.php

示例3: actionPersonal

 public function actionPersonal()
 {
     $op = EnvUtil::getRequest("op");
     if (!in_array($op, array("profile", "avatar", "history", "password", "skin", "remind"))) {
         $op = "profile";
     }
     if (EnvUtil::submitCheck("userSubmit")) {
         if (!$this->getIsMe()) {
             throw new EnvException(Ibos::lang("Parameters error", "error"));
         }
         $data = $_POST;
         if ($op == "profile") {
             $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($this->getUid(), $value);
             }
         } elseif ($op == "password") {
             $user = $this->getUser();
             $update = false;
             if ($data["originalpass"] == "") {
                 $this->error(Ibos::lang("Original password require"));
             } elseif (strcasecmp(md5(md5($data["originalpass"]) . $user["salt"]), $user["password"]) !== 0) {
                 $this->error(Ibos::lang("Password is not correct"));
             } else {
                 if (!empty($data["newpass"]) && strcasecmp($data["newpass"], $data["newpass_confirm"]) !== 0) {
                     $this->error(Ibos::lang("Confirm password is not correct"));
                 } else {
                     $password = md5(md5($data["newpass"]) . $user["salt"]);
                     $update = User::model()->updateByUid($this->getUid(), array("password" => $password, "lastchangepass" => TIMESTAMP));
                 }
             }
         } elseif ($op == "remind") {
             $remindSetting = array();
             foreach (array("email", "sms", "app") as $field) {
                 if (!empty($data[$field])) {
                     foreach ($data[$field] as $id => $value) {
                         $remindSetting[$id][$field] = $value;
                     }
                 }
             }
             if (!empty($remindSetting)) {
                 $remindSetting = serialize($remindSetting);
             } else {
                 $remindSetting = "";
             }
             UserProfile::model()->updateByPk($this->getUid(), array("remindsetting" => $remindSetting));
         }
         UserUtil::cleanCache($this->getUid());
         $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("home/personal", array("op" => $op)));
     } else {
         if (in_array($op, array("avatar", "history", "password", "remind"))) {
             if (!$this->getIsMe()) {
                 $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("home/index"));
             }
         }
         $dataProvider = "get" . ucfirst($op);
         $data = array("user" => $this->getUser());
         if (method_exists($this, $dataProvider)) {
             $data = array_merge($data, $this->{$dataProvider}());
         }
         $data["op"] = $op;
         $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Home"), "url" => $this->createUrl("home/index")), array("name" => Ibos::lang("Profile"))));
         $this->render($op, $data);
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:77,代码来源:HomeController.php


注:本文中的UserUtil::cleanCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。