Doing Stop hook_user Drupal

I need to use Drupal 6 "hook_user" to update a third-party API whenever a user updates their profile.

Therefore, I use the operation "update". The problem I am facing is that I simply cannot figure out how I can stop execution if the update to the third-party API has failed.

those. the user updates his username, but if the API fails, prevent Drupal from updating the local record.

function myhooks_user($op, &$edit, &$account, $category) {

    switch ( $op )
    {

        case 'update':

            if ( FALSE === updateAPI($data) )
            {
                drupal_set_message("Cannot update user information", "error", false);

                return false; 
            }

            break;
    }
}

Returning false currently does not stop execution.

+3
source share
1 answer

Unable to stop execution.

$edit, , db. , . , .

? db cron , , .

+2

Source: https://habr.com/ru/post/1748864/


All Articles