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


PHP UserDB::get方法代码示例

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


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

示例1: CheckLogin

 public static function CheckLogin()
 {
     $Username = isset($_SESSION["Username"]) ? $_SESSION["Username"] : "";
     $Password = isset($_SESSION["Password"]) ? $_SESSION["Password"] : "";
     if ($Username == "") {
         return false;
     }
     if ($Password == "") {
         return false;
     }
     $UserRecord = UserDB::get($Username);
     echo "UserDBInterface:CheckLogin() -----> UserRecord : ";
     //var_dump($UserRecord);
     /*echo "----CheckLogin----";
       echo "Username:".$Username;
       echo "Password:".$Password;
       echo "<br/>----->";
       echo ($UserRecord["Username"]==$Username ) && ($UserRecord["Password"]=="111");
       echo "-----><br/>";*/
     //var_dump($UserRecord);
     //  echo "----CheckLogin-----";
     //  echo (($UserRecord["Username"]==$Username ) && ($UserRecord["Password"]=="aaa"));
     //  echo "--------------------";
     //return true;
     if ($UserRecord["Username"] === $Username && $UserRecord["Password"] === $Password) {
         echo "----CheckLogin Succcess----";
         echo "Username:" . $Username . "=!=" . $UserRecord["Username"] . "<br/>";
         //echo "Password:".$Password."=!=".$UserRecord["Password"]."<br/>";
         echo "Password: ****** =!= ****** <br/>";
         //echo "<br/>----->";
         //echo ($UserRecord["Username"]==$Username ) && ($UserRecord["Password"]=="111");
         echo "-----><br/>";
         return true;
     } else {
         echo "Login failed.";
         echo "Username:" . $Username . "<br/>";
         //echo "Password:".$Password."<br/>";
         echo "Password: ****** <br/>";
         return false;
     }
 }
开发者ID:Zekom,项目名称:Emisije-Subversion,代码行数:41,代码来源:UserDBInterface.php

示例2: alert

        .done(function( msg ) {
            alert(msg);
          
            setTimeout(location.reload(),10000);
          
        
          
        });
    }
</script>
<?php 
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once './model/UserDBInterface.php';
if (UserDBInterface::CheckLogin()) {
    $Username = isset($_SESSION["Username"]) ? $_SESSION["Username"] : "Zekom";
    $UserData = UserDB::get($Username);
    //    var_dump($UserData);
    echo "<hr/>";
    echo "Uporabnik : <b>" . $UserData["Username"] . "</b><br/>";
    echo "<hr/>";
    echo "Ime : <b>" . $UserData["FirstName"] . "</b><br/>";
    echo "Priimek : <b>" . $UserData["LastName"] . "</b><br/>";
    echo "<hr/>";
    echo "<p align=\"center\"><button onclick=\"onLogoutClick();\">Odjava</button></p>";
} else {
    echo "<a href> Prijava v aplikacijo </a>";
}
开发者ID:Zekom,项目名称:Emisije-Subversion,代码行数:31,代码来源:ViewToolbarUser.php

示例3: PDO

    $username = $app->request->get('username');
    $invitationCode = $app->request->get('code');
    if (isset($username) && isset($invitationCode)) {
        $DBH = new PDO(PDO_DSN, MYSQL_USER, MYSQL_PASS);
        $data = array("code" => $invitationCode);
        $sth = $DBH->prepare("SELECT code FROM invitation_codes WHERE code = :code");
        $sth->execute($data);
        if (!empty($sth->fetch())) {
            $sth = $DBH->prepare("DELETE FROM invitation_codes WHERE code = :code");
            $sth->execute($data);
        } else {
            echo "This is not a valid registration link!";
            return;
        }
        $userDB = new UserDB();
        if (empty($userDB->get($username))) {
            echo "This is not a valid registration link!";
            return;
        } else {
            $user = new User($username);
            $user->registered = true;
            $user->update();
            $_SESSION['AUTHED'] = true;
            $_SESSION['username'] = $username;
            $_SESSION['validTorrents'] = array();
            $app->redirect("/");
        }
    } else {
        echo "This is not a valid registration link!";
    }
});
开发者ID:jakop345,项目名称:torrentcloud,代码行数:31,代码来源:index.php


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