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


PHP UserUtil::wrapUserInfo方法代码示例

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


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

示例1: handleUsers

 public function handleUsers($event)
 {
     $users = array();
     $records = User::model()->fetchAll(array("condition" => "status IN (0,1)"));
     if (!empty($records)) {
         foreach ($records as $record) {
             $users[$record["uid"]] = UserUtil::wrapUserInfo($record);
         }
     }
     Syscache::model()->modify("users", $users);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:11,代码来源:UsersCacheProvider.php

示例2: actionAdd

 public function actionAdd()
 {
     MainUtil::checkLicenseLimit();
     if (EnvUtil::submitCheck("userSubmit")) {
         $origPass = filter_input(INPUT_POST, "password", FILTER_SANITIZE_STRING);
         $_POST["salt"] = StringUtil::random(6);
         $_POST["password"] = !empty($origPass) ? md5(md5($origPass) . $_POST["salt"]) : "";
         $_POST["createtime"] = TIMESTAMP;
         $_POST["guid"] = StringUtil::createGuid();
         $this->dealWithSpecialParams();
         $data = User::model()->create();
         $newId = User::model()->add($data, true);
         if ($newId) {
             UserCount::model()->add(array("uid" => $newId));
             $ip = Ibos::app()->setting->get("clientip");
             UserStatus::model()->add(array("uid" => $newId, "regip" => $ip, "lastip" => $ip));
             UserProfile::model()->add(array("uid" => $newId));
             if (!empty($_POST["auxiliarydept"])) {
                 $deptIds = StringUtil::getId($_POST["auxiliarydept"]);
                 $this->handleAuxiliaryDept($newId, $deptIds, $_POST["deptid"]);
             }
             if (!empty($_POST["auxiliarypos"])) {
                 $posIds = StringUtil::getId($_POST["auxiliarypos"]);
                 $this->handleAuxiliaryPosition($newId, $posIds, $_POST["positionid"]);
             }
             $newUser = User::model()->fetchByPk($newId);
             $users = UserUtil::loadUser();
             $users[$newId] = UserUtil::wrapUserInfo($newUser);
             User::model()->makeCache($users);
             OrgUtil::update();
             OrgUtil::hookSyncUser($newId, $origPass, 1);
             $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("user/index"));
         } else {
             $this->error(Ibos::lang("Add user failed"), $this->createUrl("user/index"));
         }
     } else {
         $deptid = "";
         $manager = "";
         $account = Ibos::app()->setting->get("setting/account");
         if ($account["mixed"]) {
             $preg = "[0-9]+[A-Za-z]+|[A-Za-z]+[0-9]+";
         } else {
             $preg = "^[A-Za-z0-9\\!\\@\\#\$\\%\\^\\&\\*\\.\\~]{" . $account["minlength"] . ",32}\$";
         }
         if ($deptid = EnvUtil::getRequest("deptid")) {
             $deptid = StringUtil::wrapId(EnvUtil::getRequest("deptid"), "d");
             $manager = StringUtil::wrapId(Department::model()->fetchManagerByDeptid(EnvUtil::getRequest("deptid")), "u");
         }
         $this->setPageTitle(Ibos::lang("Add user"));
         $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Organization"), "url" => $this->createUrl("department/index")), array("name" => Ibos::lang("User manager"), "url" => $this->createUrl("user/index")), array("name" => Ibos::lang("Add user"))));
         $this->render("add", array("deptid" => $deptid, "manager" => $manager, "passwordLength" => $account["minlength"], "preg" => $preg));
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:53,代码来源:UserController.php

示例3: updateByUid

 public function updateByUid($uid, $attributes)
 {
     $counter = $this->updateByPk($uid, $attributes);
     $users = UserUtil::loadUser();
     $users[$uid] = UserUtil::wrapUserInfo(array_merge($users[$uid], $attributes));
     $this->makeCache($users);
     return $counter;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:8,代码来源:User.php

示例4: addUser

 private function addUser()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $fields = array("username", "password", "realname", "mobile", "deptid", "positionid", "email");
         if (empty($_POST["username"]) || empty($_POST["password"])) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Username or password not empty")));
         }
         foreach ($fields as $field) {
             if (isset($_POST[$field]) && !empty($_POST[$field])) {
                 $_POST[$field] = StringUtil::filterDangerTag($_POST[$field]);
             }
         }
         $salt = StringUtil::random(6);
         $userData = array("salt" => $salt, "username" => $_POST["username"], "password" => !empty($_POST["password"]) ? md5(md5($_POST["password"]) . $salt) : "", "realname" => $_POST["realname"], "mobile" => $_POST["mobile"], "createtime" => TIMESTAMP, "deptid" => intval($_POST["deptid"]), "positionid" => intval($_POST["positionid"]), "email" => $_POST["email"]);
         $newId = User::model()->add($userData, true);
         if ($newId) {
             UserCount::model()->add(array("uid" => $newId));
             $ip = Ibos::app()->setting->get("clientip");
             UserStatus::model()->add(array("uid" => $newId, "regip" => $ip, "lastip" => $ip));
             UserProfile::model()->add(array("uid" => $newId));
             $newUser = User::model()->fetchByPk($newId);
             $users = UserUtil::loadUser();
             $users[$newId] = UserUtil::wrapUserInfo($newUser);
             User::model()->makeCache($users);
             OrgUtil::update();
             $res["isSuccess"] = true;
         } else {
             $res["isSuccess"] = false;
             $res["msg"] = Ibos::lang("Add user failed");
         }
         $this->ajaxReturn($res);
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:33,代码来源:DefaultController.php


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