Formato+Logo+favicon
[CLab.git] / useredit.php
blob691b5a85997d3fdea9b00e273a8da471273aa85b
1 <?
2 /**
3 * UserEdit.php
4 */
5 include("include/session.php");
6 /**
7 * User has submitted form without errors and user's
8 * account has been edited successfully.
9 */
10 if(isset($_SESSION['useredit'])){
11 unset($_SESSION['useredit']);
13 echo "<h2>User Account Edit Success!</h2>";
14 echo "<p><b>$session->username</b>, your account has been successfully updated. </p>";
16 else{
17 /**
18 * If user is not logged in, then do not display anything.
19 * If user is logged in, then display the form to edit
20 * account information, with the current email address
21 * already in the field.
23 if($session->logged_in || $session->isAdmin()){
26 <h1>Editar cuenta del Instructor: <? echo $session->username; ?></h1>
28 if($form->num_errors > 0){
29 echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";
32 <form action="process.php" method="POST">
33 <table align="left" border="0" cellspacing="0" cellpadding="3">
34 <tr>
35 <td>Clave actual:</td>
36 <td><input type="password" name="curpass" maxlength="30" value="
37 <?echo $form->value("curpass"); ?>"></td>
38 <td><? echo $form->error("curpass"); ?></td>
39 </tr>
40 <tr>
41 <td>Nueva clave:</td>
42 <td><input type="password" name="newpass" maxlength="30" value="
43 <? echo $form->value("newpass"); ?>"></td>
44 <td><? echo $form->error("newpass"); ?></td>
45 </tr>
46 <tr>
47 <td>Email:</td>
48 <td><input type="text" name="email" maxlength="50" value="
50 if($form->value("email") == ""){
51 echo $session->userinfo['email'];
52 }else{
53 echo $form->value("email");
55 ?>">
56 </td>
57 <td><? echo $form->error("email"); ?></td>
58 </tr>
59 <tr><td colspan="2" align="right">
60 <input type="hidden" name="subedit" value="1">
61 <input type="submit" value="Edit Account"></td></tr>
62 <tr><td colspan="2" align="left"></td></tr>
63 </table>
64 </form>