You can put at start of page
If() {
header('Location....);
exit;
}
I do not understand
I did something
<?php echo (osc_is_web_user_logged_in() ? osc_contact_url() : osc_user_login_url()) ; ?>
It only works when you click on the link, it will be transferred to the login page
But if the link is written directly, it will not be directed to the login page
He can even send messages even if he is not registered