2 include_once $gfplugins.'webcalendar/www/includes/init.php';
7 // cannot edit public user.
8 if ( $user == '__public__' )
11 // don't allow them to create new users if it's not allowed
12 if ( empty ( $user ) ) {
13 // asking to create a new user
16 do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW" );
19 if ( ! $admin_can_add_user ) {
20 // if adding users is not allowed...
21 do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW" );
26 $disableCustom = true;
28 print_header ( '', '', '', $disableCustom );
30 <table style="border-width:0px;">
31 <tr><td style="vertical-align:top; width:50%;">
33 if ( ! empty ( $user ) ) {
34 user_load_variables ( $user, "u" );
35 echo translate("Edit User");
37 echo translate("Add User");
40 <form action="edit_user_handler.php" method="post">
41 <input type="hidden" name="formtype" value="edituser" />
43 if ( empty ( $user ) ) {
44 echo "<input type=\"hidden\" name=\"add\" value=\"1\" />\n";
47 <table style="border-width:0px;">
49 <label for="username"><?php etranslate("Username")?>:</label></td><td>
51 if ( ! empty ( $user ) ) {
53 echo $user . "<input name=\"user\" type=\"hidden\" value=\"" .
54 htmlspecialchars ( $user ) . "\" />\n";
58 echo "<input type=\"text\" name=\"user\" id=\"username\" size=\"25\" maxlength=\"25\" />\n";
63 <label for="ufirstname"><?php etranslate("First Name")?>:</label></td><td>
64 <input type="text" name="ufirstname" id="ufirstname" size="20" value="<?php echo empty ( $ufirstname ) ? '' : htmlspecialchars ( $ufirstname );?>" />
67 <label for="ulastname"><?php etranslate("Last Name")?>:</label></td><td>
68 <input type="text" name="ulastname" id="ulastname" size="20" value="<?php echo empty ( $ulastname ) ? '' : htmlspecialchars ( $ulastname );?>" />
71 <label for="uemail"><?php etranslate("E-mail address")?>:</label></td><td>
72 <input type="text" name="uemail" id="uemail" size="20" value="<?php echo empty ( $uemail ) ? '' : htmlspecialchars ( $uemail );?>" />
74 <?php if ( empty ( $user ) && ! $use_http_auth && $user_can_update_password ) { ?>
76 <label for="pass1"><?php etranslate("Password")?>:</label></td><td>
77 <input name="upassword1" id="pass1" size="15" value="" type="password" />
80 <label for="pass2"><?php etranslate("Password")?> (<?php etranslate("again")?>):</label></td><td>
81 <input name="upassword2" id="pass2" size="15" value="" type="password" />
85 <tr><td style="font-weight:bold;">
86 <?php etranslate("Admin")?>:</td><td>
87 <label><input type="radio" name="uis_admin" value="Y"<?php if ( ! empty ( $uis_admin ) && $uis_admin == "Y" ) echo " checked=\"checked\"";?> /> <?php etranslate("Yes")?></label>
88 <label><input type="radio" name="uis_admin" value="N"<?php if ( empty ( $uis_admin ) || $uis_admin != "Y" ) echo " checked=\"checked\"";?> /> <?php etranslate("No")?></label>
90 <?php } //end if ($is_admin ) ?>
92 <?php if ( $demo_mode == "Y" ) { ?>
93 <input type="button" value="<?php etranslate("Save")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" />
94 <?php if ( $is_admin && ! empty ( $user ) ) { ?>
95 <input type="submit" name="action" value="<?php etranslate("Delete")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" />
96 <?php } //end if ( $demo_mode == "Y" ) ?>
98 <input type="submit" value="<?php etranslate("Save")?>" />
99 <?php if ( $is_admin && ! empty ( $user ) ) {
100 if ( $admin_can_delete_user ) ?>
101 <input type="submit" name="action" value="<?php etranslate("Delete")?>" onclick="return confirm('<?php etranslate("Are you sure you want to delete this user?"); ?>')" />
108 <?php if ( ! empty ( $user ) && ! $use_http_auth &&
109 ( isset ( $user_can_update_password ) && $user_can_update_password ) ) { ?>
110 </td><td> </td>
111 <td style="vertical-align:top;">
113 <h2><?php etranslate("Change Password")?></h2>
114 <form action="edit_user_handler.php" method="post">
115 <input type="hidden" name="formtype" value="setpassword" />
116 <?php if ( $is_admin ) { ?>
117 <input type="hidden" name="user" value="<?php echo $user;?>" />
119 <table style="border-width:0px;">
121 <label for="newpass1"><?php etranslate("New Password")?>:</label></td><td>
122 <input name="upassword1" id="newpass1" type="password" size="15" />
125 <label for="newpass2"><?php etranslate("New Password")?> (<?php etranslate("again")?>):</label></td><td>
126 <input name="upassword2" id="newpass2" type="password" size="15" />
129 <?php if ( $demo_mode == "Y" ) { ?>
130 <input type="button" value="<?php etranslate("Set Password")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" />
132 <input type="submit" value="<?php etranslate("Set Password")?>" />
140 <?php print_trailer ( false, true, true ); ?>