*(bug 27159) make email confirmation code expiration time configurable
authorSam Reed <reedy@users.mediawiki.org>
Thu, 10 Feb 2011 02:32:34 +0000 (02:32 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 10 Feb 2011 02:32:34 +0000 (02:32 +0000)
Added "$wgUserEmailConfirmationTokenExpiry"

includes/DefaultSettings.php
includes/User.php

index c7988c6..c2147f5 100644 (file)
@@ -1045,6 +1045,11 @@ $wgPasswordReminderResendTime = 24;
  */
 $wgNewPasswordExpiry  = 3600 * 24 * 7;
 
+/**
+ * The time, in seconds, when an email confirmation email expires
+ */
+$wgUserEmailConfirmationTokenExpiry = 7 * 24 * 60 * 60;
+
 /**
  * SMTP Mode
  * For using a direct (authenticated) SMTP server connection.
index 90875cb..77abfc2 100644 (file)
@@ -2982,8 +2982,9 @@ class User {
         * @private
         */
        function confirmationToken( &$expiration ) {
+               global $wgUserEmailConfirmationTokenExpiry;
                $now = time();
-               $expires = $now + 7 * 24 * 60 * 60;
+               $expires = $now + $wgUserEmailConfirmationTokenExpiry;
                $expiration = wfTimestamp( TS_MW, $expires );
                $token = self::generateToken( $this->mId . $this->mEmail . $expires );
                $hash = md5( $token );