Advertisement
Guest User

Untitled

a guest
May 7th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. class Minecraft{
  3.     private $whitelistDir='survival-server/white-list.txt';
  4.     private $blacklistDir='survival-server/banned-players.txt';
  5.     private $serverUpdateLog='survival-server/server-update-log.txt';
  6.    
  7.    
  8.     public function updateWhitelist($action,$u){
  9.         $whitelist=file($this->whitelistDir);
  10.         $data=1;
  11.         $exists=false;
  12.    
  13.         if($action=='add'){
  14.             foreach($whitelist as $filenr){
  15.                 if(strpos($filenr, $u)===false){continue;}
  16.                 $exists=true;
  17.                 break;
  18.             }
  19.             if($exists){$data='Brukar er allereie lagt til!';}else{
  20.                 file_put_contents($this->whitelistDir,$u."\r\n",FILE_APPEND);
  21.                 $data='Brukaren har blitt lagt til!';
  22.             }
  23.         }elseif($action=='remove'){
  24.             //ations
  25.         }elseif($action=='fresh'){
  26.             //actions
  27.         }elseif($action=='displayList'){
  28.             //actions
  29.         }
  30.        
  31.         return $data;
  32.     }
  33.    
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement