/** * This method collects and stores an SHA512 Hash Authentication string * for database authentication. * * @param string $email The users email * @param string $password The users provided password * * @return bool */ protected function processPassword(string $email = null, string $password = null) : bool { $data = $this->dbh->getUserPassword($email)->getRecords(); if (1 !== $data['record_count']) { $this->dbh->insertiNetRecordLog($email, '-- Process Error: Email not found in database. Authentication::_processPassword();'); return false; } $salt = hash(static::DEFAULT_HASH, mb_strtoupper($data['uuid']), 'UTF-8'); $pass = hash(static::DEFAULT_HASH, $email . $this->getProperty('randomPasswordSeed') . $password); $passwdHash = hash(static::DEFAULT_HASH, $salt . $pass . $salt); $this->dbh->updateUserPassword($email, $passwdHash) ?: trigger_error(197, FATAL); return true; }