/**
  * @see Form::save()	 
  */
 public function save()
 {
     ACPForm::save();
     $this->spider->update($this->spiderIdentifier, $this->spiderName, $this->spiderURL);
     $this->saved();
     WCF::getTPL()->assign(array('success' => true));
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // update cronjob
     $this->cronjob->update($this->classPath, $this->packageID, $this->description, $this->execMultiple, $this->startMinute, $this->startHour, $this->startDom, $this->startMonth, $this->startDow);
     $this->saved();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // save
     $this->warning->update($this->title, $this->points, $this->expiresHour * 3600 + $this->expiresDay * 86400 + $this->expiresWeek * 86400 * 7);
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // save
     $this->avatarCategory->update($this->title, $this->showOrder, $this->groupID, $this->neededPoints);
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     ACPForm::readData();
     $this->availableTemplatePacks = TemplatePack::getSelectList(array($this->templatePackID));
     // default values
     if (!count($_POST)) {
         $this->templatePackName = $this->templatePack->templatePackName;
         $this->templatePackFolderName = $this->templatePack->templatePackFolderName;
         $this->parentTemplatePackID = $this->templatePack->parentTemplatePackID;
     }
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // save
     $this->smileyCategory->update($this->title, $this->showOrder);
     // reset cache
     SmileyEditor::resetCache();
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // save
     $this->category->update($this->category->categoryName, 'profile', $this->category->categoryIconS, $this->category->categoryIconM, $this->showOrder);
     // update language variable
     require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
     $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
     $language->updateItems(array('wcf.user.option.category.' . $this->category->categoryName => $this->categoryName), 0, PACKAGE_ID, array('wcf.user.option.category.' . $this->category->categoryName => 1));
     // delete cache
     WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.user-option-*');
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see	Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // read form data
     $this->host->title = $this->title;
     $this->host->hostname = $this->hostname;
     $this->host->isFallback = $this->isFallback;
     $this->host->languageCode = $this->languageCode;
     // save
     $this->host->update();
     // show success message
     WCF::getTPL()->assign('success', true);
     // remove cache
     HostEditor::clearCache();
     // call event
     $this->saved();
 }
 /**
  * @see Form::validate()
  */
 public function validate()
 {
     ACPForm::validate();
     if (empty($this->masterPassword)) {
         throw new UserInputException('masterPassword');
     }
     // check password security
     if (StringUtil::length($this->masterPassword) < 8) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // digits
     if (!preg_match('![0-9]+!', $this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (lower-case)
     if (!preg_match('![a-z]+!', $this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (upper-case)
     if (!preg_match('![A-Z]+!', $this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // special characters
     if (!preg_match('![^A-Za-z0-9]+!', $this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // search for identical admin passwords
     $sql = "SELECT\tpassword, salt\n\t\t\tFROM\twcf" . WCF_N . "_user\n\t\t\tWHERE\tuserID IN (\n\t\t\t\t\tSELECT\tuserID\n\t\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\tWHERE\tgroupID = 4\n\t\t\t\t)";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         if (StringUtil::getDoubleSaltedHash($this->masterPassword, $row['salt']) == $row['password']) {
             throw new UserInputException('masterPassword', 'notSecure');
         }
     }
     // confirm master password
     if (empty($this->confirmMasterPassword)) {
         throw new UserInputException('confirmMasterPassword');
     }
     if ($this->confirmMasterPassword != $this->masterPassword) {
         throw new UserInputException('confirmMasterPassword', 'notEqual');
     }
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // get option ids
     $sql = "SELECT\t\toptionName, optionID \n\t\t\tFROM\t\twcf" . WCF_N . "_admin_tools_option acp_option,\n\t\t\t\t\twcf" . WCF_N . "_package_dependency package_dependency\n\t\t\tWHERE \t\tacp_option.packageID = package_dependency.dependency\n\t\t\t\t\tAND package_dependency.packageID = " . PACKAGE_ID . "\n\t\t\tORDER BY\tpackage_dependency.priority";
     $result = WCF::getDB()->sendQuery($sql);
     $optionIDArray = array();
     while ($row = WCF::getDB()->fetchArray($result)) {
         $optionIDArray[$row['optionName']] = $row['optionID'];
     }
     // save
     foreach ($this->options as $name => $value) {
         if (isset($optionIDArray[$name])) {
             $sql = "UPDATE\twcf" . WCF_N . "_admin_tools_option\n\t\t\t\t\tSET\toptionValue = '" . escapeString($value) . "'\n\t\t\t\t\tWHERE\toptionID = " . $optionIDArray[$name];
             WCF::getDB()->sendQuery($sql);
         }
     }
     // reset cache
     WCF::getCache()->clear(WCF_DIR . 'cache/', 'cache.admin_tools-option*');
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('packages' => $this->packages, 'styles' => $this->styles, 'defaultStyleIDArray' => $this->defaultStyleIDArray, 'disabledStyleIDArray' => $this->disabledStyleIDArray));
 }
 /**
  * @see Form::show()
  */
 public function show()
 {
     // permission
     WCF::getUser()->checkPermission('admin.system.adminTools.canView');
     // enable menu item
     WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.adminTools');
     // show form
     parent::show();
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // save cronjob
     CronjobEditor::create($this->classPath, $this->packageID, $this->description, $this->execMultiple, $this->startMinute, $this->startHour, $this->startDom, $this->startMonth, $this->startDow);
     $sql = "SELECT cronjobs.cronjobID, package.packageDir FROM wcf" . WCF_N . "_cronjobs cronjobs\n\t\t\t\tLEFT JOIN wcf" . WCF_N . "_package package\n\t\t\t\tON (package.packageID = cronjobs.packageID)\n\t\t\t\t WHERE cronjobs.classPath = '" . $this->classPath . "'\t\t\t\t \n\t\t\t\t AND cronjobs.packageID = " . $this->packageID;
     $row = WCF::getDB()->getFirstRow($sql);
     $cronjobID = $row['cronjobID'];
     $cronjob = new CronjobEditor($cronjobID);
     $cronjob->update($row['packageDir'] . 'lib/system/cronjob/AdminToolsCronjob' . $cronjobID . '.class.php', $this->packageID, $this->description, $this->execMultiple, $this->startMinute, $this->startHour, $this->startDom, $this->startMonth, $this->startDow);
     $inserts = '';
     foreach ($this->activeFunctions as $functionID) {
         if (!empty($inserts)) {
             $inserts .= ',';
         }
         $inserts .= '(' . $functionID . ', ' . $cronjobID . ')';
     }
     $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_admin_tools_function_to_cronjob\n\t\t\t\t\t(functionID, cronjobID)\n\t\t\t\t\tVALUES " . $inserts;
     WCF::getDB()->sendQuery($sql);
     $path = FileUtil::getRealPath(WCF_DIR . $row['packageDir']);
     $fileName = $path . 'lib/system/cronjob/AdminToolsCronjob' . $cronjobID . '.class.php';
     $this->writeCronjob($cronjobID, $fileName);
     $this->saved();
     // reset values
     $this->classPath = $this->description = '';
     $this->execMultiple = 0;
     $this->startMinute = $this->startHour = $this->startDom = $this->startMonth = $this->startDow = '*';
     // show success.
     WCF::getTPL()->assign(array('success' => true));
     $this->activeFunctions = array();
     $this->wcfCronjob = 0;
 }
 /**
  * @see Form::validate()
  */
 public function validate()
 {
     parent::validate();
     // templates
     if (!$this->allTemplates) {
         if (empty($this->templateID)) {
             throw new UserInputException('templateID');
         }
     }
     // query
     if (empty($this->query)) {
         throw new UserInputException('query');
     }
     // test regex
     if ($this->useRegex) {
         try {
             preg_match('/' . $this->query . '/', '');
         } catch (SystemException $e) {
             throw new UserInputException('query', 'invalidRegex');
         }
     }
     if ($this->invertSearch) {
         $this->replace = 0;
     }
     // get results
     $results = TemplateEditor::search($this->query, $this->replace ? $this->replaceBy : null, $this->allTemplates ? null : $this->templateID, $this->invertTemplates, $this->useRegex, $this->caseSensitive, $this->invertSearch);
     if (count($results)) {
         WCF::getTPL()->assign('templates', $results);
         WCF::getTPL()->display('templateSearchResult');
         exit;
     } else {
         WCF::getTPL()->assign('noMatches', true);
     }
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign('delimeter', $this->delimeter);
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('users' => $this->users, 'userIDs' => $this->userIDs, 'groupIDs' => $this->groupIDs, 'groups' => $this->groups));
 }
 /**
  * @see	Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     InlineCalendar::assignVariables();
     WCF::getTPL()->assign(array('availableTypes' => $this->types, 'type' => $this->type, 'fromDay' => $this->fromDay, 'fromMonth' => $this->fromMonth, 'fromYear' => $this->fromYear, 'untilDay' => $this->untilDay, 'untilMonth' => $this->untilMonth, 'untilYear' => $this->untilYear, 'sortField' => $this->sortField, 'sortOrder' => $this->sortOrder, 'groupBy' => $this->groupBy, 'username' => $this->username));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('groups' => $this->groups, 'groupID' => $this->groupID, 'neededPoints' => $this->neededPoints, 'filename' => $this->filename, 'avatarCategoryID' => $this->avatarCategoryID, 'availableAvatarCategories' => AvatarCategory::getAvatarCategories()));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('htUsername' => $this->htUsername, 'htPassword' => $this->htPassword, 'saveAuthData' => $this->saveAuthData, 'packageUpdateServerID' => $this->packageUpdateServerID, 'url' => $this->url, 'realm' => $this->realm, 'message' => $this->message, 'requestMethod' => WCF::getSession()->requestMethod, 'postParameters' => $this->postParameters, 'getParameters' => $this->getParameters));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('action' => 'add', 'categoryName' => $this->categoryName, 'showOrder' => $this->showOrder));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('styleID' => $this->styleID, 'style' => $this->style, 'exportTemplates' => $this->exportTemplates, 'exportImages' => $this->exportImages, 'exportIcons' => $this->exportIcons, 'canExportTemplates' => $this->canExportTemplates, 'canExportIcons' => $this->canExportIcons, 'templatePackName' => $this->templatePackName, 'imagesLocation' => $this->imagesLocation, 'iconsLocation' => $this->iconsLocation));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('enable' => $this->enable, 'languageIDs' => $this->languageIDs, 'languages' => $this->languageList));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('optionName' => $this->optionName, 'optionDescription' => $this->optionDescription, 'categoryName' => $this->categoryName, 'optionType' => $this->optionType, 'defaultValue' => $this->defaultValue, 'validationPattern' => $this->validationPattern, 'optionType' => $this->optionType, 'selectOptions' => $this->selectOptions, 'required' => $this->required, 'askDuringRegistration' => $this->askDuringRegistration, 'editable' => $this->editable, 'visible' => $this->visible, 'searchable' => $this->searchable, 'showOrder' => $this->showOrder, 'action' => 'add', 'categories' => $this->categories, 'optionTypes' => self::$optionTypes, 'optionTypesUsingSelectOptions' => self::$optionTypesUsingSelectOptions, 'showLineBreaks' => $this->showLineBreaks, 'textFormat' => $this->textFormat, 'outputClassSelectable' => true));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('users' => $this->users, 'userIDs' => implode(',', $this->userIDs), 'userID' => $this->userID));
 }
 /**
  * @see	Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('title' => $this->title, 'allowSpidersToIndexThisPage' => $this->allowSpidersToIndexThisPage, 'additionalHeadContent' => $this->additionalHeadContent, 'isPublic' => $this->isPublic, 'isDefaultPage' => $this->isDefaultPage, 'menuItemTitle' => $this->menuItemTitle, 'menuItemIconS' => $this->menuItemIconS, 'menuItemIconM' => $this->menuItemIconM, 'menuItemSortOrder' => $this->menuItemSortOrder, 'menuItemPosition' => $this->menuItemPosition, 'host' => $this->host, 'hostID' => $this->hostID, 'createMenuItem' => $this->createMenuItem));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('action' => 'add', 'title' => $this->title, 'showOrder' => $this->showOrder, 'groups' => $this->groups, 'groupID' => $this->groupID, 'neededPoints' => $this->neededPoints));
 }
 /**
  * @see Page::show()
  */
 public function show()
 {
     // check master password
     WCFACP::checkMasterPassword();
     parent::show();
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // read variables
     $this->page->title = $this->title;
     $this->page->allowSpidersToIndexThisPage = $this->allowSpidersToIndexThisPage;
     $this->page->additionalHeadContent = $this->additionalHeadContent;
     $this->page->isPublic = $this->isPublic;
     $this->page->isDefaultPage = $this->isDefaultPage;
     // update
     $this->page->update();
     // handle isDefaultPage checkbox
     if ($this->isDefaultPage) {
         $sql = "UPDATE\r\n\t\t\t\t\t\twcf" . WCF_N . "_page\r\n\t\t\t\t\tSET\r\n\t\t\t\t\t\tisDefaultPage = 0\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tpageID NOT IN (" . $this->page->pageID . ")";
         WCF::getDB()->sendQuery($sql);
     }
     DynamicPageEditor::clearCache($this->page->pageID, $this->page->hostID);
     if ($this->menuEntry !== null) {
         // create language variable name
         $lang = 'wcf.header.menu.host' . $this->page->hostID . '.page' . $this->pageID;
         // get menu entry title
         $title = empty($this->menuItemTitle) ? $this->title : $this->menuItemTitle;
         // update menu entry
         $this->menuEntry->update($lang, $this->menuEntry->menuItemLink, $this->menuItemIconS, $this->menuItemIconM, $this->menuItemSortOrder, $this->menuItemPosition);
         // enable or disable entry
         $this->menuEntry->enable($this->isPublic);
         // update language
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
         $language->updateItems(array($lang => $title));
         // clear cache
         PageMenuItemEditor::clearCache();
     }
     if ($this->createMenuItem) {
         // build language var
         $lang = 'wcf.header.menu.host' . $this->page->hostID . '.page' . $item->pageID;
         $title = empty($this->menuItemTitle) ? $this->title : $this->menuItemTitle;
         // create menu item
         $menuItem = PageMenuItemEditor::create($lang, 'index.php?page=CMS&pageID=' . $this->pageID, $this->menuItemIconS, $this->menuItemIconM, $this->menuItemSortOrder, $this->menuItemPosition);
         $menuItemID = $menuItem->menuItemID;
         // clear cache
         PageMenuItemEditor::clearCache();
         // create language var
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         // save language variable
         $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
         $language->updateItems(array($lang => $title));
         // include host
         require_once WCF_DIR . 'lib/data/host/Host.class.php';
         // remove menu item ID cache
         Host::removeMenuItemIDCache();
     }
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $this->renderBoards();
     WCF::getTPL()->assign(array('boardStructure' => $this->boardStructure, 'boards' => $this->boardList, 'groupID' => $this->groupID, 'group' => $this->group, 'globalPermissions' => $this->globalPermissions, 'boardPermissions' => $this->activeBoardPermissions, 'type' => 'group', 'permissionName' => $this->permissionName, 'groups' => $this->groups, 'availablePermissions' => $this->permissionSettings));
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get available groups
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
     if (!count($_POST)) {
         // default value
         $this->groupID = Group::getGroupIdByType(Group::USERS);
     }
 }