<?php
if(isset($_POST['PSA_submit'])){
$id=$_POST['PSA_id'];
$result=$PSA_SYS->profile_edit($_POST);
if($result===FALSE)
$PSA_SYS->error();
echo '<p>',_("User profile updated successfully."),'</p>',"\n";
}
if(isset($_GET['PSA_id']))
$id=$_GET['PSA_id'];
$profile=$PSA_SYS->profile_get($id);
if($profile===FALSE)
$PSA_SYS->error();
?>
<h2><?php echo _("Edit Profile") ?></h2>
<p><a href="<?php echo $_SERVER['PHP_SELF'] ?>?psaSec=profiles" title="<?php echo _("Back") ?>"><?php echo _("Back") ?></a></p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>?psaSec=profile_edit">
<fieldset>
<input type="hidden" name="PSA_id" value="<?php echo $id ?>" />
<p><b><?php echo _("Name") ?>:</b> <input type="text" size="30" name="PSA_name" value="<?php echo $profile['name'] ?>" /></p>
<p><input type="checkbox" name="PSA_admin" value="1" <?php if($profile['admin']) echo ' checked="checked"'; ?> /><?php echo _("Admin Privileges") ?></p>
<?php
$pages=$PSA_SYS->get_pages();
if($pages===FALSE)
$PSA_SYS->error();
while(list($id,$val)=@each($pages)){
echo ' <input type="checkbox" name="PSA_pages[]" value="',$id,'"';
if (isset($profile[$id])) echo ' checked="checked"';
echo ' />',$val,'<br />',"\n";
}
?>
<p><input type="submit" name="PSA_submit" value="<?php echo _("Update User Profile") ?>" /></p>
</fieldset>
</form>