/**
* Validates parameters to load comments.
+ *
+ * @throws PermissionDeniedException
*/
public function validateLoadComments() {
$this->readInteger('lastCommentTime', false, 'data');
/**
* Validates the `loadComment` action.
+ *
+ * @throws PermissionDeniedException
*/
public function validateLoadComment() {
$this->readInteger('objectID', false, 'data');
/**
* Validates parameters to add a comment.
+ *
+ * @throws PermissionDeniedException
*/
public function validateAddComment() {
CommentHandler::enforceFloodControl();
/**
* Validates parameters to add a response.
+ *
+ * @throws PermissionDeniedException
*/
public function validateAddResponse() {
CommentHandler::enforceFloodControl();
];
}
+ /**
+ * Publishes a response.
+ */
public function triggerPublicationResponse() {
if (!empty($this->parameters['commentProcessor'])) {
$objectType = null;
}
}
+ /**
+ * Validates the `enable` action.
+ *
+ * @throws PermissionDeniedException
+ */
public function validateEnable() {
$this->comment = $this->getSingleObject()->getDecoratedObject();
}
}
+ /**
+ * Enables a comment.
+ *
+ * @return integer[]
+ */
public function enable() {
if ($this->comment === null) $this->comment = reset($this->objects);
return ['commentID' => $this->comment->commentID];
}
+ /**
+ * Validates the `enableResponse` action.
+ *
+ * @throws PermissionDeniedException
+ * @throws UserInputException
+ */
public function validateEnableResponse() {
$this->readInteger('responseID', false, 'data');
$this->response = new CommentResponse($this->parameters['data']['responseID']);
}
}
+ /**
+ * Enables a response.
+ *
+ * @return integer[]
+ */
public function enableResponse() {
if ($this->comment === null) $this->comment = reset($this->objects);
if ($this->response === null) $this->response = reset($this->parameters['responses']);
/**
* Validates parameters to edit a comment or a response.
+ *
+ * @throws PermissionDeniedException
+ * @throws UserInputException
*/
public function validatePrepareEdit() {
// validate response id
/**
* Validates parameters to remove a comment or response.
+ *
+ * @throws PermissionDeniedException
+ * @throws UserInputException
*/
public function validateRemove() {
// validate comment id or response id
/**
* Validates the 'getGuestDialog' action.
+ *
+ * @throws PermissionDeniedException
*/
public function validateGetGuestDialog() {
if (WCF::getUser()->userID) {
/**
* Validates comment id parameter.
+ *
+ * @throws UserInputException
*/
protected function validateCommentID() {
$this->readInteger('commentID', false, 'data');
/**
* Validates response id parameter.
+ *
+ * @throws UserInputException
*/
protected function validateResponseID() {
if (isset($this->parameters['data']['responseID'])) {
/**
* Validates the captcha challenge.
+ *
+ * @throws SystemException
*/
protected function validateCaptcha() {
if (WCF::getUser()->userID) return;
/**
* Validates user profile preview.
+ *
+ * @throws UserInputException
*/
public function validateGetUserProfile() {
WCF::getSession()->checkPermissions(['user.profile.canViewUserProfile']);
/**
* Validates detailed activity point list
+ *
+ * @throws UserInputException
*/
public function validateGetDetailedActivityPointList() {
if (count($this->objectIDs) != 1) {
/**
* Validates parameters to begin profile inline editing.
+ *
+ * @throws PermissionDeniedException
+ * @throws UserInputException
*/
public function validateBeginEdit() {
if (!empty($this->objectIDs) && count($this->objectIDs) == 1) {
/**
* Validates parameters to save changes to user profile.
+ *
+ * @throws PermissionDeniedException
*/
public function validateSave() {
$this->validateBeginEdit();
}
}
+ /**
+ * Validates the `deleteCoverPhoto` action.
+ *
+ * @throws PermissionDeniedException
+ */
public function validateDeleteCoverPhoto() {
if (!MODULE_USER_COVER_PHOTO) {
throw new PermissionDeniedException();
}
}
+ /**
+ * Deletes the cover photo of the active user.
+ *
+ * @return string[] link to the new cover photo
+ */
public function deleteCoverPhoto() {
if (WCF::getUser()->coverPhotoHash) {
UserProfileRuntimeCache::getInstance()->getObject(WCF::getUser()->userID)->getCoverPhoto()->delete();