From b0180288e049b472f3fefbfb28d7bed77e718b37 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 16 Feb 2013 08:23:36 +0100 Subject: #1749, 1754, 1901 - revert two recent commits that check for Zend Guard obfuscation level support. This is not the root of the problem for all installs, and can trigger false positives that break previously-working installs... we'll have to find a better way. --- index.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index c39452ea..5f6d231b 100644 --- a/index.php +++ b/index.php @@ -29,13 +29,6 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { exit("Gallery is not supported on Windows (PHP reports that you're using: " . PHP_OS . ")"); } -// Gallery doesn't use Zend Guard code obfuscation, and Kohana 2.4 will not work if level is 3+. -if (function_exists("zend_current_obfuscation_level") && (zend_current_obfuscation_level() >= 3)) { - exit("Gallery doesn't use Zend Guard code obfuscation, and is incompatible if it's running " . - "with a level of 3 or higher. For Gallery to run, please edit your main php.ini file and " . - "change/add the following line: 'zend_loader.obfuscation_level_support = 2'"); -} - // PHP 5.4 requires a timezone - if one isn't set date functions aren't going to work properly. // We'll log this once the logging system is initialized (in the gallery_event::gallery_ready). if (!ini_get("date.timezone")) { -- cgit v1.2.3 From d012cddf78d3055c8c49af7a7287117940f2c034 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 26 Feb 2013 13:36:31 +0100 Subject: #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... --- index.php | 2 +- installer/cli.php | 4 ++++ installer/installer.php | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 5f6d231b..e6636cf1 100644 --- a/index.php +++ b/index.php @@ -93,7 +93,7 @@ if (PHP_SAPI == "cli") { default: print "To install:\n"; - print " php index.php install -d database -h host -u user -p password -x table_prefix \n\n"; + print " php index.php install -d database -h host -u user -p password -x table_prefix -g3p gallery3_admin_password \n\n"; print "To upgrade:\n"; print " php index.php upgrade\n\n"; print "Developer-only features:\n"; 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/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"], -- cgit v1.2.3