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


PHP Account::setUsername方法代码示例

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


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

示例1: loginAccount

 public function loginAccount($username, $password)
 {
     $this->dbConnect();
     //Encrypt the password
     $password = Operations::encryptPassword($username, $password);
     //Query to get the user's details
     $sql = "SELECT * FROM users WHERE username = ? AND password = ?";
     $stmt = $this->con->prepare($sql);
     $stmt->bindParam(1, $username);
     $stmt->bindParam(2, $password);
     $stmt->execute();
     $stmt->setFetchMode(PDO::FETCH_ASSOC);
     $results = $stmt->fetchAll();
     //For each of the results (only one) *This will only happen if there is a result, so return inside the foreach*
     foreach ($results as $row) {
         //Instantiate a new account object
         $account = new Account();
         //Set the account details
         $account->setUsername($row["username"]);
         $account->setPassword($row["password"]);
         $account->setFirstname($row["firstname"]);
         $account->setLastname($row["lastname"]);
         $account->setEmail($row["email"]);
         $this->dbDisconnect();
         //Return the account object
         return $account;
     }
     $this->dbDisconnect();
     return null;
 }
开发者ID:xcgpseud,项目名称:forum,代码行数:30,代码来源:Database.php

示例2: addAccount

 public function addAccount($username, $password, $firstname)
 {
     // Loop through the current accounts to see if the username already exists
     // If the username does not exist, we will push the new account in to the array & return true
     // Else, return false
     $accountExists = false;
     foreach ($this::$data as $account) {
         if ($account->getUsername() == $username) {
             $accountExists = true;
             break;
         }
     }
     if ($accountExists) {
         return false;
     } else {
         $account = new Account();
         $account->setUsername($username);
         $account->setPassword($password);
         $account->setFirstname($firstname);
         echo "adding to data..";
         array_push(InMemoryDatabase::$data, $account);
         var_dump($this::$data);
         return true;
     }
 }
开发者ID:xcgpseud,项目名称:chat,代码行数:25,代码来源:InMemoryDatabase.php

示例3: doSignUp

 public function doSignUp($request, $dbConnection)
 {
     $account = new Account($dbConnection);
     $account->setPassword($request['password']);
     $account->setUsername($request['username']);
     $account->setEmail($request['email']);
     $account->insert();
 }
开发者ID:athene-sterni,项目名称:yummy-octo-garbanzo,代码行数:8,代码来源:signup.php

示例4: createAccount

 public function createAccount(Account $account)
 {
     $params = array('package_type' => $account->getType(), 'period' => $account->getPeriod(), 'method' => 'create');
     $result = $this->_request($params);
     $account->setStatus('enabled');
     $account->setUsername($result['user']);
     $account->setPassword($result['vpn_password']);
     return $account;
 }
开发者ID:fordnox,项目名称:purevpn-php-api-client,代码行数:9,代码来源:Purevpn.php

示例5: LoadAcc

 public function LoadAcc($id)
 {
     $acc = new Account();
     $allaccs = file('storage/account.txt');
     foreach ($allaccs as $allacc) {
         $accarr = explode(':', $allacc);
         if ($id == $accarr['0']) {
             $acc->setId($accarr['0']);
             $acc->setUsername($accarr['1']);
             $acc->setPassword($accarr['2']);
             $pro = new ProfilController();
             $acc->setProfil($pro->GetById($accarr['3']));
             $lan = new SpracheController();
             $acc->setSprache($lan->GetById($accarr['4']));
             return $acc;
         }
     }
     return false;
 }
开发者ID:TheRobidog,项目名称:M133,代码行数:19,代码来源:accountcontroller.php

示例6: displayForm

    if ($_POST['submit'] && recaptchaCheck()) {
        extract($_POST);
        //CALL CHECKPASSWORD
        $database = connectToDatabase();
        $new_account = new Account();
        $new_account->setFirstName($first_name);
        $new_account->setLastName($last_name);
        $new_account->setMiddleInitial($middle_initial);
        $new_account->setStreetAddress($street_address);
        $new_account->setCity($city);
        $new_account->setState($state);
        $new_account->setZipCode($zip_code);
        $new_account->setEmailAddress($email_address);
        $new_account->setAreaCode($area_code);
        $new_account->setPhoneNumber($phone_number);
        $new_account->setUsername($username, $database);
        if ($password === $password2) {
            $new_account->setPassword($password);
        }
        if ($new_account->updateDatabase($database) == 0) {
            displayForm();
        } else {
            echo "Account created successfully!<br/>";
        }
    } else {
        displayForm();
    }
}
function displayForm()
{
    echo "<form method='post'>";
开发者ID:fbrier,项目名称:open-configurator,代码行数:31,代码来源:create_account.php

示例7: getFriends

 public function getFriends($currentUser)
 {
     $this->dbConnect();
     $sql = "SELECT * FROM accounts WHERE username <> ?";
     $statement = $this->con->prepare($sql);
     $statement->bindParam(1, $currentUser);
     $statement->execute();
     $statement->setFetchMode(PDO::FETCH_ASSOC);
     $results = $statement->fetchAll();
     $users = array();
     foreach ($results as $row) {
         $account = new Account();
         $account->setUsername($row["username"]);
         $account->setPassword($row["password"]);
         $account->setFirstname($row["firstname"]);
         array_push($users, $account);
     }
     $this->dbClose();
     return $users;
 }
开发者ID:xcgpseud,项目名称:chat,代码行数:20,代码来源:MySqlDatabase.php


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