public function procMemberAdminInsertDefaultConfig()
 {
     $args = Context::gets('enable_join', 'enable_confirm', 'webmaster_name', 'webmaster_email', 'password_strength', 'password_hashing_algorithm', 'password_hashing_work_factor', 'password_hashing_auto_upgrade');
     $oPassword = new Password();
     if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) {
         $args->password_hashing_algorithm = 'md5';
     }
     $args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
     if ($args->password_hashing_work_factor < 4) {
         $args->password_hashing_work_factor = 4;
     }
     if ($args->password_hashing_work_factor > 16) {
         $args->password_hashing_work_factor = 16;
     }
     if ($args->password_hashing_auto_upgrade != 'Y') {
         $args->password_hashing_auto_upgrade = 'N';
     }
     if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') {
         return new Object(-1, 'msg_mail_authorization');
     }
     $oModuleController = getController('module');
     $output = $oModuleController->updateModuleConfig('member', $args);
     // default setting end
     $this->setMessage('success_updated');
     $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDefaultConfig');
     $this->setRedirectUrl($returnUrl);
 }
Beispiel #2
0
 /**
  * Set the default config.
  *
  * @return void
  */
 public function dispMemberAdminConfig()
 {
     $oPassword = new Password();
     Context::set('password_hashing_algos', $oPassword->getSupportedAlgorithms());
     $this->setTemplateFile('default_config');
 }