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

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.1
    • Fix Version/s: None
    • Component/s: Velocity
    • Labels:
    • Difficulty:
      Easy
    • Similar issues:

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            valdisvi Valdis Vitolins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response: