Exemplo n.º 1
0
 public function delete($user)
 {
     if (!valid::user($user)) {
         $this->error = 'This user does not already exist.';
         return false;
     }
     if (!$this->exists($user)) {
         $this->error = 'This user does not already exist.';
         return false;
     }
     file_put_contents($this->path, preg_replace('/' . $user . ':[^\\r\\n]*[\\r\\n]*/m', '', file_get_contents($this->path)));
     $this->readfile();
     return true;
 }