inc/users.inc.php
changeset 67 2f8c29fc5e2e
parent 65 ce1c4d5e1576
child 71 e1b918eaf69a
equal deleted inserted replaced
66:9e9876afefcc 67:2f8c29fc5e2e
   212 	{
   212 	{
   213 		if (!is_valid_email($email)) 
   213 		if (!is_valid_email($email)) 
   214 		{
   214 		{
   215 			error(ERR_INV_EMAIL);
   215 			error(ERR_INV_EMAIL);
   216 		}
   216 		}
   217 
   217 		if ($active != 1) {
       
   218 			$active = 0;
       
   219 		}
   218 		$db->query("INSERT INTO users (username, password, fullname, email, description, level, active) VALUES (".$db->quote($user).", '" . md5($password) . "', ".$db->quote($fullname).", ".$db->quote($email).", ".$db->quote($description).", ".$db->quote($level).", ".$db->quote($active).")");
   220 		$db->query("INSERT INTO users (username, password, fullname, email, description, level, active) VALUES (".$db->quote($user).", '" . md5($password) . "', ".$db->quote($fullname).", ".$db->quote($email).", ".$db->quote($description).", ".$db->quote($level).", ".$db->quote($active).")");
   219 		return true;
   221 		return true;
   220 	}
   222 	}
   221 	else
   223 	else
   222 	{
   224 	{
   238 
   240 
   239 	if (!is_valid_email($email)) 
   241 	if (!is_valid_email($email)) 
   240 	{
   242 	{
   241 		error(ERR_INV_EMAIL);
   243 		error(ERR_INV_EMAIL);
   242 	}
   244 	}
   243 
   245 	if ($active != 1) {
       
   246 		$active = 0;
       
   247 	}
   244 	$sqlquery = "UPDATE users set username=".$db->quote($user).", fullname=".$db->quote($fullname).", email=".$db->quote($email).", level=".$db->quote($level).", description=".$db->quote($description).", active=".$db->quote($active);
   248 	$sqlquery = "UPDATE users set username=".$db->quote($user).", fullname=".$db->quote($fullname).", email=".$db->quote($email).", level=".$db->quote($level).", description=".$db->quote($description).", active=".$db->quote($active);
   245 
   249 
   246 	if($password != "")
   250 	if($password != "")
   247 	{
   251 	{
   248 		$sqlquery .= ", password= '" . md5($password) . "' ";
   252 		$sqlquery .= ", password= '" . md5($password) . "' ";