Need help with .appear command for VIP

Hey, I need help with .appear command for VIP only; basically I need help where only VIP players can only port to their own faction for example: if the player is horde they can only teleport to horde and vice versa. I am editing the level1.cpp

Here is the level1.cpp file:

http://pastebin.com/nEanxXvx

I am using this code to illustrate what I said above but appears the VIP players can .appear to gamemasters now, and also can appear to opposite faction. Here is the code:

if (target)

{
if ((_player->GetTeam() != target->GetTeam()) && _player->GetSession()->GetSecurity() > SEC_PLAYER)
{
SendSysMessage(“You can only appear to your faction!”);
return false;
}
}

Could someone help me and change the code to the correct function so it only allow VIP players to only appear to their own faction and cannot .appear to opposite faction. Thank you.