user_name -> username
Change-Id: I2cb601f7e0eeb36a27e9dad662f3554a0092ab18
diff --git a/User.php b/User.php
index fb2bff6..ea144b7 100644
--- a/User.php
+++ b/User.php
@@ -3,7 +3,7 @@
class User
{
- public $user_name;
+ public $username;
public $name;
public $first_name;
public $last_name;
@@ -11,16 +11,34 @@
public $organization;
public $user_hash;
public $password;
+ function __construct()
+ {
+ $this->username = "";
+ $this->name = "";
+ $this->first_name = "";
+ $this->last_name = "";
+ $this->email = "";
+ $this->organization = "";
+ $this->user_hash = "";
+ $this->password = "";
+ }
- function __construct(string $user_name, string $first_name, string $last_name, string $email, string $password, string $organization)
+ function __construct6(string $username, string $first_name, string $last_name, string $email, string $password, string $organization)
{
include 'config.php';
- $this->user_name = $user_name;
+ $this->username = $username;
$this->name = $first_name;
$this->first_name = $first_name;
$this->last_name = $last_name;
$this->email = $email;
$this->organization = $organization;
+ $this->set_password($password);
+
+ }
+
+ function set_password(string $password)
+ {
+ include 'config.php';
if ($ENCRYPT_PASSWORDS) {
$this->user_hash = "{crypt}" . crypt($password, '$6$' . generateSalt(10) . '$');
# $this->user_hash = "{SHA}" . base64_encode(sha1($password, true));
@@ -28,7 +46,6 @@
$this->user_hash = "{CLEAR}" . $password;
}
$this->password = $this->user_hash;
-
}
}