Exemplo n.º 1
0
             $jsQueue->add($userID, HISTORYTYPE_USER, 'OBJECT_CHANGEBGIMAGE', sGuiUS(), 'user', NULL, NULL, $userID . '-user', 'picture', $internPrefix . '/userimage/' . $userID . '/48x48?rnd=' . rand());
             $jsQueue->add($userID, HISTORYTYPE_USER, 'CLEAR_USERINFOS', sGuiUS(), NULL);
         }
     } else {
         $koala->callJSFunction('Koala.yg_setUserProfilePreviewPicture', $itemID, $internPrefix . '/userimage/' . $userID . '/48x48?tmp=true&rnd=' . rand());
     }
     $koala->callJSFunction('Koala.yg_setFileStatusOK', $itemID);
     break;
 case 'uploadUserProfilePicture':
     $filetype = $this->params['type'];
     $filetitle = $this->params['title'];
     if ($_FILES['Filedata']['tmp_name']) {
         $fileTmpName = $_FILES['Filedata']['tmp_name'];
         $filename = basename($_FILES['Filedata']['name']);
     } else {
         $fileTmpName = fixAndMovePLUploads();
         $filename = basename($_REQUEST['name']);
     }
     $filesize = filesize($fileTmpName);
     $uploadID = $this->params['uploadID'];
     $extensionid = $this->params['fileID'];
     $userid = $this->params['userID'];
     $extensionid = explode('-', $extensionid);
     $tsuffix = $extensionid[1];
     $extensionid = $extensionid[0];
     $uploadwinid = $this->request->parameters['uploadWinId'];
     $extensionid = $this->request->parameters['extensionId'];
     $realExtension = explode('.', $filename);
     $realExtension = $realExtension[count($realExtension) - 1];
     $window_id = $this->params['winID'];
     if ($fileTmpName != '' && $fileTmpName != 'none') {
Exemplo n.º 2
0
             $file->properties->setValue("NAME", $filetitle);
             $file->history->add(HISTORYTYPE_FILE, NULL, $filename, 'TXT_FILE_H_REUPLOAD');
             $koala->callJSFunction('Koala.yg_addFileId', $fileid . "-" . $updatedVersion, $uploadID, 'true', $fileinfo['NAME'], $fileinfo['COLOR'], $fileinfo['IDENTIFIER']);
             $koala->queueScript("window.hadUploadError = false;window.hadUploadErrorMsg = undefined;");
         }
     }
     break;
 case 'uploadFile':
     $filetype = $this->params['type'];
     $filetitle = $this->params['title'];
     setlocale(LC_ALL, 'en_US.UTF8');
     if ($_FILES['Filedata']['tmp_name']) {
         $filetmpname = $_FILES['Filedata']['tmp_name'];
         $filename = basename($_FILES['Filedata']['name']);
     } else {
         $filetmpname = fixAndMovePLUploads();
         $filename = basename($_REQUEST['name']);
     }
     $filedir = $this->approot . $this->filesdir;
     $uploadID = $this->params['uploadID'];
     $uploadIndex = $this->params['uploadIndex'];
     $filesqueued = (int) $this->params['filesQueued'];
     $folderid = $this->params['folderId'];
     $chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
     $chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
     if ($chunks != 0 && $chunk != $chunks - 1) {
         break;
     }
     if (!file_exists($filedir) || !is_writable($filedir)) {
         $koala->queueScript("parent.window.hadUploadError = true;");
     } else {