Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-9519

Wrong link to mail verification and confirmation if XWiki is behind proxy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 5.1
    • Velocity
    • Easy

    Description

      In /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=Registration Velocity scripts for verification and confirmation emails use $request.getRequestURL(), which returns localhost, if XWiki runs behind proxy.

      If it is changed to $xwiki.getRequestURL() then URLs are shown correctly. So changed scripts should like something like this (I was not sure about getting user name, so dropped this part):

      1. for validation:

      Hello,
      
      This email address was used to register a new account on ${host}. If you did not make the request, please ignore this message.
      
      In order to activate your account, please follow this link:
      ${host}${xwiki.getURL('XWiki.AccountValidation', 'view', "validkey=${validkey}&xwikiname=${xwikiname}")}
      

      2. For confirmation:

      #set ($username = $context.user)
      #set ($host = ${xwiki.getRequestURL()})
      #set ($host = ${host.substring(0, ${host.indexOf('/', ${mathtool.add(${host.indexOf('//')}, 2)})})})
      Subject: Your account on ${host} has been activated
      
      Hello ${xwiki.getUserName($context.user, false)},
      
      Your account on ${host} has been successfully activated. You can now login at ${host}${xwiki.getURL('XWiki.XWikiLogin', 'login')} using your username (${xwiki.getDocument($username).getName()}).
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            valdisvi Valdis Vitolins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: