<?php
if(isset($_POST['PSA_submit'])){
$PSA_id=$_POST['PSA_id'];
$PSA_SYS->user_change_profile($_POST);
echo '<p>',sprintf(_("Rights updated for user %s"),$_POST['PSA_id']),'</p>',"\n";
}
if(!isset($id) && isset($_GET['PSA_id']))
$PSA_id=$_GET['PSA_id'];
$users=$PSA_SYS->get_users();
$user=$users[$PSA_id];
?>
<h2><?php printf(_("Rights for user %s"),$user['id']) ?></h2>
<p><a href="<?php echo $_SERVER['PHP_SELF'] ?>?psaSec=user_edit&PSA_id=<?php echo $PSA_id ?>" title="<?php echo _("Back") ?>"><?php echo _("Back") ?></a></p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>?psaSec=user_edit_rights">
<fieldset>
<input type="hidden" name="PSA_id" value="<?php echo $PSA_id ?>" />
<?php
$profiles=$PSA_SYS->get_profiles();
echo ' <p>',_("Apply Profiles"),'</p>',"\n";
while(list($gid,$name)=@each($profiles)){
echo ' <input type="checkbox" name="PSA_gids[]" value="',$gid,'"';
foreach(explode(',',$user['groups']) as $ugid)
if($ugid==$gid) echo ' checked="checked"';
echo ' />',$name,'<br />',"\n";
}
?>
<p><input type="submit" name="PSA_submit" value="<?php echo _("Update Access Rights") ?>" /></p>
</fieldset>
</form>