Forums / Cotonti / Extensions / Support / Question about plugin

tensh
#14934 2009-07-27 19:00
Hi;

I'm developing a plugin which has parts divided by "switch" statement. How can I make one 'switch' disabled for regular users but enabled for admin?
What I have by now is:

$IsAdmin = sed_auth('plug', 'myplug', 'A');

(...)

switch($s)
{ 

	case edit:

if ($IsAdmin) 
        {
        (...)
        }
}
	break;

When I go to plug.php?e=myplug&s=edit as a guest, I see blank page, but I'd like to display a message "you're not allowed to do it". How can I call it?
This post was edited by tensh (2009-07-27 19:58, 14 years ago)