summaryrefslogtreecommitdiff
path: root/installer/installer.php
diff options
context:
space:
mode:
authorshadlaws <shad@shadlaws.com>2013-02-26 13:36:31 +0100
committershadlaws <shad@shadlaws.com>2013-02-26 13:36:31 +0100
commitd012cddf78d3055c8c49af7a7287117940f2c034 (patch)
tree08e6a1d1714f33e78d0f6d466cfcb27ee765ed71 /installer/installer.php
parent1d2610d613576f9bce7b21bc12852da4bd77ae46 (diff)
#2020 - Add CLI install argument to set admin password.
This isn't too useful for end users, but would be really useful for developers that install Gallery3 over and over again...
Diffstat (limited to 'installer/installer.php')
-rw-r--r--installer/installer.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/installer/installer.php b/installer/installer.php
index 4ce80ee7..434d8e53 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -138,7 +138,9 @@ class installer {
$char += ($char > 90) ? 13 : ($char > 57) ? 7 : 0;
$salt .= chr($char);
}
- $password = substr(md5(time() . mt_rand()), 0, 6);
+ if (!$password = $config["g3_password"]) {
+ $password = substr(md5(time() . mt_rand()), 0, 6);
+ }
// Escape backslash in preparation for our UPDATE statement.
$hashed_password = str_replace("\\", "\\\\", $salt . md5($salt . $password));
$sql = self::prepend_prefix($config["prefix"],