@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | |
40 | 40 | function check_delete_account_token($userid, $token) { |
41 | - if( !is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
41 | + if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
42 | 42 | sleep(LOGIN_FAIL_SLEEP_SEC); |
43 | 43 | return false; |
44 | 44 | } |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | function delete_account($user) { |
64 | 64 | $config = get_config(); |
65 | 65 | $enable_delete_account = parse_config($config, "<enable_delete_account>"); |
66 | - if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_OBFUSCATE ) { |
|
66 | + if ($enable_delete_account == DELETE_ACCOUNT_METHOD_OBFUSCATE) { |
|
67 | 67 | return obfuscate_account($user); |
68 | - } else if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_WIPE ) { |
|
68 | + } else if ($enable_delete_account == DELETE_ACCOUNT_METHOD_WIPE) { |
|
69 | 69 | return wipe_account($user); |
70 | - } else if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_PROJECT_DEFINED ) { |
|
70 | + } else if ($enable_delete_account == DELETE_ACCOUNT_METHOD_PROJECT_DEFINED) { |
|
71 | 71 | return project_delete_account($user); |
72 | 72 | } |
73 | 73 | return false; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // pending validation or inconclusive |
123 | 123 | function is_over_but_not_validated($res) { |
124 | 124 | if ($res->server_state == RESULT_SERVER_STATE_OVER && $res->outcome == RESULT_OUTCOME_SUCCESS && |
125 | - ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE) ) { |
|
125 | + ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE)) { |
|
126 | 126 | return true; |
127 | 127 | } |
128 | 128 | return false; |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | // hostid fields to 0 |
140 | 140 | function cancel_results_for_user($user) { |
141 | 141 | $ress = BoincResult::enum("userid = $user->id"); |
142 | - $cancel_clause="server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
143 | - $set_id_clause="hostid=0, userid=0"; |
|
144 | - foreach($ress as $res) { |
|
142 | + $cancel_clause = "server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
143 | + $set_id_clause = "hostid=0, userid=0"; |
|
144 | + foreach ($ress as $res) { |
|
145 | 145 | if (is_in_progress($res) || is_over_but_not_validated($res)) { |
146 | 146 | $res->update($cancel_clause.", ".$set_id_clause); |
147 | 147 | transition_workunit($res); |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | insert_deleted_records($user); |
161 | 161 | |
162 | 162 | // delete remote submit user |
163 | - delete_remote_submit_user($user); // from submit_util.inc |
|
163 | + delete_remote_submit_user($user); // from submit_util.inc |
|
164 | 164 | |
165 | 165 | // remove user's team records |
166 | - user_erase_team_owner($user); // from team.inc |
|
167 | - user_quit_team($user); // from team.inc |
|
166 | + user_erase_team_owner($user); // from team.inc |
|
167 | + user_quit_team($user); // from team.inc |
|
168 | 168 | user_erase_team_delta($user); // from team.inc |
169 | 169 | |
170 | 170 | // Items that do not have logic elsewhere |
@@ -188,6 +188,6 @@ discard block |
||
188 | 188 | BoincHost::delete_for_user($user->id); |
189 | 189 | |
190 | 190 | // final action |
191 | - delete_user($user); //from user_util.inc |
|
191 | + delete_user($user); //from user_util.inc |
|
192 | 192 | return true; |
193 | 193 | } |