Hi,
I'd loke to make a automatically rediction after the loggin of users to a specfic page (I can defined).
So I found the VM file loggin.vm that I could update but how could I do it ?
Thank you
Community moderators have prevented the ability to post new answers.
What you will do is change the hidden input right before the closing </fieldset> tag:
<input type="hidden" name="os_destination" value="$!generalUtil.escapeXml($!os_destination)"/>
Change it to something like:
<input type="hidden" name="os_destination" value="/display/your/page"/>
This creates the link I was talking about. Sorry, but like I said, there are different places that I use this technique, so I misunderstood exactly what you needed. This should work for you though (I tested it on my Confluence instance).
So I found the solution myself.
I'm using : /pages/viewpage.action?pageId=...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah great ! You're right, thank you a lot.
I updated the line as you told me and perfect !
One last point is :
you're using the title of a page to make the redirection, is it possible to use page id instead of page title ?
Thank you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the problem comes from the url when I'm trying to connect :
.../login.action?os_destination=%2Fdisplay%2FHOME%2FHomepage
But I don't find the link to this page in vm files.
So could you help me please ?
The last solution is to use a redirection macro to this page to the correct one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried but it doesn't work...
Maybe I need to update another action ...
Here he solved his problem with the same attribute : http://stackoverflow.com/questions/9801352/wrong-redirect-after-login-to-confluence-homepage-in-stead-of-my-app-using-crow
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matthew,
So you want to update this row :
<a class="reload" href="${req.contextPath}/dologin.action?os_username=${action.os_username}"
and add at the end :
<a class="reload" href="${req.contextPath}/dologin.action?os_username=${action.os_username}&os_destination=/display/doc/your+page"
Thank you in advance
This is all the code from the file login.vm
#* @vtlvariable name="action" type="com.atlassian.confluence.user.actions.LoginAction" *# #macro (errorBlock $msg) <div class="error" tabindex="0"><p>$msg</p></div> #end #set($showSignup = $action.isShowSignUp() && !$action.isElevatedSecurityCheckRequired()) <html> <head> #requireResource("confluence.web.resources:master-styles") #requireResource("confluence.web.resources:login") #requireResource("confluence.web.resources:aui-forms") #if( $fromNotPermitted ) <title>$i18n.getText("title.not.permitted")</title> #else <title>$action.getActionName($action.getClass().getName())</title> <content tag="pageTitle"><a href="${req.contextPath}/homepage.action">$action.globalSettings.siteTitle</a></content> #end </head> <body> <content tag="bodyClass">login</content> #if($showSignup) #requireResource("confluence.web.resources:signup") <script> AJS.$('#com-atlassian-confluence.login h1').addClass('unified-header'); </script> #end <div id="login-container" #if($showSignup)class="unified-container"#end> #if ($remoteUser) <div class="login-section"> <h2>$action.getText('login.name')</h2> #parse ('/template/includes/actionerrors.vm') <p>$i18n.getText('login.logged.in', $remoteUser.name)</p> <p class="last">$i18n.getText('login.logged.in.description')</p> </div> #else <div class="login-section #if($showSignup)unified#end"> #applyDecorator("form-aui") #decoratorParam("formName" "loginform") #decoratorParam("submitAction" "$req.contextPath/dologin.action") #decoratorParam("editAction" "$req.contextPath/login.action") #decoratorParam("editMode" "true") #decoratorParam("formStyle" "login-form-container") <h2>$action.getText('login.name')</h2> #if($logout) <div class="aui-message success shadowed closeable"> <p>$i18n.getText("successful.logout.message")</p> </div> #end #parse ('/template/includes/actionerrors.vm') <fieldset class="compact-form-fields"> #assistiveLegend("accessibility.form.login") #if($action.isElevatedSecurityCheckRequired()) #bodytag( "TextField" "label='username.accesskey'" "name='os_username'" "theme='aui'") #param("focus" "0") #end #bodytag( "Password" "label='password.accesskey'" "name='os_password'" "theme='aui'") #end <div id="captcha-container" class="field-group"> <label id="captcha-reponse-label" for="captcha-response"> ## link in login.elevatedsecuritycheck.assistive has 'tabindex="5"' <span class="assistive">$i18n.getText("login.elevatedsecuritycheck.assistive")</span> </label> #set($captchaId = $captchaManager.generateCaptchaId()) ## assign reload a tabindex greater than 0 to remove it from the default tab order <a class="reload" href="${req.contextPath}/dologin.action?os_username=${action.os_username}" tabindex="1" title="$generalUtil.escapeXml($i18n.getText('login.elevatedsecuritycheck.captcha.reload.title'))"> <img src="${req.contextPath}/images/icons/refresh_grey_16.png" alt="$generalUtil.escapeXml($i18n.getText('login.elevatedsecuritycheck.captcha.reload.alt'))" /> </a> #captchaImage($captchaId) </div> <div class="field-group"> <input id="captcha-response" class="text" type="text" name="captchaResponse" value="" placeholder="$i18n.getText('captcha.challenge')"> #fielderrorAUI('captcha') </div> #bodytag( "Component" "label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'") #end #else #bodytag( "TextField" "label='username.accesskey'" "name='os_username'" "theme='aui'") #param("focus" "0") #end #bodytag( "Password" "label='password.accesskey'" "name='os_password'" "theme='aui'") #end #bodytag( "Component" "label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'") #end #end <div class="field-group form-buttons compact-form-buttons"> <input id="loginButton" class="aui-button aui-style aui-button-primary" name="login" type="submit" value="$i18n.getText('login.button')"/> #if ($action.isShowForgottenPasswordHelp()) <a id="forgot-password" class="aui-button aui-style aui-button-link" href="${req.contextPath}/forgotuserpassword.action">$i18n.getText("forgot.password")</a> #end </div> <input type="hidden" name="os_destination" value="$!generalUtil.escapeXml($!os_destination)"/> </fieldset> #if ($showSignup) <div id="signupMessage" class="aui-message"><p>$i18n.getText("signup.for.an.account")</p></div> #end #end </div> ## login-section #if ($showSignup) <div class="signup-section"> #applyDecorator("form-aui") #decoratorParam("formName" "signupform") #decoratorParam("submitAction" "$req.contextPath/dosignup.action") #decoratorParam("editAction" "$req.contextPath/signup.action") #decoratorParam("editMode" "true") #decoratorParam("formStyle" "login-form-container signup") #decoratorParam("autocompleteDisabled" true) <h2>$action.getText("sign.up")</h2> <fieldset class="right-aligned-form-fields"> #assistiveLegend("accessibility.signup.legend") #bodytag( "TextField" "label='fullname.name.bothcaps'" "name='fullName'" "theme='aui'" ) #param("focus" "0") #end #bodytag( "TextField" "label='email.name'" "name='email'" "theme='aui'" ) #param("type" "email") #end #bodytag( "TextField" "label='username.name'" "name='username'" "theme='aui'" ) #end #bodytag( "Password" "label='password.name'" "name='password'" "theme='aui'" ) #end #bodytag( "Password" "label='confirm.password.name'" "name='confirm'" "theme='aui'" ) #end #tag( "Hidden" "name='token'" "value='$!action.token'" ) #parse ("/pages/includes/captcha-form-elements.vm") <div class="field-group form-buttons compact-form-buttons"> <input id="signupButton" class="aui-button aui-style aui-button-primary" name="signupButton" type="submit" value="$i18n.getText('sign.up')" /> </div> </fieldset> <div id="loginMessage" class="aui-message"><p>$i18n.getText("signup.for.an.account.login")</p></div> #end </div> ## signup-section #end #end </div> #if ($action.clusterManager.isClustered()) <content tag="coherence-copyright"> <div class="smalltext" id="coherence-copyright"> $i18n.getText("coherence.copyright.notice", [$buildInfo.buildYear]) </div> </content> #end #if ($action.isBrowserLanguageEnabled()) <content tag="login-language"> <ul id="login-language"> #foreach ($lang in $action.getInstalledLanguages()) <li> <a href="login.action?language=$lang.name">$lang.capitalDisplayName</a> </li> #end </ul> </content> #end </body> </html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm pretty sure that should work. My setup is a little different, so I can't test it directly right now, but you've got the gist. Basically, os_destination is the redirect URL for a successful login, and it's relative to the root.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Set the value of the os_destination query string param after the login.action. For example:
login.action?os_destination=/display/doc/your+page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.