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

master
vbracco 2007-09-22 14:50:58 +00:00
parent fbaf07c025
commit 30f76eecd6
2 changed files with 5 additions and 6 deletions

View File

@ -36,10 +36,6 @@ if ($user->isAdmin()) {
if (isset($_POST["btnVerifyUser"])) {
unset($_POST["btnVerifyUser"]);
}
if (isset($_POST["password"])) {
$_POST["password"] = md5($_POST["password"]);
}
if (isset($_POST["id_user"])) {
$user->modifyUser($_POST, $_POST["id_user"]);
} else {

View File

@ -87,8 +87,10 @@ class user extends Conexion_Mysql {
function addUser($fieldsArray) {
if ($this->ejecutarConsulta("SELECT id_user FROM ".$this->conf->tablePrefix."users WHERE login='".$fieldsArray['login']."'")) {
if ($this->contarRegistros()==0) {
$realPassword = ($fieldsArray["password"]);
$fieldsArray["password"] = md5($fieldsArray["password"]);
if ($this->insertarDeFormulario($this->conf->tablePrefix."users", $fieldsArray)) {
$this->confirmationEmail($fieldsArray['email'], $fieldsArray['login'], $fieldsArray['password']);
$this->confirmationEmail($fieldsArray['email'], $fieldsArray['login'], $realPassword);
header("Location: ".$this->conf->urlGelato."/admin/admin.php?added=true");
die();
} else {
@ -103,6 +105,7 @@ class user extends Conexion_Mysql {
}
function modifyUser($fieldsArray, $id_user) {
$fieldsArray["password"] = md5($fieldsArray["password"]);
if ($this->modificarDeFormulario($this->conf->tablePrefix."users", $fieldsArray, "id_user=$id_user")) {
header("Location: ".$this->conf->urlGelato."/admin/admin.php?modified=true");
die();