Browse Source

Keeping the original password to send it by mail without crypt when register a new user.

vbracco 17 years ago
parent
commit
30f76eecd6
2 changed files with 5 additions and 6 deletions
  1. 1 5
      admin/user.php
  2. 4 1
      classes/user.class.php

+ 1 - 5
admin/user.php View File

35
 		}
35
 		}
36
 		if (isset($_POST["btnVerifyUser"])) {
36
 		if (isset($_POST["btnVerifyUser"])) {
37
 			unset($_POST["btnVerifyUser"]);
37
 			unset($_POST["btnVerifyUser"]);
38
-		}
39
-		if (isset($_POST["password"])) {
40
-			$_POST["password"] = md5($_POST["password"]);
41
-		}
42
-		
38
+		}		
43
 		if (isset($_POST["id_user"])) {
39
 		if (isset($_POST["id_user"])) {
44
 			$user->modifyUser($_POST, $_POST["id_user"]);
40
 			$user->modifyUser($_POST, $_POST["id_user"]);
45
 		} else {			
41
 		} else {			

+ 4 - 1
classes/user.class.php View File

87
 	function addUser($fieldsArray) {
87
 	function addUser($fieldsArray) {
88
 		if ($this->ejecutarConsulta("SELECT id_user FROM ".$this->conf->tablePrefix."users WHERE login='".$fieldsArray['login']."'")) {
88
 		if ($this->ejecutarConsulta("SELECT id_user FROM ".$this->conf->tablePrefix."users WHERE login='".$fieldsArray['login']."'")) {
89
 			if ($this->contarRegistros()==0) {
89
 			if ($this->contarRegistros()==0) {
90
+				$realPassword = ($fieldsArray["password"]);
91
+				$fieldsArray["password"] = md5($fieldsArray["password"]);
90
 				if ($this->insertarDeFormulario($this->conf->tablePrefix."users", $fieldsArray)) {
92
 				if ($this->insertarDeFormulario($this->conf->tablePrefix."users", $fieldsArray)) {
91
-					$this->confirmationEmail($fieldsArray['email'], $fieldsArray['login'], $fieldsArray['password']);
93
+					$this->confirmationEmail($fieldsArray['email'], $fieldsArray['login'], $realPassword);
92
 					header("Location: ".$this->conf->urlGelato."/admin/admin.php?added=true");
94
 					header("Location: ".$this->conf->urlGelato."/admin/admin.php?added=true");
93
 					die();
95
 					die();
94
 				} else {
96
 				} else {
103
 	}
105
 	}
104
 
106
 
105
 	function modifyUser($fieldsArray, $id_user) {
107
 	function modifyUser($fieldsArray, $id_user) {
108
+		$fieldsArray["password"] = md5($fieldsArray["password"]);
106
 		if ($this->modificarDeFormulario($this->conf->tablePrefix."users", $fieldsArray, "id_user=$id_user")) {
109
 		if ($this->modificarDeFormulario($this->conf->tablePrefix."users", $fieldsArray, "id_user=$id_user")) {
107
 			header("Location: ".$this->conf->urlGelato."/admin/admin.php?modified=true");
110
 			header("Location: ".$this->conf->urlGelato."/admin/admin.php?modified=true");
108
 			die();
111
 			die();