<?php

include ("config.php");

$highlight_menu = 7;

_post("edit", "pass", "passconf");

if ($edit && $pass && $passconf)
{
	if ($pass === $passconf)
	{
		if ($util->edit_password($_SESSION["Sid_user"], $pass))
		{
			header ("Location: suivi.php");
			exit;
		}	
	}
	else
		$error = 4;
}

include ("header.php");

echo "<div id=\"edit-pass\">\n";

if (!empty($error))
{
	if (is_int($error)) 
		echo "<p class=\"center error\">" . $error_list[$error] . "</p>\n";
	else
		echo "<p class=\"center error\">" . $error . "</p>\n";
}

echo "<form action=\"password.php\" method=\"post\">\n";
echo "<table>\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"3\">Changer de mot de passe</th>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\">Mot de passe</td>\n";
echo "<td><input class=\"int\" type=\"password\" name=\"pass\" value=\"\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\">V&eacute;rification mot de passe</td>\n";
echo "<td><input class=\"int\" type=\"password\" name=\"passconf\" value=\"\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td colspan=\"2\" class=\"center\"><input class=\"inb\" type=\"submit\" name=\"edit\" value=\"Enregistrer\" /></td>\n";
echo "</tr>\n";

echo "</table>\n";
echo "</form>\n";
echo "</div>\n";

include ("footer.php");

?>