[Mapbender-commits] r9368 - trunk/mapbender/http/geoportal

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 15 04:36:47 PST 2016


Author: armin11
Date: 2016-01-15 04:36:47 -0800 (Fri, 15 Jan 2016)
New Revision: 9368

Modified:
   trunk/mapbender/http/geoportal/authentication.php
   trunk/mapbender/http/geoportal/insertUserDataIntoDb.php
   trunk/mapbender/http/geoportal/updateUserDataIntoDb.php
Log:
Possibility to check http_digest_auth also for username without email, only possible with unambigious usernames!!

Modified: trunk/mapbender/http/geoportal/authentication.php
===================================================================
--- trunk/mapbender/http/geoportal/authentication.php	2016-01-14 13:04:20 UTC (rev 9367)
+++ trunk/mapbender/http/geoportal/authentication.php	2016-01-15 12:36:47 UTC (rev 9368)
@@ -73,6 +73,12 @@
 
  if($row = db_fetch_array($res)){
    	$e = new mb_exception('geoportal/authentication.php: user login: '.$row['mb_user_name']);
+	//update mb_user_aldigest
+	$sql = "UPDATE mb_user SET mb_user_aldigest = $1 WHERE mb_user_id = $2";
+	//$sql = "SELECT * FROM mb_user WHERE mb_user_name = $1 AND mb_user_password = $2";
+        $v = array(md5($row['mb_user_name'].":".REALM.":".$pw),$row['mb_user_id']);
+        $t = array('s','i');
+        $res = db_prep_query($sql,$v,$t);
   	return $row;	
  }
   else 

Modified: trunk/mapbender/http/geoportal/insertUserDataIntoDb.php
===================================================================
--- trunk/mapbender/http/geoportal/insertUserDataIntoDb.php	2016-01-14 13:04:20 UTC (rev 9367)
+++ trunk/mapbender/http/geoportal/insertUserDataIntoDb.php	2016-01-15 12:36:47 UTC (rev 9368)
@@ -63,9 +63,9 @@
 			$emailValid = 1;	
 			//INSERT
 			if(!isset($mb_user_postal_code) || $mb_user_postal_code == ''){ $mb_user_postal_code = 0;}
-			$sql = "INSERT INTO mb_user (mb_user_name,mb_user_password,mb_user_digest,mb_user_owner,mb_user_description,mb_user_email,mb_user_phone,mb_user_department,mb_user_organisation_name,mb_user_position_name,mb_user_city,mb_user_postal_code, mb_user_textsize, mb_user_glossar, mb_user_allow_survey) VALUES ($1, $2, $13, $15 , $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $14)";
-			$v = array($mb_user_name, md5($mb_user_password), $mb_user_description, $mb_user_email, $mb_user_phone, $mb_user_department, $mb_user_organisation_name, $mb_user_position_name, $mb_user_city, $mb_user_postal_code, 'textsize1' ,'ja',md5($mb_user_name.";".$mb_user_email.":".REALM.":".$mb_user_password), 't',$mb_user_owner);
-			$t = array('s', 's', 's', 's', 's', 's', 's', 's', 's', 'i', 's', 's', 's', 'b','i');
+			$sql = "INSERT INTO mb_user (mb_user_name,mb_user_password,mb_user_digest,mb_user_owner,mb_user_description,mb_user_email,mb_user_phone,mb_user_department,mb_user_organisation_name,mb_user_position_name,mb_user_city,mb_user_postal_code, mb_user_textsize, mb_user_glossar, mb_user_allow_survey,mb_user_aldigest) VALUES ($1, $2, $13, $15, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $14, $16)";
+			$v = array($mb_user_name, md5($mb_user_password), $mb_user_description, $mb_user_email, $mb_user_phone, $mb_user_department, $mb_user_organisation_name, $mb_user_position_name, $mb_user_city, $mb_user_postal_code, 'textsize1' ,'ja',md5($mb_user_name.";".$mb_user_email.":".REALM.":".$mb_user_password), 't',$mb_user_owner,md5($mb_user_name.":".REALM.":".$mb_user_password));
+			$t = array('s', 's', 's', 's', 's', 's', 's', 's', 's', 'i', 's', 's', 's', 'b','i','s');
 			$res = db_prep_query($sql, $v, $t);
 			$group_id = 37;
 			$sql = "INSERT INTO mb_user_mb_group (fkey_mb_user_id, fkey_mb_group_id) VALUES ($1, $2)";

Modified: trunk/mapbender/http/geoportal/updateUserDataIntoDb.php
===================================================================
--- trunk/mapbender/http/geoportal/updateUserDataIntoDb.php	2016-01-14 13:04:20 UTC (rev 9367)
+++ trunk/mapbender/http/geoportal/updateUserDataIntoDb.php	2016-01-15 12:36:47 UTC (rev 9368)
@@ -71,6 +71,7 @@
 	if ($mb_user_allow_survey == "ja") {$mb_user_allow_survey = "t";} else {$mb_user_allow_survey = "f";}
         $fields[] = array('mb_user_newsletter', $mb_user_newsletter, 'b');
 	$fields[] = array('mb_user_allow_survey', $mb_user_allow_survey, 'b');
+	$fields[] = array('mb_user_aldigest', md5($mb_user_name.":".REALM.":".$mb_user_password), 's');
 	
         // build sql statement
         foreach ($fields as $idx => $field) {



More information about the Mapbender_commits mailing list