From: <vb...@us...> - 2002-09-15 04:03:55
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv5285 Modified Files: admin_change_password.php Log Message: Some clean up of the change password page + using the Mantis style + requiring the current password in the change password form. Index: admin_change_password.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_change_password.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- admin_change_password.php 14 Sep 2002 15:19:12 -0000 1.12 +++ admin_change_password.php 15 Sep 2002 04:03:51 -0000 1.13 @@ -8,20 +8,17 @@ # $Id$ # -------------------------------------------------------- - require_once( "core" . DIRECTORY_SEPARATOR . "api.php" ); + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); - if (isset($f_action)&&($f_action=="change")) { - if ($f_password==$f_password2) { - $f_password = crypt($f_password); - $query = "UPDATE $g_phpWN_user_table - SET password='$f_password' - WHERE id='$f_id'"; - $result = db_query( $query ); - $pass_change = 1; - } else { - PRINT "PASSWORDS DO NOT MATCH"; - exit; - } + if ( isset( $f_action ) && ( $f_action == 'change' ) ) { + $f_current_password = gpc_get_string( $f_current_password ); + $f_password = gpc_get_string( $f_password ); + $f_password2 = gpc_get_string( $f_password2 ); + + # @@@@ Use user_change_password() after it is implemented + + echo "NOT IMPLEMENTED"; + exit; } $row = get_user_info_arr( $g_string_cookie_val ); @@ -38,55 +35,45 @@ print_admin_menu(); - echo '<br /><div align="center">'; - if ( isset( $pass_change ) && ( $pass_change == 1 ) ) { - echo "Password changed.<br />"; + echo '<div align="center">Password changed.</div>'; + } else { + echo <<<EOT + <div align="center"> + <form method="post" action="$g_admin_change_password"> + <input type="hidden" name="f_action" value="change" /> + <input type="hidden" name="f_id" value="$v_id" /> + <table class="width50"> + <tr class="form-title"> + <td colspan="2"> + <strong>$s_change_password_title</strong> + </td> + </tr> + <tr class="row-1"> + <td class="category" width="25%">$s_username:</td> + <td width="75%">$v_username</td> + </tr> + <tr class="row-2"> + <td class="category">Current Password:</td> + <td><input type="password" name="f_current_password" size="32" maxlength="32" /></td> + </tr> + <tr class="row-1"> + <td class="category">$s_password:</td> + <td><input type="password" name="f_password" size="32" maxlength="32" /></td> + </tr> + <tr class="row-2"> + <td class="category">$s_verify_password:</td> + <td><input type="password" name="f_password2" size="32" maxlength="32" /></td> + </tr> + <tr> + <td class="form-buttons" colspan="2"><input type="submit" value="$s_change_password_link" /></td> + </tr> + </table> + </form> + </div> +EOT; } -?> -<form method="post" action="<? echo $g_admin_change_password ?>"> -<input type="hidden" name="f_action" value="change" /> -<input type="hidden" name="f_id" value="<? echo $v_id ?>" /> -<table width="40%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> -<tr bgcolor=<? echo $g_header_color ?>> - <td colspan="2" bgcolor="<? echo $g_table_title_color ?>"> - <strong><? echo $s_change_password_title ?></strong> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td width="25%"> - <? echo $s_username ?>: - </td> - <td width="75%"> - <? echo $v_username ?> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td> - <? echo $s_password ?>: - </td> - <td> - <input type="password" name="f_password" size="32" maxlength="32" /> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td> - <? echo $s_verify_password ?>: - </td> - <td> - <input type="password" name="f_password2" size="32" maxlength="32" /> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td align="center" colspan="2"> - <input type="submit" value="<? echo $s_change_password_link ?>" /> - </td> -</tr> -</table> -</form> -</div> -<?php print_bottom_page( $g_bottom_page_inc ); print_footer( __FILE__ ); print_body_bottom(); |