@reflexusBecause ban is active for mails only, not for personal messages.
$banned = osc_is_banned($from_user_email); if($banned==1) { osc_add_flash_error_message( _m('Your current email is not allowed')); $this->redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) )); return; } else if($banned==2) { osc_add_flash_error_message( _m('Your current IP is not allowed')); redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) )); return; } $user = User::newInstance()->newInstance()->findByEmail($from_user_email); if(isset($user['b_active']) && ($user['b_active']==0 || $user['b_enabled']==0)) { osc_add_flash_error_message( _m('Your current email is not allowed')); redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) )); return; }