svn commit: r366 - trunk/mapbender/http/php/mod_createUser.php

uli at osgeo.org uli at osgeo.org
Wed May 31 02:14:49 EDT 2006


Author: uli
Date: 2006-05-31 06:14:48+0000
New Revision: 366

Modified:
   trunk/mapbender/http/php/mod_createUser.php

Log:
md5 string for passwords

Modified: trunk/mapbender/http/php/mod_createUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_createUser.php?view=diff&rev=366&p1=trunk/mapbender/http/php/mod_createUser.php&p2=trunk/mapbender/http/php/mod_createUser.php&r1=365&r2=366
==============================================================================
--- trunk/mapbender/http/php/mod_createUser.php	(original)
+++ trunk/mapbender/http/php/mod_createUser.php	2006-05-31 06:14:48+0000
@@ -20,6 +20,8 @@
 
 import_request_variables("PG");
 require_once("../../conf/mapbender.conf");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
 require_once("../classes/class_gui.php");
 require_once("../classes/class_administration.php");
 ?>
@@ -111,9 +113,6 @@
 <body>
 
 <?php
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-
 #save
 if($action == 'save'){
 	$owner_id =1;
@@ -131,20 +130,8 @@
 		$sql = "Insert INTO mb_user (mb_user_name, mb_user_password,mb_user_owner, ";
 		$sql .= "mb_user_description, mb_user_email, mb_user_phone, mb_user_department, ";
 		$sql .= "mb_user_resolution) VALUES ";
-		$sql.= "($1, ";		
-		if(SYS_DBTYPE == "mysql") {
-			$sql .= "password($2)";
-		}
-		else {
-			if (MD5 == 'false'){
-				$sql .= "$2'";
-			}
-			else{
-				$sql .= "md5($2)";
-			}
-		}
-		$sql.= ", $3, $4, $5, $6, $7, $8);";
-		$v = array($name,$password,$owner_id,$description,$email,$phone,$department,$resolution);
+		$sql.= "($1, $2, $3, $4, $5, $6, $7, $8)";
+		$v = array($name,md5($password),$owner_id,$description,$email,$phone,$department,$resolution);
 		$t = array('s','s','i','s','s','s','s','i');
 		$res = db_prep_query($sql);
 		




More information about the Mapbender_commits mailing list