Example #1
0
 public function unblock($phoneId, $managerName, $agentName, $phoneNumbers)
 {
     $dncMsgs = array();
     foreach ($phoneNumbers as $phoneNumber) {
         $sPhoneNumber = preg_replace("/[^0-9]/", "", $phoneNumber);
         $validation = Validator::make(array('phoneNumber' => $sPhoneNumber), ['phoneNumber' => 'required|digits_between:9,12']);
         if ($validation->fails()) {
             array_push($dncMsgs, array('phoneNumber' => $sPhoneNumber, 'err' => 'Invalid'));
         } else {
             WhiteList::insert(['phone_number' => $phoneNumber, 'username' => Auth::user()->username, 'manager_name' => $managerName, 'agent_name' => $agentName, 'sip_id' => $phoneId, 'request_date' => date("Y-m-d"), 'ip_address' => Request::getClientIp()]);
             array_push($dncMsgs, array('phoneNumber' => $sPhoneNumber, 'msg' => 'Unblocked for ' . $phoneId));
         }
     }
     return $dncMsgs;
 }
Example #2
0
 function AddRestrictedPagesTab(&$personal_urls, $title)
 {
     global $wgUser, $wgWhiteListRestrictedGroup;
     $userIsRestricted = in_array($wgWhiteListRestrictedGroup, $wgUser->getGroups());
     if ($wgUser->isLoggedIn() && $userIsRestricted) {
         # In older versions of MW, loading of message files was done differently than the
         # current default. So, let's work around that by forcing the load of the message file.
         WhiteList::loadMessages();
         $personal_urls['mypages'] = array('text' => wfMsg('mywhitelistpages'), 'href' => Skin::makeSpecialUrl('WhiteList'));
     }
     return true;
 }
Example #3
0
 * RUN THIS SCRIPT WITH A CRONJOB!
 * 
 * Run this script every 30 seconds is recommended.
 */
require_once dirname(dirname(__FILE__)) . '/core/init.php';
use T4G\BFP4F\Rcon as rcon;
if ($rc->connect($cn, $cs) && $rc->init()) {
    /**
     * Initialize the classes and stuff...
     */
    $pl = new rcon\Players();
    $ct = new rcon\Chat();
    $sv = new rcon\Server();
    $it = new Itemlist($db, $config);
    $bl = new Blacklist($db, $config);
    $wl = new WhiteList($db, $config);
    /**
     * LIMITERS
     *
     * NOTE: The blacklist comes first before the whitelist
     */
    /**
     * Fetch the players
     */
    $players = $pl->fetch();
    /**
     * Fetch the itemlist
     */
    $itemList = $it->fetchItems();
    $items = $itemList['items'];
    /**