Browse Source

Compatibility with older PHP versions.

Stefan Ostermann 8 years ago
parent
commit
30ea159061
4 changed files with 15 additions and 5 deletions
  1. 1 0
      Vagrantfile
  2. 2 0
      manifests/default.pp
  3. 6 3
      sites/html/htadmin/forgotten.php
  4. 6 2
      sites/html/test/.htaccess

+ 1 - 0
Vagrantfile

@@ -24,6 +24,7 @@ Vagrant.configure("2") do |config|
   forward_port[80, 80]  # nginx/apache
   
   
+  
   config.vm.provision :shell do |shell|
     shell.inline = "puppet module install --force puppetlabs-stdlib"
     shell.inline = "puppet module install --force puppetlabs-apache"

+ 2 - 0
manifests/default.pp

@@ -118,6 +118,8 @@ class mysql{
 include base
 include apache
 include php
+
+
 # We don't need mysql right now:
 # include mysql
 

+ 6 - 3
sites/html/htadmin/forgotten.php

@@ -27,7 +27,8 @@ $show_standardform = true;
 				$alert_message = "Email not found: " . htmlspecialchars ( $email );
 				include_once ('includes/inline_message.php');
 			} else {
-				$meta_model = $htpasswd->get_metadata () [$user];
+				$meta_models = $htpasswd->get_metadata ();
+				$meta_model = $meta_models [$user];
 				$link = $mailUrl . '?' . 'user=' . urldecode ( $user ) . '&' . 'key=' . urlencode ( $meta_model->mailkey );
 				send_forgotten_mail ( $email, $user, $link );
 				$alert_class = "alert-info";
@@ -39,7 +40,8 @@ $show_standardform = true;
 		if (isset ( $_GET ['user'] ) && isset ( $_GET ['key'] )) {
 			$user = $_GET ['user'];
 			$key = $_GET ['key'];
-			$meta_model = $htpasswd->get_metadata () [$user];
+			$meta_models = $htpasswd->get_metadata ();
+			$meta_model = $meta_models [$user];
 			if (isset ( $meta_model ) && $meta_model->mailkey === $key) {
 				$show_standardform = false;
 				?>
@@ -79,7 +81,8 @@ $show_standardform = true;
 			$user = $_POST ['user'];
 			$key = $_POST ['key'];
 			$pwd = $_POST ['pwd'];
-			$meta_model = $htpasswd->get_metadata () [$user];
+			$meta_models = $htpasswd->get_metadata ();
+			$meta_model = $meta_models[$user];
 			if (isset ( $meta_model ) && $meta_model->mailkey === $key) {
 				$htpasswd->user_update ( $user, $pwd );
 				$meta_model->mailkey = random_password ( 8 );

+ 6 - 2
sites/html/test/.htaccess

@@ -1,4 +1,8 @@
 AuthType Basic
 AuthName "Password Protected Area"
-AuthUserFile /var/www/html/test/.htpasswd
-Require valid-user
+AuthUserFile "/var/www/html/test/.htpasswd"
+Require valid-user
+<Files .ht*>
+  Order deny,allow
+  Deny from all
+</Files>