/** * Updates whitelist object according to input * @param Whitelist $whitelist * @return $this */ public function updateWhitelist(Whitelist $whitelist) { $this->whitelist = $whitelist; $this->players = []; $i = 0; foreach ($whitelist->getPlayers() as $player) { $player->complete(); $this->players[$i]['name'] = $player->getName(); $this->players[$i++]['uuid'] = $player->getUuid()->getFormatted(); } return $this; }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ require_once '../core/init.php'; $user->checkLogin(true); // Check his rights if ($userInfo['rights_whitelist'] == 'no') { header('Location: ' . HOME_URL . 'panel/accessDenied.php'); die; } // Fetch the whitelist users $list = new Whitelist($db, $config); $players = $list->fetchList(); // Initialize the Accounts class $acc = new Accounts($db, $config); $pageTitle = $lang['tool_wlist']; include CORE_DIR . '/cp_header.php'; ?> <div class="row"> <div class="col-md-12"> <h2><i class="fa fa-check-square-o"></i> <?php echo $lang['tool_wlist']; ?> <small><?php echo $lang['tool_wlist_desc'];
/** * Returns the data model based on the primary key given in the GET * variable. If the data model is not found, an HTTP exception will be * raised. * * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Whitelist::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php # Load the Class include '../Whitelist.php'; # Setup a New WhiteList $whitelist = new Whitelist('whitelist'); $whitelist->Add('google.com'); # Add a Custom entry address. $site = 'google.be'; # Example string to test against # Verify against WhiteList if ($whitelist->Verify($site)) { echo $site . ' is whitelisted.'; } else { echo $site . ' is NOT whitelisted.'; }
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ require_once '../../core/init.php'; use T4G\BFP4F\Rcon as rcon; $sv = new rcon\Server(); header('Content-type: application/json'); // Logs class $log = new Log($db, $config); // Whitelist class $wl = new Whitelist($db, $config); // Blacklist class $bl = new Blacklist($db, $config); // Accounts class $acc = new Accounts($db, $config); // Default response template $response = array('status' => 'ERROR', 'msg' => ''); if ($user->checkLogin()) { if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cmd']) && isset($_POST['vars'])) { $sv = new rcon\Server(); $pl = new rcon\Players(); $ct = new rcon\Chat(); // Commands switch ($_POST['cmd']) { /** * Add a VIP