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


PHP UserModel::updateUser方法代码示例

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


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

示例1: updateMissingData

 public function updateMissingData($user, array $me)
 {
     $updateData = array();
     if (empty($user['name'])) {
         $updateData['name'] = $me['name'];
     }
     if (empty($user['fbuid'])) {
         $updateData['fbuid'] = $me['id'];
     }
     if (!empty($updateData)) {
         $this->userModel->updateUser($user, $updateData);
     }
 }
开发者ID:exesek,项目名称:nette20login,代码行数:13,代码来源:FacebookAuthenticator.php

示例2: update

 public function update($params)
 {
     if (!$this->checkSign($params)) {
         return $this->response(0, array('errCode' => 'SIGN_ERROR', 'errInfo' => '签名错误'));
     }
     $userModel = new \UserModel();
     $result = $userModel->updateUser();
     return $this->response(1, $result);
 }
开发者ID:weipinglee,项目名称:nn2,代码行数:9,代码来源:User.php

示例3: updateAction

	public function updateAction($param){
		if($param == null)
				$this->notFoundAction();
		$opt = array(	"title" 	=> "Изменение профиля",
						"content"  	=> ($param == 0) ? "updatefile.tpl" : "updatetext.tpl");
		$data = array();
		$data["update"]		= isset($_FILES["img"])		? $_FILES["img"]["name"] 	: null;
		if(!$data["update"])
			$data["update"]	= isset($_POST["update"])	? $_POST["update"] 			: null;
		$data["param"]		= $param;
		if($data["update"] == null){
			if($param > 6 || $param < 0)
				$this->notFoundAction();
			$this->indexAction($opt, $data);
		}
		else{
			$model = new UserModel();
			$result = $model->updateUser($data, $this->_user["id"]);
			if(in_array(false, $result))
				$this->indexAction($opt, $data);
			else
				$this->profileAction();
		}
	}
开发者ID:93vlad,项目名称:task,代码行数:24,代码来源:UserController.php

示例4: checkUserLevel

 /**
  * 检查用户是否升级
  * 升级时加150金币coins 1个购买的币reward_points
  * @param $userinfo 
  */
 private function checkUserLevel($userinfo)
 {
     if (!$userinfo) {
         return;
     }
     $level = $userinfo->level;
     $experience = $userinfo->experience;
     $model = new LevelModel();
     $new_level = $model->getLevelByExp($experience);
     if ($new_level != $level) {
         $coins = $userinfo->coins + self::UPGRADE_ADD_COIN;
         $reward_points = $userinfo->reward_points + self::UPGRADE_ADD_CASH;
         $user = new UserModel();
         $user->updateUser($this->uid, array('level' => $new_level, 'coins' => $coins, 'reward_points' => $reward_points));
         $userinfo->level = $new_level;
         $userinfo->coins = $coins;
         $userinfo->reward_points = $reward_points;
         unset($user);
     }
     return $userinfo;
 }
开发者ID:atlas1308,项目名称:testtesttestfarm,代码行数:26,代码来源:DataHandler.php

示例5: updateMissingData

 public function updateMissingData($user, stdClass $info)
 {
     if (empty($user['name'])) {
         $this->userModel->updateUser($user, array('name' => $info->name));
     }
 }
开发者ID:exesek,项目名称:nette20login,代码行数:6,代码来源:TwitterAuthenticator.php

示例6: foreach

 try {
     foreach ($objUser->selectUsers(array('email' => '*5@mail.ru'))->toArray() as $userArray) {
         foreach ($userArray as $key => $val) {
             echo " [" . $key . " = " . $val . "] ";
         }
         echo '<br>';
     }
 } catch (Exception $e) {
     echo $e->getMessage() . '<br>';
 }
 echo '<br>' . "тест обновления пользователей" . '<br>';
 try {
     foreach ($objUser->selectUsers()->toArray() as $userArray) {
         $newUserArray = array('nick' => $userArray['nick'] . " updated!", 'email' => '');
         $id = $userArray[$arr['id']];
         $objUser->updateUser($id, $newUserArray);
         foreach ($objUser->selectUserByID($id)->toArray() as $key => $val) {
             // получаем данные по ID
             echo " [" . $key . " = " . $val . "] ";
         }
         echo '<br>';
     }
 } catch (Exception $e) {
     echo $e->getMessage() . '<br>';
 }
 /*
 echo '<br>' . "тест удаления пользователей" . '<br>';
 try {
     foreach($objUser->selectUsers()->toArray() as $userArray) {
         $objUser->deleteUser($userArray[ $arr['id'] ]);
         echo $userArray['login'] . " удален!" . '<br>';
开发者ID:freecod,项目名称:UserList,代码行数:31,代码来源:tests.php

示例7: upgradeDatabaseVersion20


//.........这里部分代码省略.........
                              accounts would work on switch
                           */
                        $users[$i]["PASSWORD"] = $v20check;
                        $users[$i]["STATUS"] = INACTIVE_STATUS;
                        $users[$i]["CREATION_TIME"] = $creation_time;
                        $users[$i]["UPS"] = 0;
                        $users[$i]["DOWNS"] = 0;
                        $users[$i]["ZKP_PASSWORD"] = $zkp_password;
                        $i++;
                    }
                    unset($users[$i]);
                    $result = NULL;
                }
            }
            $dbinfo = array("DBMS" => DBMS, "DB_HOST" => DB_HOST, "DB_USER" => DB_USER, "DB_PASSWORD" => DB_PASSWORD, "DB_NAME" => DB_NAME);
            $profile_model->initializeSql($db, $dbinfo);
            $database_tables = array_diff(array_keys($profile_model->create_statements), $save_tables);
            $database_tables = array_merge($database_tables, array("BLOG_DESCRIPTION", "USER_OLD", "ACCESS"));
            foreach ($database_tables as $table) {
                if (!in_array($table, $save_tables)) {
                    $db->execute("DROP TABLE " . $table);
                }
            }
            if ($profile_model->migrateDatabaseIfNecessary($dbinfo, $save_tables)) {
                $user_model = new UserModel(DB_NAME, false);
                $user_model->db = $db;
                foreach ($users as $user) {
                    $user_model->addUser($user["USER_NAME"], $user["PASSWORD"], $user["FIRST_NAME"], $user["LAST_NAME"], $user["EMAIL"], $user["STATUS"], $user["ZKP_PASSWORD"]);
                }
                $user = array();
                $user['USER_ID'] = ROOT_ID;
                $user['PASSWORD'] = $v20check;
                $user["ZKP_PASSWORD"] = $zkp_password;
                $user_model->updateUser($user);
                $db->execute("DELETE FROM VERSION WHERE ID < 19");
                $db->execute("UPDATE VERSION SET ID=20 WHERE ID=19");
                return;
            }
            $data['SCRIPT'] = "doMessage('<h1 class=\"red\" >" . "Couldn't migrate database tables from defaults!</h1>')";
        case "1":
        default:
            ?>
            <!DOCTYPE html>
            <html lang='en-US'>
            <head>
            <title>Yioop Upgrade Detected</title>
            <meta name="ROBOTS" content="NOINDEX,NOFOLLOW" />
            <meta name="Author" content="Christopher Pollett" />
            <meta charset="utf-8" />
            <?php 
            if (MOBILE) {
                ?>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <?php 
            }
            ?>
            <link rel="stylesheet" type="text/css"
                 href="<?php 
            e(BASE_URL);
            ?>
/css/search.css" />
            </head>
            <body class="html-ltr <?php 
            if (MOBILE) {
                e('mobile');
            }
开发者ID:yakar,项目名称:yioop,代码行数:67,代码来源:upgrade_functions.php


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