Dalexhd

autoregister.php

Oct 25th, 2017
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2. include_once 'include/config.php';
  3. include_once 'include/ts3admin.class.php';
  4.  
  5. function autoregister()
  6. {
  7.     global $query;
  8.     global $config;
  9.    
  10.     $users = $query->getElement('data',$query->clientList('-groups -voice -away -times -uid'));
  11.     foreach($users as $client)
  12.     {
  13.         $to_time = time();
  14.         $from_time = $client['client_created'];
  15.         $time = round(abs($to_time - $from_time) / 60,2);
  16.         if($time > $config['autoregister']['time'])
  17.         {
  18.             $query->serverGroupAddClient($config['autoregister']['group'], $client['client_database_id']);
  19.         }
  20.     }
  21. }
  22.  
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment