From: James D. Forrester Date: Mon, 20 Nov 2017 23:34:06 +0000 (-0800) Subject: Preferences: Don't show the watchlist token; just link to ResetTokens X-Git-Tag: 1.31.0-rc.0~1425^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=e8c9102fc7b66460c33f643b0dea7190cb89ac83;p=lhc%2Fweb%2Fwiklou.git Preferences: Don't show the watchlist token; just link to ResetTokens Also make both the PasswordReset and ResetTokens forms appropriately flag their action buttons as destructive. Bug: T180710 Change-Id: I26649900f9360e5175fa93b87dc7840a7c1d4f93 --- diff --git a/includes/Preferences.php b/includes/Preferences.php index e383f03f6b..924e3adcf8 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1134,18 +1134,20 @@ class Preferences { $defaultPreferences['watchlisttoken'] = [ 'type' => 'api', ]; + + $tokenButton = new OOUI\ButtonWidget( [ + 'href' => SpecialPage::getTitleFor( 'ResetTokens' )->getLinkURL( [ + 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText() + ] ), + 'label' => $context->msg( 'prefs-watchlist-managetokens' )->text(), + ] ); $defaultPreferences['watchlisttoken-info'] = [ 'type' => 'info', 'section' => 'watchlist/tokenwatchlist', 'label-message' => 'prefs-watchlist-token', - 'default' => $user->getTokenFromOption( 'watchlisttoken' ), - 'help-message' => 'prefs-help-watchlist-token2', - ]; - $defaultPreferences['watchlisttoken-info2'] = [ - 'type' => 'info', - 'section' => 'watchlist/tokenwatchlist', + 'help-message' => 'prefs-help-tokenmanagement', 'raw' => true, - 'default' => $context->msg( 'prefs-help-watchlist-token2' )->parse(), + 'default' => (string)$tokenButton, ]; } } diff --git a/includes/specials/SpecialPasswordReset.php b/includes/specials/SpecialPasswordReset.php index a4f16bd7c9..bf8dea62f1 100644 --- a/includes/specials/SpecialPasswordReset.php +++ b/includes/specials/SpecialPasswordReset.php @@ -110,6 +110,8 @@ class SpecialPasswordReset extends FormSpecialPage { public function alterForm( HTMLForm $form ) { $resetRoutes = $this->getConfig()->get( 'PasswordResetRoutes' ); + $form->setSubmitDestructive(); + $form->addHiddenFields( $this->getRequest()->getValues( 'returnto', 'returntoquery' ) ); $i = 0; diff --git a/includes/specials/SpecialResetTokens.php b/includes/specials/SpecialResetTokens.php index 964a261a6b..d5b0903588 100644 --- a/includes/specials/SpecialResetTokens.php +++ b/includes/specials/SpecialResetTokens.php @@ -121,6 +121,7 @@ class SpecialResetTokens extends FormSpecialPage { * @param HTMLForm $form */ protected function alterForm( HTMLForm $form ) { + $form->setSubmitDestructive(); if ( $this->getTokensList() ) { $form->setSubmitTextMsg( 'resettokens-resetbutton' ); } else { diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 021a115f39..261f74b950 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1025,6 +1025,7 @@ "prefs-watchlist-edits": "Maximum number of changes to show in watchlist:", "prefs-watchlist-edits-max": "Maximum number: 1000", "prefs-watchlist-token": "Watchlist token:", + "prefs-watchlist-managetokens": "Manage tokens", "prefs-misc": "Misc", "prefs-resetpass": "Change password", "prefs-changeemail": "Change or remove email address", @@ -1042,7 +1043,7 @@ "recentchangesdays-max": "Maximum $1 {{PLURAL:$1|day|days}}", "recentchangescount": "Number of edits to show by default:", "prefs-help-recentchangescount": "This includes recent changes, page histories, and logs.", - "prefs-help-watchlist-token2": "This is the secret key to the web feed of your watchlist.\nAnyone who knows it will be able to read your watchlist, so do not share it.\nIf you need to, [[Special:ResetTokens|you can reset it]].", + "prefs-help-tokenmanagement": "You can see and reset the secret key for your account that can access the Web feed of your watchlist. Anyone who knows the key will be able to read your watchlist, so do not share it.", "savedprefs": "Your preferences have been saved.", "savedrights": "The user groups of {{GENDER:$1|$1}} have been saved.", "timezonelegend": "Time zone:", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index a1e65c011a..b2fce4acaf 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1219,6 +1219,7 @@ "prefs-watchlist-edits": "Used in [[Special:Preferences]], tab \"Watchlist\".", "prefs-watchlist-edits-max": "Shown as hint in [[Special:Preferences]], tab \"Watchlist\"", "prefs-watchlist-token": "Used in [[Special:Preferences]], tab Watchlist.", + "prefs-watchlist-managetokens": "Label for the button to see and reset the user's private tokens", "prefs-misc": "Tab used on the [[Special:Preferences|user preferences]] special page.", "prefs-resetpass": "Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ResetPass]].\n\n{{Identical|Change password}}", "prefs-changeemail": "Link on [[Special:Preferences]] to [[Special:ChangeEmail]]. [[Special:ChangeEmail]] also allows removing email address. \n\nSee also:\n* {{msg-mw|prefs-help-email-required|help}}\n* {{msg-mw|prefs-help-email|help}}\n* {{msg-mw|prefs-help-email-others|help}}\n* {{msg-mw|prefs-setemail|link title}}", @@ -1236,7 +1237,7 @@ "recentchangesdays-max": "Shown as hint in [[Special:Preferences]], tab \"Recent changes\". Parameters:\n* $1 - number of days\nSee also:\n* {{msg-mw|Prefs-watchlist-days-max}}", "recentchangescount": "Used in [[Special:Preferences]], tab \"Recent changes\".", "prefs-help-recentchangescount": "Used in [[Special:Preferences]], tab \"Recent changes\".", - "prefs-help-watchlist-token2": "Used in [[Special:Preferences]], tab Watchlist. (Formerly in {{msg-mw|prefs-help-watchlist-token}}.)", + "prefs-help-tokenmanagement": "Used in [[Special:Preferences]], Watchlist tab.", "savedprefs": "This message appears after saving changes to your user preferences.", "savedrights": "This message appears after saving the user groups on [[Special:UserRights]].\n* $1 - The user name of the user which groups was saved.", "timezonelegend": "{{Identical|Time zone}}",