From 02628a2cbd8ce12d6916479a5192845202c317e1 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 7 Sep 2020 11:18:08 +0300 Subject: [PATCH] Random password for installation provider record. --- application/controllers/Installation.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php index 8e38b7aa..1a8b3130 100644 --- a/application/controllers/Installation.php +++ b/application/controllers/Installation.php @@ -140,6 +140,9 @@ class Installation extends CI_Controller { ]; $services['id'] = $this->services_model->add($services); + $salt = generate_salt(); + $password = generate_random_string(100); + $sample_provider = [ 'first_name' => 'John', 'last_name' => 'Doe', @@ -150,8 +153,8 @@ class Installation extends CI_Controller { ], 'settings' => [ 'username' => 'johndoe', - 'password' => '59fe9d073a9c3c606a7e01e402dca4b49b6aa517bd0fdf940c46cb13a7b63dd0', - 'salt' => 'dc5570debc71fc1fe94b1b0aee444fcde5b8cb83d62a6a2b736ead6557d7a2e1', + 'password' => hash_password($salt, $password), + 'salt' => $salt, 'working_plan' => '{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"saturday":null,"sunday":null}', 'notifications' => FALSE, 'google_sync' => FALSE,