Create our own passwords for conference registrations
Change-Id: I35b1ad4e48b13680fefe8154815d6500dbe097a3
diff --git a/User.php b/User.php
index 91cfa21..2341eb0 100644
--- a/User.php
+++ b/User.php
@@ -1,5 +1,6 @@
<?php
require_once 'vendor/autoload.php';
+include_once 'util.php';
class User
{
@@ -93,13 +94,18 @@
function set_password(string $password)
{
include 'config.php';
- if ($ENCRYPT_PASSWORDS) {
- $this->user_hash = "{crypt}" . crypt($password, '$6$' . generateSalt(10) . '$');
+ if ($CONFERENCE_REGISTRATION) {
+ $this->password = generateRandomString(32);
# $this->user_hash = "{SHA}" . base64_encode(sha1($password, true));
} else {
- $this->user_hash = "{CLEAR}" . $password;
+ 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;
}
- $this->password = $this->user_hash;
}
function to_string()