/** * @see Action::execute() */ public function execute() { parent::execute(); // get ids $sql = "SELECT\tpm.pmID\n\t\t\tFROM\twcf" . WCF_N . "_pm pm\n\t\t\tWHERE\tpm.parentPmID = " . $this->parentPmID . "\n\t\t\t\tAND (\n\t\t\t\t\t(pm.userID = " . WCF::getUser()->userID . " AND pm.saveInOutbox = 1)\n\t\t\t\t\tOR pm.pmID IN (\n\t\t\t\t\t\tSELECT\tpmID\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_pm_to_user\n\t\t\t\t\t\tWHERE\trecipientID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND isDeleted < 2\n\t\t\t\t\t)\n\t\t\t\t)"; $result = WCF::getDB()->sendQuery($sql); while ($row = WCF::getDB()->fetchArray($result)) { $this->pmIDArray[] = $row['pmID']; } if (!count($this->pmIDArray)) { throw new IllegalLinkException(); } // download PMAction::downloadAll(implode(',', $this->pmIDArray)); }