<?php
require "inc/init.php";
require "inc/small_functions.php";
$post_vars = array(
'name','username','password','password2','email','cancel');
include "import_vars_post.inc";
#$get_vars = array('task_id','note_id');
#include "import_vars_get.inc";
if ($cancel) {
header ("Location: home.php");
exit;
}
// validate data
$name = AddSlashes(StripSlashes($name));
$username = AddSlashes(StripSlashes($username));
$password = AddSlashes(StripSlashes($password));
$password2 = AddSlashes(StripSlashes($password2));
// Silly hacking attempt
if (!$user_id) Header ("Location: index.php");
// verify if passwords match
if ("$password" != "$password2") $error = $strThepasswordsdontmatch;
// verify if username doesnt exist
if(UserExist($username,$user_id))
$error = $strThatusernameisalreadybeingused;
// if we get parameters (without any error messages)
// save them and head to home.php
if ($name && $username && !$error)
{
SaveUser($username,$password,$name,$email,$user_id);
Header ("Location: home.php");
} else {
if (!$name && !$username && !$password && !$email) {
GetUserInfo($user_id, $name, $d, $d, $username, $password, $email);
}
?>
<html>
<head>
<title><? echo $strEditaccount;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<? if ($charset) print $charset; else print "ISO-8859-1"; ?>">
<link href="css/pman.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor=<? print $bgcolorEditAccount; ?>>
<table width=100% height=100%>
<tr>
<td width=30% valign=middle align=center>
<form method=post>
<?
if ($error) $error = "\n<p align=center><font color=#FF0000>$error</font></p>\n";
$content = "
<br><div align=center>$error
$strRealname: <input type=text name=name value=\"$name\" size=25><br>
$strUsername: <input type=text name=username value=\"$username\" size=16><br>
$strPassword: <input type=password name=password value=\"$password\" size=16><br>
$strConfirmpassword: <input type=password name=password2 size=16><br><br>
$strEmail: <input type=text name=email value=\"$email\" size=30><br><br>
<input type=submit value=\"$strSave\">
<input type=submit name=cancel value=\"$strCancel\"><br>
</div>\n";
$title = $strEditaccount;
$color = $boxcolorEditAccount;
$plus = "width=45%";
include "templates/box.php";
?>
<form>
</td>
</tr>
</table>
</body>
</html>
<?
}
?>