Consider the following code snippet. Is this code acceptable from a security standpoint? Assume that the $action and $data variables are designed to be accepted from the user and register_globals is enabled.
<?php
if(common::IsUserAdmin($userID))
{
$isAdmin = true;
}
$data = common::Validate_And_Return_Input($data)
Switch($action)
{
case “add”:
common::addSomething($data);
break;
case “delete”:
if($isAdmin)
{
common::deleteSomething($data);
}
break;
case “edit”:
if($isAdmin)
{
common::editSomething($data);
}
break;
default:
echo “Bad action.”;
}
?>
As you didn't show any code: from a security standpoint, there is nothing to secure. So just zip it up into a file and store it away to let it rot for 10 years until you delete it.
If you actually even intend to run that on a server connected to the internet, you should follow the bare minimum from the suggested security topics in the PHP manual including to disable register globals.
If you finally managed that (there are more topics), you might be even able to actually post code examples that do show some of your data handling instead of hiding that away behind no-saying function names. Validate for what? Return to where?
So actually, there is not much to say about your code here, as there isn't much code.
Hope this was helpful.