Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv1320 Modified Files: admin_change_password.php admin_manage_users.php admin_manage_users_add.php admin_manage_users_add_page.php admin_manage_users_edit.php admin_manage_users_update.php Log Message: - Fixed a problem in the user add if the user was added as not enabled. - 0000079: Add support for protected accounts - Removing of some unnecessary code in user_api.php - User create was hard-coded to add users as enabled. - Changed the version back to 2.0.0-dev. Index: admin_change_password.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_change_password.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- admin_change_password.php 21 Sep 2002 02:44:32 -0000 1.17 +++ admin_change_password.php 7 Oct 2002 02:54:39 -0000 1.18 @@ -12,7 +12,16 @@ login_cookie_check(); - access_ensure_check_action( ACTION_USERS_EDIT_OWN ); + $row = user_get_info( user_where_current() ); + extract( $row, EXTR_PREFIX_ALL, 'v' ); + + if ( 1 == $v_protected ) { + $t_action = ACTION_USERS_EDIT_OWN_PROTECTED; + } else { + $t_action = ACTION_USERS_EDIT_OWN; + } + + access_ensure_check_action( $t_action ); if ( isset( $f_action ) && ( $f_action == 'change' ) ) { $f_current_password = gpc_get_string( 'f_current_password' ); @@ -27,9 +36,6 @@ EOT; } } - - $row = user_get_info( user_where_current() ); - extract( $row, EXTR_PREFIX_ALL, "v" ); print_html_top(); print_head_top(); Index: admin_manage_users.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- admin_manage_users.php 3 Oct 2002 03:47:50 -0000 1.10 +++ admin_manage_users.php 7 Oct 2002 02:54:39 -0000 1.11 @@ -28,14 +28,15 @@ $t_users_array = user_get_all(); echo '<table class="box" summary="">'; - echo '<thead><tr><th>Username</th><th>Email</th><th>Access Level</th><th>Enabled</th></tr></thead><tbody>'; + echo '<thead><tr><th>Username</th><th>Email</th><th>Access Level</th><th>Enabled</th><th>Protected</th></tr></thead><tbody>'; $i = 0; foreach ( $t_users_array as $user ) { extract( $user, EXTR_PREFIX_ALL, 'v' ); $v_enabled = $v_enabled ? 'x' : ' '; + $v_protected = $v_protected ? 'x' : ' '; $t_class = util_alternate_class( $i++ ); $t_access_level = enum_get_element( 'access_levels', $v_access_level ); - echo "<tr class=\"$t_class\"><td><a href=\"$g_admin_manage_users_edit?f_user_id=$v_id\">$v_username</a></td><td>$v_email</td><td>$t_access_level</td><td>$v_enabled</td></tr>"; + echo "<tr class=\"$t_class\"><td><a href=\"$g_admin_manage_users_edit?f_user_id=$v_id\">$v_username</a></td><td>$v_email</td><td>$t_access_level</td><td>$v_enabled</td><td>$v_protected</td></tr>"; } echo '</tbody></table>'; echo '<div class="spacer"></div>'; Index: admin_manage_users_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users_add.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- admin_manage_users_add.php 1 Oct 2002 00:17:56 -0000 1.3 +++ admin_manage_users_add.php 7 Oct 2002 02:54:39 -0000 1.4 @@ -19,13 +19,24 @@ $f_password = gpc_get( 'f_password' ); $f_password_confirm = gpc_get( 'f_password_confirm' ); $f_access_level = gpc_get( 'f_access_level' ); - $f_enabled = gpc_get( 'f_enabled' ); if ( $f_password != $f_password_confirm ) { util_header_redirect( $g_admin_manage_users_add_page ); } - user_create( $f_username, $f_password, $f_email, $f_access_level, $f_enabled ); + if ( isset( $f_enabled ) ) { + $f_enabled = 1; + } else { + $f_enabled = 0; + } + + if ( isset( $f_protected ) ) { + $f_protected = 1; + } else { + $f_protected = 0; + } + + user_create( $f_username, $f_password, $f_email, $f_access_level, $f_enabled, $f_protected ); util_header_redirect( $g_admin_manage_users ); ?> Index: admin_manage_users_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users_add_page.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- admin_manage_users_add_page.php 3 Oct 2002 01:20:45 -0000 1.5 +++ admin_manage_users_add_page.php 7 Oct 2002 02:54:39 -0000 1.6 @@ -86,6 +86,14 @@ <input type="checkbox" name="f_enabled" checked="checked" /> </td> </tr> +<tr class="row-1"> + <th> + Protected + </th> + <td> + <input type="checkbox" name="f_protected" /> + </td> +</tr> <tr class="buttons"> <td colspan="2"> <input type="submit" value="Add User" /> Index: admin_manage_users_edit.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users_edit.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- admin_manage_users_edit.php 3 Oct 2002 03:47:50 -0000 1.7 +++ admin_manage_users_edit.php 7 Oct 2002 02:54:39 -0000 1.8 @@ -91,6 +91,14 @@ <input type="checkbox" name="f_enabled" <?php if ( 1 == $v_enabled ) echo 'checked="checked"' ?> /> </td> </tr> +<tr class="row-1"> + <th> + Protected + </th> + <td> + <input type="checkbox" name="f_protected" <?php if ( 1 == $v_protected ) echo 'checked="checked"' ?> /> + </td> +</tr> <tr class="buttons"> <td colspan="2"> <input type="submit" value="Update User" /> Index: admin_manage_users_update.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users_update.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- admin_manage_users_update.php 3 Oct 2002 03:47:50 -0000 1.5 +++ admin_manage_users_update.php 7 Oct 2002 02:54:39 -0000 1.6 @@ -30,7 +30,13 @@ $f_enabled = 0; } - user_update( $f_user_id, $f_email, $f_password, $f_access_level, $f_enabled ); + if ( isset( $f_protected ) ) { + $f_protected = 1; + } else { + $f_protected = 0; + } + + user_update( $f_user_id, $f_email, $f_password, $f_access_level, $f_enabled, $f_protected ); util_header_redirect( $g_admin_manage_users ); ?> |