[ Index ] |
|
Code source de WebCalendar 1.0.5 |
1 <?php 2 /* $Id: edit_user.php,v 1.41 2005/02/26 06:49:45 cknudsen Exp $ */ 3 include_once 'includes/init.php'; 4 5 if ( ! $is_admin ) 6 $user = $login; 7 8 // cannot edit public user. 9 if ( $user == '__public__' ) 10 $user = $login; 11 12 // don't allow them to create new users if it's not allowed 13 if ( empty ( $user ) ) { 14 // asking to create a new user 15 if ( ! $is_admin ) { 16 // must be admin... 17 do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW" ); 18 exit; 19 } 20 if ( ! $admin_can_add_user ) { 21 // if adding users is not allowed... 22 do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW" ); 23 exit; 24 } 25 } 26 27 $disableCustom = true; 28 29 print_header ( '', '', '', $disableCustom ); 30 ?> 31 <table style="border-width:0px;"> 32 <tr><td style="vertical-align:top; width:50%;"> 33 <h2><?php 34 if ( ! empty ( $user ) ) { 35 user_load_variables ( $user, "u" ); 36 echo translate("Edit User"); 37 } else { 38 echo translate("Add User"); 39 } 40 ?></h2> 41 <form action="edit_user_handler.php" method="post"> 42 <input type="hidden" name="formtype" value="edituser" /> 43 <?php 44 if ( empty ( $user ) ) { 45 echo "<input type=\"hidden\" name=\"add\" value=\"1\" />\n"; 46 } 47 ?> 48 <table style="border-width:0px;"> 49 <tr><td> 50 <label for="username"><?php etranslate("Username")?>:</label></td><td> 51 <?php 52 if ( ! empty ( $user ) ) { 53 if ( $is_admin ) 54 echo $user . "<input name=\"user\" type=\"hidden\" value=\"" . 55 htmlspecialchars ( $user ) . "\" />\n"; 56 else 57 echo $user; 58 } else { 59 echo "<input type=\"text\" name=\"user\" id=\"username\" size=\"25\" maxlength=\"25\" />\n"; 60 } 61 ?> 62 </td></tr> 63 <tr><td> 64 <label for="ufirstname"><?php etranslate("First Name")?>:</label></td><td> 65 <input type="text" name="ufirstname" id="ufirstname" size="20" value="<?php echo empty ( $ufirstname ) ? '' : htmlspecialchars ( $ufirstname );?>" /> 66 </td></tr> 67 <tr><td> 68 <label for="ulastname"><?php etranslate("Last Name")?>:</label></td><td> 69 <input type="text" name="ulastname" id="ulastname" size="20" value="<?php echo empty ( $ulastname ) ? '' : htmlspecialchars ( $ulastname );?>" /> 70 </td></tr> 71 <tr><td> 72 <label for="uemail"><?php etranslate("E-mail address")?>:</label></td><td> 73 <input type="text" name="uemail" id="uemail" size="20" value="<?php echo empty ( $uemail ) ? '' : htmlspecialchars ( $uemail );?>" /> 74 </td></tr> 75 <?php if ( empty ( $user ) && ! $use_http_auth && $user_can_update_password ) { ?> 76 <tr><td> 77 <label for="pass1"><?php etranslate("Password")?>:</label></td><td> 78 <input name="upassword1" id="pass1" size="15" value="" type="password" /> 79 </td></tr> 80 <tr><td> 81 <label for="pass2"><?php etranslate("Password")?> (<?php etranslate("again")?>):</label></td><td> 82 <input name="upassword2" id="pass2" size="15" value="" type="password" /> 83 </td></tr> 84 <?php } 85 if ( $is_admin ) { ?> 86 <tr><td style="font-weight:bold;"> 87 <?php etranslate("Admin")?>:</td><td> 88 <label><input type="radio" name="uis_admin" value="Y"<?php if ( ! empty ( $uis_admin ) && $uis_admin == "Y" ) echo " checked=\"checked\"";?> /> <?php etranslate("Yes")?></label> 89 <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 </td></tr> 91 <?php } //end if ($is_admin ) ?> 92 <tr><td colspan="2"> 93 <?php if ( $demo_mode == "Y" ) { ?> 94 <input type="button" value="<?php etranslate("Save")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" /> 95 <?php if ( $is_admin && ! empty ( $user ) ) { ?> 96 <input type="submit" name="action" value="<?php etranslate("Delete")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" /> 97 <?php } //end if ( $demo_mode == "Y" ) ?> 98 <?php } else { ?> 99 <input type="submit" value="<?php etranslate("Save")?>" /> 100 <?php if ( $is_admin && ! empty ( $user ) ) { 101 if ( $admin_can_delete_user ) ?> 102 <input type="submit" name="action" value="<?php etranslate("Delete")?>" onclick="return confirm('<?php etranslate("Are you sure you want to delete this user?"); ?>')" /> 103 <?php } ?> 104 <?php } ?> 105 </td></tr> 106 </table> 107 </form> 108 109 <?php if ( ! empty ( $user ) && ! $use_http_auth && 110 ( isset ( $user_can_update_password ) && $user_can_update_password ) ) { ?> 111 </td><td> </td> 112 <td style="vertical-align:top;"> 113 114 <h2><?php etranslate("Change Password")?></h2> 115 <form action="edit_user_handler.php" method="post"> 116 <input type="hidden" name="formtype" value="setpassword" /> 117 <?php if ( $is_admin ) { ?> 118 <input type="hidden" name="user" value="<?php echo $user;?>" /> 119 <?php } ?> 120 <table style="border-width:0px;"> 121 <tr><td> 122 <label for="newpass1"><?php etranslate("New Password")?>:</label></td><td> 123 <input name="upassword1" id="newpass1" type="password" size="15" /> 124 </td></tr> 125 <tr><td> 126 <label for="newpass2"><?php etranslate("New Password")?> (<?php etranslate("again")?>):</label></td><td> 127 <input name="upassword2" id="newpass2" type="password" size="15" /> 128 </td></tr> 129 <tr><td colspan="2"> 130 <?php if ( $demo_mode == "Y" ) { ?> 131 <input type="button" value="<?php etranslate("Set Password")?>" onclick="alert('<?php etranslate("Disabled for demo")?>')" /> 132 <?php } else { ?> 133 <input type="submit" value="<?php etranslate("Set Password")?>" /> 134 <?php } ?> 135 </td></tr> 136 </table> 137 </form> 138 <?php } ?> 139 </td></tr></table> 140 141 <?php print_trailer ( false, true, true ); ?> 142 </body> 143 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Nov 30 19:09:19 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |