/** * @see wcf\form\IForm::save() */ public function save() { ACPForm::save(); // update cronjob $data = array('className' => $this->className, 'description' => $this->description, 'startMinute' => $this->startMinute, 'startHour' => $this->startHour, 'startDom' => $this->startDom, 'startMonth' => $this->startMonth, 'startDow' => $this->startDow); $this->objectAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data)); $this->objectAction->executeAction(); $this->saved(); // show success WCF::getTPL()->assign(array('success' => true)); }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // save server $this->objectAction = new PackageUpdateServerAction(array(), 'create', array('data' => array('serverURL' => $this->serverURL, 'loginUsername' => $this->loginUsername, 'loginPassword' => $this->loginPassword))); $this->objectAction->executeAction(); $this->saved(); // reset values $this->serverURL = $this->loginUsername = $this->loginPassword = ''; // show success message WCF::getTPL()->assign('success', true); }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // update session WCF::getSession()->register('masterPassword', 1); WCF::getSession()->update(); WCF::getSession()->disableUpdate(); // forward if (empty($this->url)) { $this->url = LinkHandler::getInstance()->getLink('Index'); } HeaderUtil::redirect($this->url, false); exit; }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // send content type header('Content-Type: text/' . $this->fileType . '; charset=UTF-8'); header('Content-Disposition: attachment; filename="export.' . $this->fileType . '"'); if ($this->fileType == 'xml') { echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<addresses>\n"; } $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", array($this->userIDs)); // count users $sql = "SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf" . WCF_N . "_user\n\t\t\t" . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $count = $statement->fetchArray(); // get users $sql = "SELECT\t\temail\n\t\t\tFROM\t\twcf" . WCF_N . "_user\n\t\t\t" . $conditions . "\n\t\t\tORDER BY\temail"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $i = 0; while ($row = $statement->fetchArray()) { if ($this->fileType == 'xml') { echo "<address><![CDATA[" . StringUtil::escapeCDATA($row['email']) . "]]></address>\n"; } else { echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $count['count'] ? $this->separator : ''); } $i++; } if ($this->fileType == 'xml') { echo "</addresses>"; } $this->saved(); // remove items ClipboardHandler::getInstance()->removeItems($this->typeID); exit; }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // save cronjob $data = array('className' => $this->className, 'packageID' => $this->packageID, 'description' => $this->description, 'startMinute' => $this->startMinute, 'startHour' => $this->startHour, 'startDom' => $this->startDom, 'startMonth' => $this->startMonth, 'startDow' => $this->startDow); $this->objectAction = new CronjobAction(array(), 'create', array('data' => $data)); $this->objectAction->executeAction(); $this->saved(); // reset values $this->className = $this->description = ''; $this->startMinute = $this->startHour = $this->startDom = $this->startMonth = $this->startDow = '*'; // show success. WCF::getTPL()->assign(array('success' => true)); }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // get new process no $processNo = PackageInstallationQueue::getNewProcessNo(); // obey foreign key $packageID = $this->packageID ? $this->packageID : null; // insert queue $this->queue = PackageInstallationQueueEditor::create(array('processNo' => $processNo, 'userID' => WCF::getUser()->userID, 'package' => $this->archive->getPackageInfo('name'), 'packageName' => $this->archive->getLocalizedPackageInfo('packageName'), 'packageID' => $packageID, 'archive' => !empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage, 'action' => $this->package != null ? 'update' : 'install', 'confirmInstallation' => 1, 'cancelable' => $this->package != null ? 0 : 1)); $this->saved(); // open queue $url = LinkHandler::getInstance()->getLink('Package', array(), 'action=openQueue&processNo=' . $processNo); HeaderUtil::redirect($url); exit; }
/** * @see wcf\form\IForm::save() */ public function save() { if (isset($_POST['send'])) { parent::save(); // save stack $processNo = $this->packageUpdate->savePackageInstallationStack(); $this->saved(); // open queue $url = LinkHandler::getInstance()->getLink('Package', array(), 'action=openQueue&processNo=' . $processNo); HeaderUtil::redirect($url); exit; } }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // save config in session $userMailData = WCF::getSession()->getVar('userMailData'); if ($userMailData === null) { $userMailData = array(); } $mailID = count($userMailData); $userMailData[$mailID] = array('action' => $this->action, 'userIDs' => $this->userIDs, 'groupIDs' => implode(',', $this->groupIDs), 'subject' => $this->subject, 'text' => $this->text, 'from' => $this->from, 'enableHTML' => $this->enableHTML); WCF::getSession()->register('userMailData', $userMailData); $this->saved(); WCF::getTPL()->assign('mailID', $mailID); }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // save $this->objectAction = new OptionAction(array(), 'import', array('data' => $this->options)); $this->objectAction->executeAction(); $this->saved(); // show success message WCF::getTPL()->assign('success', true); }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); // save search $search = SearchEditor::create(array('userID' => WCF::getUser()->userID, 'searchData' => $this->packageUpdateServerIDs, 'searchTime' => TIME_NOW, 'searchType' => 'packages')); $this->saved(); // forward $url = LinkHandler::getInstance()->getLink('PackageUpdateSearchResult', array('id' => $search->searchID)); HeaderUtil::redirect($url); exit; }
/** * @see wcf\form\IForm::save() */ public function save() { parent::save(); $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", array($this->userIDs)); $sql = "SELECT\tuserID, groupID\n\t\t\tFROM\twcf" . WCF_N . "_user_to_group\n\t\t\t" . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $groups = array(); while ($row = $statement->fetchArray()) { $groups[$row['userID']][] = $row['groupID']; } foreach ($this->users as $user) { if (!UserGroup::isAccessibleGroup($groups[$user->userID])) { throw new PermissionDeniedException(); } $groupsIDs = array_merge($groups[$user->userID], $this->groupIDs); $groupsIDs = array_unique($groupsIDs); $userEditor = new UserEditor($user); $userEditor->addToGroups($groupsIDs, true, false); } ClipboardHandler::getInstance()->removeItems($this->typeID); SessionHandler::resetSessions($this->userIDs); $this->saved(); WCF::getTPL()->assign('message', 'wcf.acp.user.assignToGroup.success'); WCF::getTPL()->display('success'); exit; }