/** * @see Page::readParameters() */ public function readParameters() { $this->wbbExists = AttachmentManager::wbbExists(); parent::readParameters(); if (!WCF::getUser()->userID) { require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php'; throw new PermissionDeniedException(); } $this->am = new AttachmentManager(); if (isset($_REQUEST['sortField'])) { $this->sortField = $_REQUEST['sortField']; } if (isset($_REQUEST['sortOrder'])) { $this->sortOrder = $_REQUEST['sortOrder']; } if (isset($_REQUEST['userID'])) { $this->userID = $_REQUEST['userID']; } if (isset($_POST['username'])) { $this->username = $_POST['username']; } if (isset($_REQUEST['showOnlyMessageType'])) { $this->showOnlyMessageType = $_REQUEST['showOnlyMessageType']; } else { if (WCF::getSession()->getVar('showOnlyMessageType')) { $this->showOnlyMessageType = WCF::getSession()->getVar('showOnlyMessageType'); } } if (isset($_REQUEST['showOnlyFileType'])) { $this->showOnlyFileType = $_REQUEST['showOnlyFileType']; } else { if (WCF::getSession()->getVar('showOnlyFileType')) { $this->showOnlyFileType = WCF::getSession()->getVar('showOnlyFileType'); } } if (isset($_REQUEST['showOnlyImages'])) { $this->showOnlyImages = $_REQUEST['showOnlyImages']; } else { if (WCF::getSession()->getVar('showOnlyImages')) { $this->showOnlyImages = WCF::getSession()->getVar('showOnlyImages'); } } if ($this->wbbExists && isset($_REQUEST['showThumbnails'])) { $this->showThumbnails = $_REQUEST['showThumbnails']; } else { if ($this->wbbExists && WCF::getSession()->getVar('showThumbnails')) { $this->showThumbnails = WCF::getSession()->getVar('showThumbnails'); } } if (isset($_POST['fDo'])) { if ($_POST['fDo'] == 'delete' && isset($_POST['delAttachment']) && is_array($_POST['delAttachment'])) { WCF::getUser()->checkPermission('admin.general.attachmentManager.canDelete'); $ret = $this->am->deleteAttachments($this->userID, $_POST['delAttachment']); if ($ret['CODE'] == RET_ERROR) { $this->tplError = '<p class="error">' . $ret['MSG'] . '</p>'; } else { if ($ret['CODE'] == RET_WARNING) { $this->tplWarning = '<p class="warning">' . $ret['MSG'] . '</p>'; } else { if ($ret['CODE'] == RET_INFO) { $this->tplInfo = '<p class="success">' . $ret['MSG'] . '</p>'; } } } } else { if ($_POST['fDo'] == 'setFilter') { if (empty($_POST['showOnlyImages'])) { $this->showOnlyImages = 0; } else { $this->showOnlyImages = 1; } if (!empty($this->username)) { $tmp = $this->am->getUserByName($this->username); if (!empty($tmp['userID'])) { $this->userID = $tmp['userID']; $this->username = $tmp['username']; } else { $this->userID = 0; $this->username = ''; } } else { $this->userID = 0; $this->username = ''; } } else { if ($_POST['fDo'] == 'switchThumbnails') { if (empty($_POST['showThumbnails'])) { $this->showThumbnails = 0; } else { $this->showThumbnails = 1; } } } } } if (!empty($this->userID)) { $tmp = $this->am->getUserById($this->userID); if (!empty($tmp['userID'])) { $this->userID = $tmp['userID']; $this->username = $tmp['username']; } } }