Commit ba1fbd54 authored by Waterfox's avatar Waterfox
Browse files

Add user password checking

parent 2b5b8fa4
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -17,6 +17,23 @@ class User extends Model

    protected $primaryKey = 'US_ID';

    /**
     * Check if a given password matches the stored password.
     *
     * @param string $password the password to try
     * @return bool true if the password matches, false otherwise
     */
    public function checkPassword($password)
    {
        if($password == $this->US_PASSWORD)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}

?>
+6 −1
Original line number Diff line number Diff line
@@ -7,6 +7,11 @@
    <title>Document</title>
</head>
<body>
    {{$user->US_NAME}}
    @if ($user->checkPassword('securepassword'))
        <p>Match</p>
    @else
        <p>Unmatch</p>
    @endif

</body>
</html>