Änderungen von Dokument Benutzername vergessen?
Zuletzt geändert von xwikiadmin am 2022/07/28 11:40
Von Version 5.1
bearbeitet von xwikiadmin
am 2022/07/28 11:40
am 2022/07/28 11:40
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-administration-ui/13.10.8]
Auf Version 1.1
bearbeitet von xwikiadmin
am 2020/06/24 19:59
am 2020/06/24 19:59
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-administration-ui/12.4]
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -1,5 +1,36 @@ 1 1 {{velocity}} 2 -#set ($newUrl = $services.security.authentication.getAuthenticationURL('retrieveusername', $request.parameterMap)) 3 -#set ($discard = $services.logging.deprecate("ForgotUsername", "The page [XWiki.ForgotUsername] should not be used anymore in favor of the new 'authenticate/retrieveusername' URL.")); 4 -#set ($discard = $response.sendRedirect($newUrl)) 2 +#set($email = "$!request.get('e')") 3 +#if($email == '') 4 +{{translation key="xe.admin.forgotUsername.instructions"/}} 5 + 6 +{{html}} 7 + <form method="post" action="$doc.getURL()" class="xformInline"> 8 + <div><label for="e">$services.localization.render('xe.admin.forgotUsername.email.label')</label> <input type="text" id="e" name="e"/> <span class="buttonwrapper"><input type="submit" value="$services.localization.render('xe.admin.forgotUsername.submit')" class="button"/></span></div> 9 + </form> 10 +{{/html}} 11 + 12 +#else 13 + #set($query = $services.query.hql(", BaseObject obj, StringProperty prop where obj.name = doc.fullName and obj.className = 'XWiki.XWikiUsers' and prop.id.id = obj.id and prop.id.name = 'email' and LOWER(prop.value) = :email").bindValue('email', $email.toLowerCase())) 14 + #set($results = $query.execute()) 15 + ## If local user does not exist check global user 16 + #if($results.size() == 0 && ${xcontext.database} != ${xcontext.mainWikiName}) 17 + #set($results = $query.setWiki("${xcontext.mainWikiName}").execute()) 18 + #end 19 + #if($results.size() == 0) 20 + {{translation key="xe.admin.forgotUsername.error.noAccount"/}} 21 + 22 + [[{{translation key="xe.admin.forgotUsername.error.retry"/}}>>$doc.fullName]] | [[{{translation key="xe.admin.forgotUsername.login"/}}>>path:${xwiki.getURL('XWiki.XWikiLogin', 'login')}]] 23 + #elseif($results.size() == 1) 24 + $services.localization.render('xe.admin.forgotUsername.result', ["**${results.get(0).substring($results.get(0).indexOf('.')).substring(1)}**"]) 25 + 26 + [[{{translation key="xe.admin.forgotUsername.login"/}}>>path:${xwiki.getURL('XWiki.XWikiLogin', 'login')}]] 27 + #else 28 + {{translation key="xe.admin.forgotUsername.multipleResults"/}} 29 + #foreach($item in $results) 30 + * **${item.substring($item.indexOf('.')).substring(1)}** 31 + #end 32 + 33 + [[{{translation key="xe.admin.forgotUsername.login"/}}>>path:${xwiki.getURL('XWiki.XWikiLogin', 'login')}]] 34 + #end 35 +#end 5 5 {{/velocity}}