2 function CONTENIDO_usuario_editar() {
3 global $session, $form;
4 /* Un visitante intenta hackear?*/
5 if (!$session->logged_in
) {return;}
6 /* Evitamos que un usuario registrado edite la cuenta de alguien mas */
7 if (!$session->isAdmin() && $session->logged_in
){
8 $usr = $session->username
;
10 /* Si llego aqui tiene que ser Admin y estar logeado*/
13 /* Si esta en proceso de edición */
14 if(isset($_SESSION['useredit'])){
15 unset($_SESSION['useredit']);
17 echo "<h3>¡Cuenta de usuario editada exitosamente!</h2>";
18 echo "<p><b>$session->username</b>, tu cuenta ha sido exitosamente actualizada.</p>";
22 if($session->logged_in
&& $session->isAdmin()){
24 <h2
>Editar cuenta del Instructor
: <?
echo $usr; ?
></h2
>
26 if($form->num_errors
> 0){
27 echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors
." error(s) found</font></td>";
30 <form action
="process.php" method
="POST">
31 <table align
="left" border
="0" cellspacing
="0" cellpadding
="3">
33 <td
>Clave actual
:</td
>
34 <td
><input type
="password" name
="curpass" maxlength
="30" value
="
35 <?echo $form->value("curpass
"); ?>"></td
>
36 <td
><?
echo $form->error("curpass"); ?
></td
>
40 <td
><input type
="password" name
="newpass" maxlength
="30" value
="
41 <? echo $form->value("newpass
"); ?>"></td
>
42 <td
><?
echo $form->error("newpass"); ?
></td
>
46 <td
><input type
="text" name
="email" maxlength
="50" value
="
48 if($form->value("email
") == ""){
49 echo $session->userinfo['email'];
51 echo $form->value("email
");
55 <td
><?
echo $form->error("email"); ?
></td
>
57 <tr
><td colspan
="2" align
="right">
58 <input type
="hidden" name
="subedit" value
="1">
59 <input type
="hidden" name
="username" value
="<? echo $usr; ?> ">
60 <input type
="submit" value
="Edit Account"></td
></tr
>
61 <tr
><td colspan
="2" align
="left"></td
></tr
>