I need the user who changed his profile to be visible to the administrator

In order for the administrator to be able to check the new information introduced by the user, and could approve or delete the profile.
Please tell me how this can be implemented?

You can use user_edit_completed hook. Maybe disable the user profile after edit until admin approves it?

function wm_user_edit_disable($uid) {
    require_once LIB_PATH . 'osclass/UserActions.php';
    $userActions = new UserActions(false);
    osc_add_flash_warning_message('Your profile has been disabled until edits are approved by an administrator');
osc_add_hook('user_edit_completed', 'wm_user_edit_disable');
1 Like

Thank you so much for your help!
It’s best to just mark the user so that the admin can check the information and punish spammers, but not create problems for normal users.

Where is this code placed?

this code needs to be added to the end of the file functions.php

If there are no options not to disable the user profile, then your offer is acceptable.
Can display text - your profile must be approved by the administrator and this will take some time.
Another question: is it possible to somehow redefine the function:
function wm_user_edit_disable
so that she did not turn off the user profile, but just tagged him?

@defected, how this small script can be changed to allow users to edit/fill their profile, ONLY when they have xxx number of ads or maybe after some days have passed from their registrations?

Try something like this. I didn’t test it so there might be some tiny syntax errors.

function wm_user_edit_disable($errors, $uid) {
    $itemCount = Item::newInstance()->countByUserID($uid);
    if($itemCount < 5) { // Less than 5 items.
        $errors.= 'You need to have more ads to edit your profile' . PHP_EOL;

    $user = User::newInstance()->findByPrimaryKey($uid);
    $dateNow = new DateTime('now');
    $dateRegister = new DateTime($user['dt_reg_date']);
    $dateDifference = $dateNow->diff($dateRegister);
    if($dateDifference->days < 7) { // Less than 7 days passed since register.
        $errors.= 'You need to few days more to edit your profile.' . PHP_EOL;

    return $errors;
osc_add_filter('user_edit_flash_error', 'wm_user_edit_disable');
1 Like

@defected works just fine, many thanks.

1 Like