summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--installer/installer.php2
-rw-r--r--installer/web.php2
-rw-r--r--modules/gallery/libraries/IdentityProvider.php5
-rw-r--r--modules/gallery/libraries/drivers/IdentityProvider.php2
4 files changed, 8 insertions, 3 deletions
diff --git a/installer/installer.php b/installer/installer.php
index 57be6cc0..705f1725 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -77,7 +77,7 @@ class installer {
// counterparts.
if (!function_exists("mysql_query")) {
function mysql_connect($host, $user, $pass) {
- list ($host, $port) = explode(":", $host);
+ list ($host, $port) = explode(":", $host . ":");
installer::$mysqli = new mysqli($host, $user, $pass, $port);
// http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of
// $mysqli->connect_error because of bugs before PHP 5.2.9
diff --git a/installer/web.php b/installer/web.php
index 90143afb..0a3cdb6e 100644
--- a/installer/web.php
+++ b/installer/web.php
@@ -38,7 +38,7 @@ if (installer::already_installed()) {
"dbname" => $_POST["dbname"],
"prefix" => $_POST["prefix"],
"type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
- list ($config["host"], $config["port"]) = explode(":", $config["host"]);
+ list ($config["host"], $config["port"]) = explode(":", $config["host"] . ":");
if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");
diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php
index 3f1666eb..9fbc5e21 100644
--- a/modules/gallery/libraries/IdentityProvider.php
+++ b/modules/gallery/libraries/IdentityProvider.php
@@ -66,6 +66,11 @@ class IdentityProvider_Core {
}
static function change_provider($new_provider) {
+ if (!identity::active_user()->admin) {
+ // Below, the active user is set to the primary admin.
+ access::forbidden();
+ }
+
$current_provider = module::get_var("gallery", "identity_provider");
if (!empty($current_provider)) {
module::uninstall($current_provider);
diff --git a/modules/gallery/libraries/drivers/IdentityProvider.php b/modules/gallery/libraries/drivers/IdentityProvider.php
index b7b1fbe8..09cdd093 100644
--- a/modules/gallery/libraries/drivers/IdentityProvider.php
+++ b/modules/gallery/libraries/drivers/IdentityProvider.php
@@ -26,7 +26,7 @@ interface IdentityProvider_Driver {
public function guest();
/**
- * Return the admins user.
+ * Return the primary admin user.
*
* @return User_Definition the user object
*/