use wcf\system\clipboard\ClipboardHandler;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\PermissionDeniedException;
-use wcf\system\exception\ValidateActionException;
+use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\StringUtil;
*/
public function validateCreate() {
if (!isset($this->parameters['data']['password'])) {
- throw new ValidateActionException("Missing parameter 'password'");
+ throw new UserInputException('password');
}
}
// list might be empty because only our own user id was given
if (empty($userIDs)) {
- throw new ValidateActionException("Invalid object id");
+ throw new UserInputException('objectIDs');
}
// validate groups
}
if (!UserGroup::isAccessibleGroup($groupIDs)) {
- throw new ValidateActionException('Insufficient permissions');
+ throw new PermissionDeniedException();
}
}
$this->readObjects();
if (empty($this->objects)) {
- throw new ValidateActionException('Invalid object id');
+ throw new UserInputException('objectIDs');
}
}
if (count($this->objects) == 1 && ($this->objects[0]->userID == WCF::getUser()->userID)) {
$count = count($this->parameters);
if ($count > 1 || ($count == 1 && !isset($this->parameters['options']))) {
- throw new ValidateActionException('Insufficient permissions');
+ throw new PermissionDeniedException();
}
}
- throw new ValidateActionException('Insufficient permissions');
+ throw new PermissionDeniedException();
}
}
*/
public function validateGetSearchResultList() {
if (!isset($this->parameters['data']['searchString'])) {
- throw new ValidateActionException("Missing parameter 'searchString'");
+ throw new UserInputException('searchString');
}
if (!isset($this->parameters['data']['includeUserGroups'])) {
- throw new ValidateActionException("Missing parameter 'includeUserGroups'");
+ throw new UserInputException('includeUserGroups');
}
if (isset($this->parameters['data']['excludedSearchValues']) && !is_array($this->parameters['data']['excludedSearchValues'])) {
- throw new ValidateActionException("Invalid parameter 'excludedSearchValues' given");
+ throw new UserInputException('excludedSearchValues');
}
}