diff --git a/CHANGELOG.md b/CHANGELOG.md index b3161261ae..2f443ed82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ HumHub Changelog - Enh #7257: Move "About" into Space Control Menu - Enh #7262: Disable `Like` on archived content - Enh #7125: Prerequisites - Check test for pending migrations +- Fix #173 : Remove UISetting "Include Captcha in Registr 1.16.3 (Unreleased) -------------------------- diff --git a/MIGRATE-DEV.md b/MIGRATE-DEV.md index 8a9bac2dcd..d219523782 100644 --- a/MIGRATE-DEV.md +++ b/MIGRATE-DEV.md @@ -10,24 +10,20 @@ Version 1.17 (Unreleased) - Forms in modal box no longer have focus automatically on the first field. [The `autofocus` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/autofocus) is now required on the field. More info: [#7136](https://github.com/humhub/humhub/issues/7136) - -#### Removed - -- Removed obsolete property `humhub\modules\content\widgets\richtext\AbstractRichText::$record` -- Removed `\humhub\widgets\ShowMorePager` widget - - -Version 1.17 (Unreleased) -------------------------- - ### New - CSS variables: `--hh-fixed-header-height` and `--hh-fixed-footer-height` (see [#7131](https://github.com/humhub/humhub/issues/7131)): these variables should be added to custom themes in the `variables.less` file to overwrite the fixed header (e.g. the top menu + margins) and footer heights with the ones of the custom theme. +- `\humhub\modules\user\Module::enableRegistrationFormCaptcha` which is true by default (can be disabled via [file configuration](https://docs.humhub.org/docs/admin/advanced-configuration#module-configurations)) + +### Removed +- `Include captcha in registration form` checkbox removed from "Administration" -> "Users" -> "Settings" +- Removed obsolete property `humhub\modules\content\widgets\richtext\AbstractRichText::$record` +- Removed `\humhub\widgets\ShowMorePager` widget Version 1.16 (April 2024) ------------------------- At least PHP 8.0 is required with this version. -#### Removed +### Removed - `\humhub\modules\search\*` The existing search module was removed and the related features merged into the 'content', 'user' and 'space' modules. - `\humhub\modules\user\models\User::getSearchAttributes()` and `\humhub\modules\space\models\Space::getSearchAttributes()` diff --git a/protected/humhub/modules/admin/migrations/m240622_082606_fix_captcha_in_registration.php b/protected/humhub/modules/admin/migrations/m240622_082606_fix_captcha_in_registration.php new file mode 100644 index 0000000000..1008e0ab6e --- /dev/null +++ b/protected/humhub/modules/admin/migrations/m240622_082606_fix_captcha_in_registration.php @@ -0,0 +1,42 @@ +delete('setting', ['name' => 'auth.showCaptureInRegisterForm']); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + echo "m240622_082606_fix_captcha_in_registration cannot be reverted.\n"; + + return false; + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m240622_082606_fix_captcha_in_registration cannot be reverted.\n"; + + return false; + } + */ +} diff --git a/protected/humhub/modules/admin/models/forms/AuthenticationSettingsForm.php b/protected/humhub/modules/admin/models/forms/AuthenticationSettingsForm.php index 09f1b449e9..8d5f79cb8c 100644 --- a/protected/humhub/modules/admin/models/forms/AuthenticationSettingsForm.php +++ b/protected/humhub/modules/admin/models/forms/AuthenticationSettingsForm.php @@ -30,7 +30,6 @@ class AuthenticationSettingsForm extends Model public $hideOnlineStatus; public $defaultUserIdleTimeoutSec; public $allowGuestAccess; - public $showCaptureInRegisterForm; public $defaultUserProfileVisibility; public $registrationSendMessageMailContent; public $registrationApprovalMailContent; @@ -56,7 +55,6 @@ class AuthenticationSettingsForm extends Model $this->hideOnlineStatus = $settingsManager->get('auth.hideOnlineStatus'); $this->defaultUserIdleTimeoutSec = $settingsManager->get('auth.defaultUserIdleTimeoutSec'); $this->allowGuestAccess = $settingsManager->get('auth.allowGuestAccess'); - $this->showCaptureInRegisterForm = $settingsManager->get('auth.showCaptureInRegisterForm'); $this->defaultUserProfileVisibility = $settingsManager->get('auth.defaultUserProfileVisibility'); $this->registrationSendMessageMailContent = $settingsManager->get('auth.registrationSendMessageMailContent', ApproveUserForm::getDefaultSendMessageMailContent()); $this->registrationApprovalMailContent = $settingsManager->get('auth.registrationApprovalMailContent', ApproveUserForm::getDefaultApprovalMessage()); @@ -69,7 +67,7 @@ class AuthenticationSettingsForm extends Model public function rules() { return [ - [['internalUsersCanInviteByEmail', 'internalUsersCanInviteByLink', 'internalAllowAnonymousRegistration', 'internalRequireApprovalAfterRegistration', 'allowGuestAccess', 'showCaptureInRegisterForm', 'showRegistrationUserGroup', 'blockUsers', 'hideOnlineStatus'], 'boolean'], + [['internalUsersCanInviteByEmail', 'internalUsersCanInviteByLink', 'internalAllowAnonymousRegistration', 'internalRequireApprovalAfterRegistration', 'allowGuestAccess', 'showRegistrationUserGroup', 'blockUsers', 'hideOnlineStatus'], 'boolean'], ['defaultUserProfileVisibility', 'in', 'range' => array_keys(User::getVisibilityOptions(false))], ['defaultUserIdleTimeoutSec', 'integer', 'min' => 20], [['registrationSendMessageMailContent', 'registrationApprovalMailContent', 'registrationDenialMailContent'], 'string'], @@ -91,7 +89,6 @@ class AuthenticationSettingsForm extends Model 'hideOnlineStatus' => Yii::t('AdminModule.user', 'Hide online status of users'), 'defaultUserIdleTimeoutSec' => Yii::t('AdminModule.user', 'Default user idle timeout, auto-logout (in seconds, optional)'), 'allowGuestAccess' => Yii::t('AdminModule.user', 'Allow visitors limited access to content without an account (Adds visibility: "Guest")'), - 'showCaptureInRegisterForm' => Yii::t('AdminModule.user', 'Include captcha in registration form'), 'defaultUserProfileVisibility' => Yii::t('AdminModule.user', 'Default user profile visibility'), 'registrationSendMessageMailContent' => Yii::t('AdminModule.user', 'Default content of the email when sending a message to the user'), 'registrationApprovalMailContent' => Yii::t('AdminModule.user', 'Default content of the registration approval email'), @@ -134,10 +131,6 @@ class AuthenticationSettingsForm extends Model $settingsManager->set('auth.defaultUserProfileVisibility', $this->defaultUserProfileVisibility); } - if ($settingsManager->get('auth.anonymousRegistration')) { - $settingsManager->set('auth.showCaptureInRegisterForm', $this->showCaptureInRegisterForm); - } - if ($settingsManager->get('auth.needApproval')) { if (empty($this->registrationSendMessageMailContent) || $this->registrationSendMessageMailContent === ApproveUserForm::getDefaultSendMessageMailContent()) { $this->registrationSendMessageMailContent = ApproveUserForm::getDefaultSendMessageMailContent(); diff --git a/protected/humhub/modules/admin/views/authentication/authentication.php b/protected/humhub/modules/admin/views/authentication/authentication.php index 692ddff067..218c4128ac 100644 --- a/protected/humhub/modules/admin/views/authentication/authentication.php +++ b/protected/humhub/modules/admin/views/authentication/authentication.php @@ -25,8 +25,6 @@ $userModule = Yii::$app->getModule('user'); field($model, 'internalAllowAnonymousRegistration')->checkbox(); ?> - field($model, 'showCaptureInRegisterForm')->checkbox(); ?> - field($model, 'internalUsersCanInviteByEmail')->checkbox(); ?> field($model, 'internalUsersCanInviteByLink')->checkbox(); ?> diff --git a/protected/humhub/modules/installer/libs/InitialData.php b/protected/humhub/modules/installer/libs/InitialData.php index 5f71efa40b..e90b3c86f1 100644 --- a/protected/humhub/modules/installer/libs/InitialData.php +++ b/protected/humhub/modules/installer/libs/InitialData.php @@ -50,7 +50,6 @@ class InitialData Yii::$app->getModule('user')->settings->set('auth.anonymousRegistration', '1'); Yii::$app->getModule('user')->settings->set('auth.internalUsersCanInviteByEmail', '1'); Yii::$app->getModule('user')->settings->set('auth.internalUsersCanInviteByLink', '1'); - Yii::$app->getModule('user')->settings->set('auth.showCaptureInRegisterForm', '1'); // Mailing Yii::$app->settings->set('mailer.transportType', 'php'); diff --git a/protected/humhub/modules/user/Module.php b/protected/humhub/modules/user/Module.php index d08a7a5256..47e73999ad 100644 --- a/protected/humhub/modules/user/Module.php +++ b/protected/humhub/modules/user/Module.php @@ -192,6 +192,12 @@ class Module extends \humhub\components\Module */ public $allowUserRegistrationFromAuthClientIds = []; + /** + * @var bool Include captcha in registration form + * @since 1.17 + */ + public $enableRegistrationFormCaptcha = true; + /** * @var int Time to live in days for invites. * Invites older than this number of days will be automatically deleted. diff --git a/protected/humhub/modules/user/models/Invite.php b/protected/humhub/modules/user/models/Invite.php index c3091d960d..0d1e514b8a 100644 --- a/protected/humhub/modules/user/models/Invite.php +++ b/protected/humhub/modules/user/models/Invite.php @@ -320,7 +320,7 @@ class Invite extends ActiveRecord { return !$this->skipCaptchaValidation - && (Yii::$app->getModule('user')->settings->get('auth.showCaptureInRegisterForm')); + && (Yii::$app->getModule('user')->enableRegistrationFormCaptcha); } public function getCreatedBy() diff --git a/protected/humhub/tests/config/common.php b/protected/humhub/tests/config/common.php index 78b614bdfd..c8ef3914a8 100644 --- a/protected/humhub/tests/config/common.php +++ b/protected/humhub/tests/config/common.php @@ -31,6 +31,7 @@ return [ 'modules' => [ 'user' => [ 'loginRememberMeDefault' => false, + 'enableRegistrationFormCaptcha' => false, ], 'web' => [ 'security' => [