Message # 1 | 4:02 PM
The script blocks access of people who are not administrators group PHP script.

Remember: You must be logged in on the site to be allowed.

How to use
auth.php
Code
<?php
/*
   * Developed by Ennio Sousa http://uid.me/shzlot
   * 20/08/2015
   */

/*
   * You need allow API usage in Common settings
   * Screenshot https://goo.gl/W5EBw9
   */
$apikey = '';// Optional - If you choosed use API key

if(ucoz_getinfo("SITEUSERID")){// users not logged in is 0 (or false)
      $host = $_SERVER["HTTP_HOST"];
      $userid = ucoz_getinfo("SITEUSERID");
      $url = "http://$host/api/index/8-$userid?apikey=$apikey";

      $context = stream_context_create(array('http' => array('method' => "GET", 'header' => "Content-Type: text/xml",)));
      $file = file_get_contents($url, false, $context);
      $response = xmlrpc_decode($file,"utf8");
      if ($response && xmlrpc_is_fault($response))
      {
          $___error = "Can't receive data, try again later or contact.";
          exit;
      }
      //USER_GROUPID
      if( $response['USER_GROUPID'] != 4 ){// 4 is admin group ID
          $___error = "User does not have permission.";
          exit;
      }
}
else{
      $___error = "User does not have permission.";
      exit;
}    
?>


script.php
Code
<?php
include 'auth.php';

/*
   * Pen you code here
   */

Hello! I am Ennio Sousa
Post edited by BraziluCoz - Friday, 2015-08-21, 5:13 AM