summaryrefslogtreecommitdiffstats
path: root/lib/setup.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-06-08 12:31:37 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-06-08 12:31:37 +0200
commit6119f05ac015b71d94318bf759b4fcaefe4650af (patch)
treed4289faaa92a83da055dfdc24e4ba2737d62263f /lib/setup.php
parent4d3b7574f3dcab1c79c27e93122dcc7d1ac103b2 (diff)
downloadnextcloud-server-6119f05ac015b71d94318bf759b4fcaefe4650af.tar.gz
nextcloud-server-6119f05ac015b71d94318bf759b4fcaefe4650af.zip
generate a random salt during installation and store it in the config.php. use it to salt the password hashing.
Diffstat (limited to 'lib/setup.php')
-rw-r--r--lib/setup.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/setup.php b/lib/setup.php
index a096fdbb4cf..5f1fb1525ec 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -73,6 +73,10 @@ class OC_Setup {
$dbtype='sqlite3';
}
+ //generate a random salt that is used to salt the local user passwords
+ $salt=mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000);
+ OC_Config::setValue('passwordsalt', $salt);
+
//write the config file
OC_Config::setValue('datadirectory', $datadir);
OC_Config::setValue('dbtype', $dbtype);