Ejemplo n.º 1
0
 public function scoutPlayer($player_id)
 {
     $this->downloader->get($this->factory->getRouter()->getPlayer($player_id));
     $this->downloader->get($this->factory->getRouter()->scoutPlayer($player_id));
 }
Ejemplo n.º 2
0
 if (!in_array($_POST['password'], $passwords)) {
     $flash['type'] = 'error';
     $flash['title'] = 'Wrong password.';
     $flash['text'] = 'Foreigners are forbidden here!';
 } else {
     if ($_FILES['filetoupload']['error'] == UPLOAD_ERR_NO_FILE && empty($_POST['filetoupload_url'])) {
         $flash['type'] = 'error';
         $flash['title'] = 'No file.';
         $flash['text'] = 'Hey, if you want to upload a file, you need to send it! We can\'t imagine it ;) .';
     } else {
         if ($_FILES['filetoupload']['error'] == UPLOAD_ERR_FORM_SIZE) {
             $flash['type'] = 'error';
             $flash['title'] = 'This file is too big.';
             $flash['text'] = 'We do not accept overweight files... Max size is 256 Mo.';
         } else {
             if (!empty($_POST['filetoupload_url']) && ($file_content = $downloader->get($_POST['filetoupload_url'], array(), 'curl'))) {
                 $file_content_data = $file_content['body'];
                 $filename = determineFilename($subdir . '/' . basename($file_content['infos']['url']), $file_content_data);
                 if (is_array($filename)) {
                     $fileurl = getFileURL($filename[0], $subdir);
                     $flash['type'] = 'success';
                     $flash['title'] = 'Well done!';
                     $flash['text'] = 'You have already uploaded this file. For the record, the file was uploaded to <a href="' . $fileurl . '">' . $fileurl . '</a>.';
                 } else {
                     if ($file_content['HTTPCode'] != 200) {
                         $flash['type'] = 'error';
                         $flash['title'] = 'Oh snap!';
                         $flash['text'] = 'There was an error while downloading the file. The server returned a <strong>' . $file_content['HTTPCode'] . '</strong> HTTP Status Code. Please try again!';
                     } else {
                         if (!($file = fopen($subdir . '/' . basename($filename), 'w'))) {
                             $flash['type'] = 'error';