Permalink
Browse files

Fix SQL error when deleting user

The initialization of $t_user_table must take place outside of the if
statement, since the variable is used a second time at end of the
function.

Regression introduced by a80f447.
  • Loading branch information...
1 parent cbd3ce3 commit 47f0ccf1036dafe07d62c75f78a47bd5c7b34f1c @dregad dregad committed Oct 30, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/user_api.php
View
3 core/user_api.php
@@ -647,10 +647,11 @@ function user_delete( $p_user_id ) {
# Remove project specific access levels
user_delete_project_specific_access_levels( $p_user_id );
+ $t_user_table = db_get_table( 'user' );
+
# unset non-unique realname flags if necessary
if( config_get( 'differentiate_duplicates' ) ) {
$c_realname = user_get_field( $p_user_id, 'realname' );
- $t_user_table = db_get_table( 'user' );
$t_query = "SELECT id FROM $t_user_table WHERE realname=" . db_param();
$t_result = db_query_bound( $t_query, array( $c_realname ) );

0 comments on commit 47f0ccf

Please sign in to comment.