From 82ccbba12401cefd9398f70fb2ad763025fa3919 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 17 Feb 2009 07:03:40 +0000 Subject: Move private key generation into the installer so that we're not generating it lazily. --- installer/installer.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'installer/installer.php') diff --git a/installer/installer.php b/installer/installer.php index 62523308..32511541 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -94,4 +94,12 @@ class installer { return array("admin", $password); } + + static function create_private_key() { + $key = md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true)); + if (mysql_query("INSERT INTO `vars` VALUES(NULL, 'core', 'private_key', '$key')")) { + } else { + throw new Exception(mysql_error()); + } + } } \ No newline at end of file -- cgit v1.2.3