summaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
Diffstat (limited to 'installer')
-rw-r--r--installer/cli.php4
-rw-r--r--installer/install.sql2
-rw-r--r--installer/installer.php4
3 files changed, 8 insertions, 2 deletions
diff --git a/installer/cli.php b/installer/cli.php
index f5a9e260..b31405f1 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -90,6 +90,7 @@ function parse_cli_params() {
"password" => "",
"dbname" => "gallery3",
"prefix" => "",
+ "g3_password" => "",
"type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
$argv = $_SERVER["argv"];
@@ -110,6 +111,9 @@ function parse_cli_params() {
case "-x":
$config["prefix"] = $argv[++$i];
break;
+ case "-g3p":
+ $config["g3_password"] = $argv[++$i];
+ break;
}
}
diff --git a/installer/install.sql b/installer/install.sql
index b89d6b9b..3f63cf7c 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -245,7 +245,7 @@ CREATE TABLE {modules} (
KEY `weight` (`weight`)
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO {modules} VALUES (1,1,'gallery',56,1);
+INSERT INTO {modules} VALUES (1,1,'gallery',58,1);
INSERT INTO {modules} VALUES (2,1,'user',4,2);
INSERT INTO {modules} VALUES (3,1,'comment',7,3);
INSERT INTO {modules} VALUES (4,1,'organize',4,4);
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"],