blob: fb2bff62bddc6c49d4693e2723305ec1048acc73 [file] [log] [blame]
<?php
require_once 'vendor/autoload.php';
class User
{
public $user_name;
public $name;
public $first_name;
public $last_name;
public $email;
public $organization;
public $user_hash;
public $password;
function __construct(string $user_name, string $first_name, string $last_name, string $email, string $password, string $organization)
{
include 'config.php';
$this->user_name = $user_name;
$this->name = $first_name;
$this->first_name = $first_name;
$this->last_name = $last_name;
$this->email = $email;
$this->organization = $organization;
if ($ENCRYPT_PASSWORDS) {
$this->user_hash = "{crypt}" . crypt($password, '$6$' . generateSalt(10) . '$');
# $this->user_hash = "{SHA}" . base64_encode(sha1($password, true));
} else {
$this->user_hash = "{CLEAR}" . $password;
}
$this->password = $this->user_hash;
}
}
?>