31 lines
586 B
PHP
Executable File
31 lines
586 B
PHP
Executable File
<?php
|
|
include_once('sql.php');
|
|
|
|
function authorize($username, $password_hash)
|
|
{
|
|
$pw_hash = get_account_login($username);
|
|
pretty_print($pw_hash);
|
|
|
|
if (!empty($pw_hash)) {
|
|
if ($password_hash == $pw_hash) {
|
|
$user = get_account_info($username);
|
|
pretty_print($user);
|
|
// $_SESSION['is_logged_in'] = true;
|
|
// $_SESSION['username'] = $username;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function pretty_print($input)
|
|
{
|
|
echo '
|
|
<pre>
|
|
' . print_r($input) . '
|
|
</pre>
|
|
';
|
|
}
|