當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。