blob: fb2bff62bddc6c49d4693e2723305ec1048acc73 [file] [log] [blame]
Marc Kupietzd871d882023-03-05 18:34:16 +01001<?php
2require_once 'vendor/autoload.php';
3
4class User
5{
6 public $user_name;
7 public $name;
8 public $first_name;
9 public $last_name;
10 public $email;
11 public $organization;
12 public $user_hash;
13 public $password;
14
15 function __construct(string $user_name, string $first_name, string $last_name, string $email, string $password, string $organization)
16 {
17 include 'config.php';
18 $this->user_name = $user_name;
19 $this->name = $first_name;
20 $this->first_name = $first_name;
21 $this->last_name = $last_name;
22 $this->email = $email;
23 $this->organization = $organization;
24 if ($ENCRYPT_PASSWORDS) {
25 $this->user_hash = "{crypt}" . crypt($password, '$6$' . generateSalt(10) . '$');
26 # $this->user_hash = "{SHA}" . base64_encode(sha1($password, true));
27 } else {
28 $this->user_hash = "{CLEAR}" . $password;
29 }
30 $this->password = $this->user_hash;
31
32 }
33}
34
35?>