I don’t want the message related to permission :
You do not have permission to access /website/admolist.php.
You do not have permission to access /website/admolistadd.php.
to be displayed for a non logged in user, All I want is if the user is not logged in and visited pages that needs permission the log in form only to be shown without that permission message.
I tried to do the following in message_showing of Login Page but it didn’t work :// Message Showing event
// $type = ‘’|‘success’|‘failure’
function Message_Showing(&$msg, $type) {
// Example:
//if ($type == ‘success’) $msg = “your success message”;
if ($type == ‘failure’) unset($msg);
}How can I have it work?
Put the following code in Client Scripts → Other → Login Page → Startup Script
$(“.ewMessageDialog”).hide();
Simply put the following code in “Page_Load” server event under “Server Events” → “Other” → “Login Page”:Language()->setPhrase(“NoPermission”, “”);You should not hide the “ewMessageDialog” section using Client Scripts, because you need to keep display another error message that related to the Login process, such as “Invalid user or password”, etc.
To disabled the NoPermission message I have put the code at the global Page_loading
Language()->setPhrase(“nopermission”, “”);if the user is login then the message is not showing
But if the user is not login and try to access a non-permission file then the “No Permission Message is showing”
I try to put the same code at the Lgin Page->Page_Load
but unable to hide the NoPermission message.
Simply put in “Language_Load” server event.
YOu can disable showing a particular error message on any page using message showing event.
for example this code hides the you dont have permission message like so
NOTE:This code was for 2018 version, so make any adjustments for 2019 where needed// Message Showing event
// $type = ‘’|‘success’|‘failure’
function Message_Showing(&$msg, $type) {
// Example:
//if ($type == ‘success’) $msg = “your success message”;//do not show You do not have permission to access
if ($type == ‘failure’ && ( strpos( $msg, “You do not have permission to access” ) !== false))
{
$type = null;
$msg = null;// Clear message in Session
$_SESSION[EW_SESSION_FAILURE_MESSAGE] = “”;
}
}
Hello! I try to use following code in “Page_Load” server event under “Server Events” → “Other” → “Login Page” (in v 2020):Language()->setPhrase(“NoPermission”, “”);And it doesn’t work. Please advice how to make it working.
Try Language_Load server event instead:
$this->setPhrase("NoPermission", "");
Thank you very much!