Skip to content
Permalink
Browse files

Do not use md5 for default password scheme for Demonstratr testing ac…

…counts
  • Loading branch information...
chrisgraham committed Jun 18, 2019
1 parent e64f953 commit 13f81b0531347f277cc78a4fd9c4fb79ef802061
Showing with 4 additions and 4 deletions.
  1. +4 −4 sources_custom/composr_homesite.php
@@ -414,11 +414,11 @@ function demonstratr_add_site_raw($server, $codename, $email_address, $password)
// Set some default config
$db_conn = new DatabaseConnector('demonstratr_site_' . $codename, 'localhost'/*$server*/, $user, $SITE_INFO['mysql_demonstratr_password'], 'cms_');
$db_conn->query_update('config', array('c_value' => $email_address), array('c_name' => 'staff_address'), '', 1);
$pass = md5($password);
$salt = '';
$compat = 'md5';
require_code('crypt');
$salt = produce_salt();
$password_salted = ratchet_hash($password, $salt);
$GLOBALS['NO_DB_SCOPE_CHECK'] = true;
$db_conn->query_update('f_members', array('m_email_address' => $email_address, 'm_pass_hash_salted' => $pass, 'm_pass_salt' => $salt, 'm_password_compat_scheme' => $compat), array('m_username' => 'admin'), '', 1);
$db_conn->query_update('f_members', array('m_email_address' => $email_address, 'm_pass_hash_salted' => $password_salted, 'm_pass_salt' => $salt, 'm_password_compat_scheme' => ''), array('m_username' => 'admin'), '', 1);
$GLOBALS['NO_DB_SCOPE_CHECK'] = false;
// Create default file structure

0 comments on commit 13f81b0

Please sign in to comment.
You can’t perform that action at this time.