all2aller

Function Redirect Admin WHMC

Aug 16th, 2016
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. // Redirect Admin
  2.  
  3. function redirect_admin() {
  4.  
  5.    $home_site_url = 'http://www.sitoweb.com';
  6.  
  7.   $pages = array('clientarea.php', 'cart.php', 'affiliates.php', 'register.php', 'login.php');
  8.  
  9.   foreach($pages as $pages) {
  10.    
  11.     if (strpos($page_complete_url, $pages)) {
  12.        
  13.         $client_area = true;
  14.  
  15.         break;
  16.     }
  17.   }
  18.  
  19. if(!$client_area) {
  20.  
  21.   header("location: $home_site_url");
  22.  
  23. }
  24.  
  25. // Call Function in WHMCS in header.tpl
  26.  
  27. {redirect_admin}
Advertisement
Add Comment
Please, Sign In to add comment