cotonti.com : Question about plugin https://www.cotonti.com Laatste forum onderwerpen Cotonti en Wed, 15 Oct 2025 18:31:23 -0000 tensh I didn't even notice that :)]]> Wo, 29 Jul 2009 18:34:10 -0000 Trustmaster Wo, 29 Jul 2009 18:27:03 -0000 tensh

Added 1 day later:

By the way, I have another question about Cotonti POST forms protection. I notices the hidden field named "x" in e.g. search form, with a value. I suppose it's a sort of defense from external attacks. How can I use it in forms in other plugins?]]>
Ma, 27 Jul 2009 19:55:37 -0000
Kilandor
switch($s)
{
	case 'edit':
		sed_block($usr['isadmin']); //Blocks anyone who isn't an admin - if value is false it blocks them
		/* your code */
	break;
}
]]>
Ma, 27 Jul 2009 19:43:24 -0000
tensh
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?]]>
Ma, 27 Jul 2009 19:00:18 -0000