diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-17 07:03:40 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-17 07:03:40 +0000 |
commit | 82ccbba12401cefd9398f70fb2ad763025fa3919 (patch) | |
tree | f8a5aced7474c90ea4e74f2b07b873ffad493f47 /installer/installer.php | |
parent | ae06ad3a414c9d112e5aae92118ad9d134c00056 (diff) |
Move private key generation into the installer so that we're not
generating it lazily.
Diffstat (limited to 'installer/installer.php')
-rw-r--r-- | installer/installer.php | 8 |
1 files changed, 8 insertions, 0 deletions
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 |