Exemplo n.º 1
0
 /**
  * @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::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 (!Regex::compile('\\d')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (lower-case)
     if (!Regex::compile('[a-z]')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (upper-case)
     if (!Regex::compile('[A-Z]')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // special characters
     if (!Regex::compile('[^0-9a-zA-Z]')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // password equals username
     if ($this->masterPassword == WCF::getUser()->username) {
         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_group\n\t\t\t\t\tWHERE\tgroupID = 4\n\t\t\t\t)";
     $statement = WCF::getDB()->prepareStatement($sql);
     $statement->execute();
     while ($row = $statement->fetchArray()) {
         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 wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('users' => $this->users, 'separator' => $this->separator, 'textSeparator' => $this->textSeparator, 'fileType' => $this->fileType));
 }
Exemplo n.º 4
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('className' => $this->className, 'description' => $this->description, 'startMinute' => $this->startMinute, 'startHour' => $this->startHour, 'startDom' => $this->startDom, 'startMonth' => $this->startMonth, 'startDow' => $this->startDow, 'action' => 'add'));
 }
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     if ($this->action == 'install') {
         WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
     } else {
         WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
         $this->activeMenuItem = 'wcf.acp.menu.link.package';
     }
     // check master password
     WCFACP::checkMasterPassword();
     parent::show();
 }
Exemplo n.º 6
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function show()
 {
     // check master password
     WCFACP::checkMasterPassword();
     parent::show();
 }
Exemplo n.º 7
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('masterPassword' => $this->masterPassword, 'url' => $this->url));
 }
Exemplo n.º 8
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('users' => $this->users, 'groups' => $this->groups, 'userIDs' => $this->userIDs, 'groupIDs' => $this->groupIDs, 'subject' => $this->subject, 'text' => $this->text, 'from' => $this->from, 'enableHTML' => $this->enableHTML));
 }
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('loginUsername' => $this->loginUsername, 'loginPassword' => $this->loginPassword, '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));
 }
Exemplo n.º 10
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('users' => $this->users, 'userIDs' => $this->userIDs, 'groupIDs' => $this->groupIDs, 'groups' => $this->groups));
 }