Location: PHPKode > projects > OpenVet > openvet/action/edituser.php
<?php

	$ch_uid = $_POST["useruid"];

	if ($user->getRechte() >= 3 || $user->getID() == $ch_uid)
	{

		$thisuser = new User();
		$thisuser->readfromdb ($ch_uid);

	} else {
		
		header("Location: index.php?tab=home&page=notauthorized");
		exit ();

	}

	$ch_username = $_POST["username"];
	$ch_typ = $_POST["typ"];
	$ch_rechte = $_POST["rechte"];
	$ch_pwd_old = $_POST["md5_old"];
	$ch_pwd_new = $_POST["md5"];
	$ch_pwd_con = $_POST["md5_confirm"];
	$ch_vorname = $_POST["vorname"];
	$ch_nachname = $_POST["nachname"];
	$ch_addresse = $_POST["addresse"];
	$ch_telefonnummer = $_POST["telefonnummer"];
	$ch_mobilnummer = $_POST["mobilnummer"];
	$ch_email = $_POST["email"];
	$ch_theme = $_POST["theme"];

	if ($user->getRechte() >= 3) {

		$thisuser->setUsername ($ch_username);
		$thisuser->setTyp ($ch_typ);
		$thisuser->setRechte ($ch_rechte);

	}

	$thisuser->setVorname ($ch_vorname);
	$thisuser->setNachname ($ch_nachname);
	$thisuser->setAddresse ($ch_addresse);
	$thisuser->setTelefonnummer ($ch_telefonnummer);
	$thisuser->setMobilnummer ($ch_mobilnummer);
	$thisuser->setEmail ($ch_email);
	$thisuser->setTheme ($ch_theme);

	if ($thisuser->getPasswort () == $ch_pwd_old)
		if ($ch_pwd_new == $ch_pwd_con)
			$thisuser->setPasswort ($ch_pwd_new);

	if (!$thisuser->writetodb () || !$thisuser->validateData())
		$message = $thisuser->getError();
	else
		$message = _("The user account was changed.");

?>
Return current item: OpenVet