Изменения документа Registration

Редактировал(а) Alexey Semenihin 23.10.2026, 15:12

От версии 1.1
отредактировано Admin xWiKi
на 15.10.2019, 13:19
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/11.8.1]
К версии 3.1
отредактировано Dmitriy Rybakov
на 20.06.2025, 16:36
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/16.10.8]

Сводка

Подробности

Свойства страницы
Автор документа
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.rybakovds
Содержимое
... ... @@ -1,3 +1,5 @@
1 +{{template name="register_macros.vm"/}}
2 +
1 1  {{velocity}}
2 2  ## The registration is enabled:
3 3  ## - on the main wiki
... ... @@ -11,24 +11,14 @@
11 11   #set($loginAction = 'loginsubmit')
12 12   ##
13 13   #set($documentName = 'XWiki.Registration')
14 - #set($configurationClassName = 'XWiki.Registration')
15 15   ##
16 16   ## Security measure:
17 17   ## If this document is changed such that it must have programming permission in order to run, change this to false.
18 18   #set($sandbox = true)
19 19   ##
20 - ## Load the configuration from a seperate document.
21 - #loadConfig('XWiki.RegistrationConfig')
21 + #set ($registrationConfig = $NULL)
22 + #_loadConfig($registrationConfig)
22 22   ##
23 - ## Defines what server generated error messages should look like
24 - ## The error message when a field is entered incorrectly
25 - #set($failureMessageParams = { 'class' : 'LV_validation_message LV_invalid'})
26 - ## 'LV_validation_message LV_invalid' depends on this:
27 - $xwiki.get('ssfx').use('uicomponents/widgets/validation/livevalidation.css', true)
28 - ##
29 - ## The * next to the fields to denote they are mandatory.
30 - #set($fieldMandatoryStar = { 'class' : 'xRequired'})
31 - ##
32 32   #*
33 33   * You may include this document in other documents using {{include reference="XWiki.Registration"/}}
34 34   * To specify that the user is invited and should be allowed to register even if Guest does not have permission to
... ... @@ -125,30 +125,31 @@
125 125   * Removing or renaming any of these fields will result in undefined behavior.
126 126   *
127 127   *###
128 - #set($fields = [])
129 - ##
130 - ## The first name field, no checking.
120 + #set($mainFields = [])
121 +
122 + ## The first name field.
131 131   #set($field =
132 132   {'name' : 'register_first_name',
133 133   'label' : $services.localization.render('core.register.firstName'),
134 134   'params' : {
135 135   'type' : 'text',
136 - 'size' : '60'
128 + 'size' : '60',
129 + 'autocomplete' : 'given-name'
137 137   }
138 138   })
139 - #set($discard = $fields.add($field))
132 + #set($discard = $mainFields.add($field))
140 140   ##
141 - ## The last name field, no checking.
134 + ## The last name field.
142 142   #set($field =
143 143   {'name' : 'register_last_name',
144 - 'label' : $services.localization.render('core.register.lastName'),
145 - 'params' : {
146 - 'type' : 'text',
147 - 'size' : '60'
137 + 'label' : $services.localization.render('core.register.lastName'),
138 + 'params' : {
139 + 'type' : 'text',
140 + 'size' : '60',
141 + 'autocomplete' : 'family-name'
148 148   }
149 149   })
150 - #set($discard = $fields.add($field))
151 - ##
144 + #set($discard = $mainFields.add($field))
152 152   ## The user name field, mandatory and programmatically checked to make sure the username doesn't exist.
153 153   #set($field =
154 154   {'name' : 'xwikiname',
... ... @@ -156,7 +156,8 @@
156 156   'params' : {
157 157   'type' : 'text',
158 158   'onfocus' : 'prepareName(document.forms.register);',
159 - 'size' : '60'
152 + 'size' : '60',
153 + 'autocomplete' : 'username'
160 160   },
161 161   'validate' : {
162 162   'mandatory' : {
... ... @@ -168,60 +168,18 @@
168 168   }
169 169   }
170 170   })
171 - #set($discard = $fields.add($field))
165 + #set($discard = $mainFields.add($field))
172 172   ## Make sure the chosen user name is not already taken
173 173   ## This macro is called by programmaticValidation for xwikiname (above)
174 - #macro(nameAvailable, $name)
175 - #if($xwiki.exists("$userSpace$name"))
168 + #macro (nameAvailable, $name)
169 + #if ($xwiki.exists("$userSpace$name"))
176 176   failed
177 177   #end
178 178   #end
179 179   ##
180 180   ##The password field, mandatory and must be at least 6 characters long.
181 - #set($field =
182 - {'name' : 'register_password',
183 - 'label' : $services.localization.render('core.register.password'),
184 - 'params' : {
185 - 'type' : 'password',
186 - 'autocomplete' : 'off',
187 - 'size' : '60'
188 - },
189 - 'validate' : {
190 - 'mandatory' : {
191 - 'failureMessage' : $services.localization.render('core.validation.required.message')
192 - },
193 - 'regex' : {
194 - 'pattern' : '/.{6,}/',
195 - 'failureMessage' : $services.localization.render('xe.admin.registration.passwordTooShort')
196 - }
197 - }
198 - })
199 - #set($discard = $fields.add($field))
200 - ##
201 201   ##The confirm password field, mandatory, must match password field, and must also be 6+ characters long.
202 - #set($field =
203 - {'name' : 'register2_password',
204 - 'label' : $services.localization.render('core.register.passwordRepeat'),
205 - 'params' : {
206 - 'type' : 'password',
207 - 'autocomplete' : 'off',
208 - 'size' : '60'
209 - },
210 - 'validate' : {
211 - 'mandatory' : {
212 - 'failureMessage' : $services.localization.render('core.validation.required.message')
213 - },
214 - 'mustMatch' : {
215 - 'name' : 'register_password',
216 - 'failureMessage' : $services.localization.render('xe.admin.registration.passwordMismatch')
217 - },
218 - 'regex' : {
219 - 'pattern' : '/.{6,}/',
220 - 'failureMessage' : $services.localization.render('xe.admin.registration.passwordTooShort')
221 - }
222 - }
223 - })
224 - #set($discard = $fields.add($field))
176 + #definePasswordFields($mainFields, 'register_password', 'register2_password', $registrationConfig.passwordOptions)
225 225   ##
226 226   ## The email address field, regex checked with an email pattern. Mandatory if registration uses email verification
227 227   #set($field =
... ... @@ -229,7 +229,8 @@
229 229   'label' : $services.localization.render('core.register.email'),
230 230   'params' : {
231 231   'type' : 'text',
232 - 'size' : '60'
184 + 'size' : '60',
185 + 'autocomplete' : 'email'
233 233   },
234 234   'validate' : {
235 235   'regex' : {
... ... @@ -238,10 +238,10 @@
238 238   }
239 239   }
240 240   })
241 - #if($xwiki.getXWikiPreferenceAsInt('use_email_verification', 0) == 1)
194 + #if($registrationConfig.useEmailVerification)
242 242   #set($field.validate.mandatory = {'failureMessage' : $services.localization.render('core.validation.required.message')})
243 243   #end
244 - #set($discard = $fields.add($field))
197 + #set($discard = $mainFields.add($field))
245 245   ##
246 246   #*********
247 247   ## Uncomment this code to see an example of how you can easily add a field to the registration page
... ... @@ -267,7 +267,7 @@
267 267   },
268 268   'doAfterRegistration' : '#saveFavoriteColor()'
269 269   })
270 - #set($discard = $fields.add($field))
223 + #set($discard = $mainFields.add($field))
271 271   ## Save the user's favorite color on their user page.
272 272   #macro(saveFavoriteColor)
273 273   #set($xwikiname = $request.get('xwikiname'))
... ... @@ -284,7 +284,7 @@
284 284   #if($services.captcha
285 285   && !$invited
286 286   && $xcontext.getUser() == "XWiki.XWikiGuest"
287 - && $requireCaptcha)
240 + && $registrationConfig.requireCaptcha)
288 288   ## The CAPTCHA field, programmatically checked to make sure the CAPTCHA is right.
289 289   ## Not checked by javascript because javascript can't check the CAPTCHA and the Ok message because it passes the
290 290   ## mandatory test is misleading.
... ... @@ -291,10 +291,11 @@
291 291   ## Also, not filled back in if there is an error ('noReturn').
292 292   #set($field =
293 293   {'name' : 'captcha_placeholder',
294 - 'label' : $services.localization.render('core.captcha.instruction'),
247 + 'label' : $services.localization.render('core.captcha.label'),
295 295   'skipLabelFor' : true,
296 296   'type' : 'html',
297 - 'html' : "$!{services.captcha.default.display()}",
250 + 'html' : "<span class='xHint'>$escapetool.xml($services.localization.render('core.captcha.instruction'))
251 + </span> $!{services.captcha.default.display()}",
298 298   'validate' : {
299 299   'programmaticValidation' : {
300 300   'code' : '#if (!$services.captcha.default.isValid())failed#end',
... ... @@ -303,19 +303,8 @@
303 303   },
304 304   'noReturn' : true
305 305   })
306 - #set($discard = $fields.add($field))
260 + #set($discard = $mainFields.add($field))
307 307   #end
308 - ##
309 - ## Pass the name of the template to $xwiki.createUser so any contained information will be passed in.
310 - #set($field =
311 - {'name' : 'template',
312 - 'params' : {
313 - 'type' : 'hidden',
314 - 'value' : 'XWiki.XWikiUserTemplate'
315 - }
316 - })
317 - #set($discard = $fields.add($field))
318 - ##
319 319   ## Pass the redirect parameter on so that the login page may redirect to the right place.
320 320   ## Not necessary in Firefox 3.0.10 or Opera 9.64, I don't know about IE or Safari.
321 321   #set($field =
... ... @@ -324,16 +324,13 @@
324 324   'type' : 'hidden'
325 325   }
326 326   })
327 - #set($discard = $fields.add($field))
270 + #set($discard = $mainFields.add($field))
271 + #set($fields = $mainFields)
328 328   ##
329 329   #######################################################################
330 330   ## The Code.
331 331   #######################################################################
332 332   ##
333 - #if($useLiveValidation)
334 - $xwiki.get('jsfx').use('uicomponents/widgets/validation/livevalidation_prototype.js')
335 - $xwiki.get('ssfx').use('uicomponents/widgets/validation/livevalidation.css', true)
336 - #end
337 337   ## This application's HTML is dynamically generated and editing in WYSIWYG would not work
338 338   #if($xcontext.getAction() == 'edit')
339 339   $response.sendRedirect("$xwiki.getURL($doc.getFullName(), 'edit')?editor=wiki")
... ... @@ -360,14 +360,16 @@
360 360   #end
361 361   ##
362 362   ## Display the heading
363 - $heading
303 + $registrationConfig.heading
364 364   ## If the submit button has been pressed, then we test the input and maybe create the user.
365 365   #if($request.getParameter('xwikiname'))
366 366   ## Do server side validation of input fields.
367 - ## This must not be in a #set directive as it will output messages if something goes wrong.
368 - #validateFields($fields, $request)
369 - ## If server side validation was successfull, create the user
370 - #if(!$registrationFailed)
307 + ## This will output messages if something goes wrong, nothing if everything is alright.
308 + ## We need to trim the output so that we can keep indentations in the validation script.
309 + #set ($validationText = $stringtool.trim("#validateFields($fields, $request)"))
310 + $validationText##
311 + ## If server side validation was successful, create the user
312 + #if($allFieldsValid)
371 371   #createUser($fields, $request, $response, $doAfterRegistration)
372 372   #end
373 373   #end
... ... @@ -374,7 +374,7 @@
374 374   ## If the registration was not successful or if the user hasn't submitted the info yet
375 375   ## Then we display the registration form.
376 376   #if(!$registrationDone)
377 - $welcomeMessage
319 + $registrationConfig.welcomeMessage
378 378  
379 379   {{html clean="false"}}
380 380   <form id="register" action="$xwiki.relativeRequestURL" method="post" class="xform half">
... ... @@ -382,21 +382,20 @@
382 382   #if ($request.xpage == 'registerinline')
383 383   #skinExtensionHooks
384 384   #end
385 - <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" />
386 386   #set ($userDirectoryReference = $services.model.createDocumentReference('', 'Main', 'UserDirectory'))
387 387   #if ($xwiki.exists($userDirectoryReference))
388 388   <input type="hidden" name="parent" value="$!{services.model.serialize($userDirectoryReference, 'default')}" />
389 389   #end
390 390   </div>
391 - #generateHtml($fields, $fieldMandatoryStar, $failureMessageParams)
332 + ## Note that the macro inject the form_token field.
333 + #generateHtml($mainFields, $request, 'false')
334 + <input type="hidden" name="form_token" value="$services.csrf.getToken()" />
335 + #generateJavascript($fields)
392 392   <p class="buttons">
393 393   <span class="buttonwrapper">
394 394   <input type="submit" value="$services.localization.render('core.register.submit')" class="button"/>
395 395   </span>
396 396   </p>
397 - #if ($useLiveValidation)
398 - #generateJavascript($fields)
399 - #end
400 400   </form>
401 401   {{/html}}
402 402  
... ... @@ -414,93 +414,7 @@
414 414   #set($temp = $response.sendRedirect($xwiki.getURL($mainWikiRegisterPageReference, 'register', $request.queryString)))
415 415  #end
416 416  ##
417 -####### The Macros (nothing below this point is run directly) #########
418 418  #*
419 - * Server side validation, this is necessary for security and because not everyone has Javascript
420 - *
421 - * @param $fields The array of fields to validate.
422 - * @param $request An XWikiRequest object which made the register request, used to get parameters.
423 - *###
424 -#macro(validateFields, $fields, $request)
425 - #foreach($field in $fields)
426 - #if($field.get('validate') && $field.get('name'))
427 - #set($fieldName = $field.get('name'))
428 - #set($validate = $field.get('validate'))
429 - #set($error = '')
430 - #set($value = $request.get($fieldName))
431 - #if("$!value" != '' || $field.get('type') == 'html')
432 - ##
433 - ## mustMatch validation
434 - #if($error == '' && $validate.get('mustMatch'))
435 - #set($mustMatch = $validate.get('mustMatch'))
436 - #if($mustMatch.get('name') && $mustMatch.get('failureMessage'))
437 - #if($request.get($fieldName) != $request.get($mustMatch.get('name')))
438 - #set($error = $mustMatch.get('failureMessage'))
439 - #end
440 - #else
441 - ERROR: In field: ${fieldName}: mustMatch validation required both name
442 - (of field which this field must match) and failureMessage.
443 - #end
444 - #end
445 - ##
446 - ## Regex validation
447 - ## We won't bother with regex validation if there is no entry, that would defeat the purpose of 'mandatory'
448 - #if($error == '' && $validate.get('regex') && $value && $value != '')
449 - #set($regex = $validate.get('regex'))
450 - #if($regex.get('pattern') && $regex.get('failureMessage'))
451 - ## Make Java regexes more compatible with Perl/js style regexes by removing leading and trailing /
452 - #if($regex.get('pattern').length() > 1)
453 - #set($pattern = $regex.get('pattern'))
454 - #if($pattern.lastIndexOf('/') < $pattern.length() - 1)
455 - ERROR: In field: ${fieldName}: regex validation does not allow flags after the /, please fix [${pattern}].
456 - #end
457 - #set($pattern = $pattern.substring($mathtool.add(1, $pattern.indexOf('/')), $pattern.lastIndexOf('/')))
458 - #else
459 - ## I don't expect this but want to maintain compatibility.
460 - #set($pattern = $regex.get('pattern'))
461 - #end
462 - #if($regextool.find($value, $pattern).isEmpty())
463 - #set($error = $regex.get('failureMessage'))
464 - #end
465 - #elseif($regex.get('pattern'))
466 - ERROR: In field: ${fieldName}: regex validation must include failureMessage.
467 - #end
468 - #end
469 - ##
470 - ## If regex and mustMatch validation passed, try programmatic validation
471 - #if($error == '' && $validate.get('programmaticValidation'))
472 - #set($pv = $validate.get('programmaticValidation'))
473 - #if($pv.get('code') && $pv.get('failureMessage'))
474 - #set($pvReturn = "#evaluate($pv.get('code'))")
475 - #if($pvReturn.indexOf('failed') != -1)
476 - #set($error = $pv.get('failureMessage'))
477 - #end
478 - #else
479 - ERROR: In field: ${fieldName}: programmaticValidation requires code and failureMessage
480 - #end
481 - #end
482 - #else
483 - ##
484 - ## If no content, check if content is mandatory
485 - #if($validate.get('mandatory'))
486 - #set($mandatory = $validate.get('mandatory'))
487 - #if($mandatory.get('failureMessage'))
488 - #set($error = $mandatory.get('failureMessage'))
489 - #else
490 - ERROR: In field: ${fieldName}: mandatory validation requires a failureMessage
491 - #end
492 - #end
493 - #end
494 - #if($error != '')
495 - #set($discard = $field.put('error', $error))
496 - #set($registrationFailed = true)
497 - #end
498 - #elseif(!$field.get('name'))
499 - ERROR: Field with no name.
500 - #end##if(validate)
501 - #end##loop
502 -#end##macro
503 -#*
504 504   * Create the user.
505 505   * Calls $xwiki.createUser to create a new user.
506 506   *
... ... @@ -531,6 +531,9 @@
531 531   {{translation key="core.register.userAlreadyExists"/}}
532 532   #elseif($reg == -4)
533 533   {{translation key="core.register.invalidUsername"/}}
389 + #elseif ($reg == -9)
390 + {{translation key="core.register.invalidCaptcha"/}}
391 + ## Note that -10 is reserved already (see api.XWiki#createUser)
534 534   #elseif($reg == -11)
535 535   {{translation key="core.register.mailSenderWronglyConfigured"/}}
536 536   #else
... ... @@ -558,16 +558,18 @@
558 558   #if("$!request.getParameter($redirectParam)" != '')
559 559   #set($redirect = $request.getParameter($redirectParam))
560 560   #else
561 - #set($redirect = $defaultRedirect)
419 + #set($redirect = $registrationConfig.defaultRedirect)
562 562   #end
563 563   ## Display a "registration successful" message
422 + ## Define some strings which may be used by the welcome message
423 + #set($firstName = $!request.get('register_first_name'))
424 + #set($lastName = $!request.get('register_last_name'))
425 + #evaluate($registrationConfig.registrationSuccessMessage)
564 564  
565 - #evaluate($registrationSuccessMessage)
566 -
567 567   ## Empty line prevents message from being forced into a <p> block.
568 568  
569 569   ## Give the user a login button which posts their username and password to loginsubmit
570 - #if($loginButton)
430 + #if($registrationConfig.loginButton)
571 571  
572 572   {{html clean=false wiki=false}}
573 573   <form id="loginForm" action="$loginURL" method="post">
... ... @@ -579,11 +579,19 @@
579 579   <span class="buttonwrapper">
580 580   <input type="submit" value="$services.localization.render('login')" class="button"/>
581 581   </span>
442 + #set ($mainPage = $services.wiki.currentWikiDescriptor.mainPageReference)
443 + #if ($xwiki.checkAccess($mainPage, 'view'))
444 + <span class="buttonwrapper">
445 + <a href="$!xwiki.getURL($mainPage)" rel="home" class="button secondary">
446 + $services.localization.render('core.register.successful.backtohome')
447 + </a>
448 + </span>
449 + #end
582 582   </div>
583 583   </form>
584 584   ## We don't want autoLogin if we are administrators adding users...
585 - #if ($autoLogin && $request.xpage != 'registerinline')
586 - <script type='text/javascript'>
453 + #if ($registrationConfig.autoLogin && $request.xpage != 'registerinline')
454 + <script>
587 587   document.observe('xwiki:dom:loaded', function() {
588 588   document.forms['loginForm'].submit();
589 589   });
... ... @@ -595,207 +595,4 @@
595 595   #end
596 596   ##
597 597  #end## createUser Macro
598 -#*
599 - * Generate HTML form, this is the only place where HTML is written.
600 - *
601 - * @param $fields The array of fields to use for generating html code.
602 - * @param $fieldMandatoryStar The tag parameters for a * indicating a mandatory field.
603 - * @param $failureMessageParams The tag parameters for a failure message.
604 - *###
605 -#macro(generateHtml, $fields, $fieldMandatoryStar, $failureMessageParams)
606 - ## Put the same values back into the fields.
607 - #getParams($fields)
608 - ##
609 - <dl>
610 - #foreach($field in $fields)
611 - #if($field.get('name'))
612 - #set($fieldName = $field.get('name'))
613 - #if($field.get('label'))
614 - #set($label = $field.get('label'))
615 - <dt><label #if (!$field.get('skipLabelFor'))for="$fieldName"#end>$label
616 - #if($field.get('validate').get('mandatory'))
617 - <span ##
618 - #foreach($entry in $fieldMandatoryStar.entrySet())
619 - $entry.getKey()="$entry.getValue()" ##
620 - #end
621 - >$services.localization.render('core.validation.required')</span>
622 - #end
623 - </label>
624 - </dt>
625 - #end
626 - <dd>
627 - #if ($field.get('type') == 'html')
628 - $field.get('html')
629 - #elseif ($field.get('type') == 'tag' || "$!{field.get('type')}" == '')
630 - ## If no tag then default tag is <input>
631 - #if($field.get('tag'))
632 - #set($tag = $field.get('tag'))
633 - #else
634 - #set($tag = 'input')
635 - #end
636 - <$tag id="$fieldName" ##
637 - #set($params = $field.get('params'))
638 - ## If no name parameter is spacified, then we use the field name
639 - #if(!$params.get('name'))
640 - #set($discard = $params.put('name', $fieldName))
641 - #end
642 - #foreach($entry in $params.entrySet())
643 - ## If a parameter is specified as '' then we don't include it.
644 - #if($entry.getValue() != '')
645 - $entry.getKey()="$escapetool.xml($entry.getValue())" ##
646 - #end
647 - #end
648 - ## Close the opened tag in a way that is valid for its type (i.e. with "/>" or with "></tag>").
649 - #if ($tag == 'input')
650 - #set ($voidTag = true)
651 - #end
652 - #if ($voidTag)/#end>#if (!$voidTag)</$tag>#end
653 - #end
654 - #if($field.get('error'))
655 - <span ##
656 - #foreach($entry in $failureMessageParams.entrySet())
657 - $entry.getKey()="$entry.getValue()" ##
658 - #end
659 - >$field.get('error')</span>
660 - #end
661 - </dd>
662 - #else
663 - ERROR: Field with no name.
664 - #end##if fieldName exists
665 - #end
666 - </dl>
667 -#end
668 -#*
669 - * Generate the Javascript for interacting with LiveValidation.
670 - *
671 - * @param $fields The array of fields which to validate.
672 - *###
673 -#macro(generateJavascript, $fields)
674 - <script type='text/javascript'>
675 - /* <![CDATA[ */
676 - var initRegistrationFormValidation = function() {
677 - ##
678 - #foreach($field in $fields)
679 - #if($field.get('validate') && $field.get('name'))
680 - #set($validate = $field.get('validate'))
681 - #if(($validate.get('mandatory') && !$validate.get('mandatory').get('noscript'))
682 - || ($validate.get('regex') && !$validate.get('regex').get('noscript'))
683 - || ($validate.get('mustMatch') && !$validate.get('mustMatch').get('noscript')))
684 - #set($fieldName = $field.get('name'))
685 - #if($validate.get('fieldOkayMessage'))
686 - #set($okayMessage = $validate.get('fieldOkayMessage'))
687 - #else
688 - #set($okayMessage = $defaultFieldOkayMessage)
689 - #end
690 - var ${fieldName}Validator = new LiveValidation("$fieldName", { validMessage: "$okayMessage", wait: 500} );
691 - ##
692 - #if($validate.get('mandatory'))
693 - #set($mandatory = $validate.get('mandatory'))
694 - #if($mandatory.get('failureMessage') && !$mandatory.get('noscript'))
695 - ${fieldName}Validator.add( Validate.Presence, { failureMessage: "$!mandatory.get('failureMessage')"} );
696 - #end
697 - #end
698 - ##
699 - #if($validate.get('mustMatch'))
700 - #set($mustMatch = $validate.get('mustMatch'))
701 - #if($mustMatch.get('name') && $mustMatch.get('failureMessage') && !$mustMatch.get('noscript'))
702 - ${fieldName}Validator.add( Validate.Confirmation, { match: $$("input[name=$!mustMatch.get('name')]")[0], failureMessage: "$!mustMatch.get('failureMessage')"} );
703 - #end
704 - #end
705 - ##
706 - #if($validate.get('regex'))
707 - #set($regex = $validate.get('regex'))
708 - #set($pattern = "")
709 - #if($regex.get('jsPattern'))
710 - #set($pattern = $regex.get('jsPattern'))
711 - #elseif($regex.get('pattern'))
712 - #set($pattern = $regex.get('pattern'))
713 - #end
714 - #set($failMessage = "")
715 - #if($regex.get('jsFailureMessage'))
716 - #set($failMessage = $regex.get('jsFailureMessage'))
717 - #elseif($regex.get('failureMessage'))
718 - #set($failMessage = $regex.get('failureMessage'))
719 - #end
720 - #if($pattern != '' && $failMessage != '' && !$regex.get('noscript'))
721 - ${fieldName}Validator.add( Validate.Format, { pattern: $pattern, failureMessage: "$failMessage"} );
722 - #end
723 - #end##if regex
724 - #end##if contains js validateable fields.
725 - #end##if validate
726 - #end##loop
727 - };
728 - document.observe('xwiki:dom:loaded', initRegistrationFormValidation);
729 - document.observe('xwiki:dom:updated', function(event) {
730 - var container = (event && event.memo && event.memo.elements && event.memo.elements[0]) || $('body');
731 - if (container.down('form#register')) {
732 - initRegistrationFormValidation();
733 - }
734 - });// ]]>
735 - </script>
736 -#end##macro
737 -#*
738 - * Get parameters from request so that values will be filled in if there is a mistake
739 - * in one of the entries. Entries will be returned to fields[n].params.value
740 - * Fields will not be returned if they have either noReturn or error specified.
741 - *
742 - * @param $fields The array of fields to get parameters for.
743 - *###
744 -#macro(getParams $fields)
745 - #foreach($field in $fields)
746 - #if($field.get('name') && $request.get($field.get('name')))
747 - #if(!$field.get('noReturn') && !$field.get('error'))
748 - #if(!$field.get('params'))
749 - #set($params = {})
750 - #set($discard = $field.put('params', $params))
751 - #else
752 - #set($params = $field.get('params'))
753 - #end
754 - #set($discard = $params.put('value', $request.get($field.get('name'))))
755 - #end
756 - #end
757 - #end
758 -#end
759 -#*
760 - * Get the configuration from the configuration object.
761 - *
762 - * @param $configDocumentName The name of the document to get the configuration from.
763 - *###
764 -#macro(loadConfig, $configDocumentName)
765 - #set($configDocument = $xwiki.getDocument($configDocumentName))
766 - #if(!$configDocument || !$configDocument.getObject($configurationClassName))
767 - ## No config document, load defaults.
768 - #set($heading = "$services.localization.render('core.register.title')")
769 - #set($welcomeMessage = "$services.localization.render('core.register.welcome')")
770 - #set($useLiveValidation = true)
771 - #set($defaultFieldOkayMessage = "$services.localization.render('core.validation.valid.message')")
772 - #set($loginButton = true)
773 - #set($defaultRedirect = "$xwiki.getURL($services.model.resolveDocument('', 'default', $doc.documentReference.extractReference('WIKI')))")
774 - #set($userFullName = "$request.get('register_first_name') $request.get('register_last_name')")
775 - #set($registrationSuccessMessage = '{{info}}$services.localization.render("core.register.successful", ["[[${userFullName}>>${userSpace}${userName}]]", ${userName}]){{/info}}')
776 - #else
777 - #set($configObject = $configDocument.getObject($configurationClassName))
778 - #if ($xcontext.action == 'register')
779 - #set ($heading = "(% id='document-title'%)((( = #evaluate($configObject.getProperty('heading').getValue()) = )))(%%)")
780 - #else
781 - #set ($heading = "= #evaluate($configObject.getProperty('heading').getValue()) =")
782 - #end
783 - #set($welcomeMessage = "#evaluate($configObject.getProperty('welcomeMessage').getValue())")
784 - #if($configObject.getProperty('liveValidation_enabled').getValue() == 1)
785 - #set($useLiveValidation = true)
786 - #end
787 - #set($defaultFieldOkayMessage = "#evaluate($configObject.getProperty('liveValidation_defaultFieldOkMessage').getValue())")
788 - #if($configObject.getProperty('loginButton_enabled').getValue() == 1)
789 - #set($loginButton = true)
790 - #end
791 - #if($configObject.getProperty('loginButton_autoLogin_enabled').getValue() == 1)
792 - #set($autoLogin = true)
793 - #end
794 - #set($defaultRedirect = "#evaluate($configObject.getProperty('defaultRedirect').getValue())")
795 - #set($registrationSuccessMessage = "$configObject.getProperty('registrationSuccessMessage').getValue()")
796 - #if($configObject.getProperty('requireCaptcha').getValue() == 1)
797 - #set($requireCaptcha = true)
798 - #end
799 - #end
800 -#end
801 801  {{/velocity}}
registration_success_hero.svg
Автор
... ... @@ -1,0 +1,1 @@
1 +XWiki.rybakovds
Размер
... ... @@ -1,0 +1,1 @@
1 +8.3 KB
Содержимое
... ... @@ -1,0 +1,1 @@
1 +<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="680.83858" height="584.23207" viewBox="0 0 680.83858 584.23207" xmlns:xlink="http://www.w3.org/1999/xlink"><path id="b9ccae5a-ffdd-4f5c-9c1e-05af9f0f3372-177" data-name="Path 438" d="M310.70569,694.02818a24.21459,24.21459,0,0,0,23.38269-4.11877c8.18977-6.87441,10.758-18.196,12.8467-28.68191l6.17973-31.01657-12.9377,8.90837c-9.30465,6.40641-18.81826,13.01866-25.26011,22.29785s-9.25223,21.94707-4.07792,31.988" transform="translate(-259.58071 -157.88396)" fill="#e6e6e6"/><path id="f4ad1d06-bd03-4ced-a5c4-c19a65ab4ee5-178" data-name="Path 439" d="M312.7034,733.73874c-1.62839-11.86368-3.30382-23.88078-2.15884-35.87167,1.01467-10.64932,4.26373-21.04881,10.87831-29.57938a49.20592,49.20592,0,0,1,12.62466-11.44039c1.26215-.79648,2.42409,1.20354,1.16733,1.997a46.77949,46.77949,0,0,0-18.50446,22.32562c-4.02857,10.24607-4.67545,21.41582-3.98154,32.3003.41944,6.58218,1.31074,13.1212,2.20588,19.65251a1.19817,1.19817,0,0,1-.808,1.42251,1.16348,1.16348,0,0,1-1.42253-.808Z" transform="translate(-259.58071 -157.88396)" fill="#f2f2f2"/><path id="baf785f8-b4c6-42cf-85bd-8a16037845f7-179" data-name="Path 442" d="M324.42443,714.70229a17.82513,17.82513,0,0,0,15.53141,8.01862c7.8644-.37318,14.41806-5.85973,20.31713-11.07027l17.452-15.4088-11.54987-.55281c-8.30619-.39784-16.82672-.771-24.73813,1.79338s-15.20758,8.72639-16.654,16.91541" transform="translate(-259.58071 -157.88396)" fill="#e6e6e6"/><path id="a14e4330-7125-4e03-a856-d6453c34f6cc-180" data-name="Path 443" d="M308.10042,740.55843c7.83972-13.87142,16.93234-29.28794,33.1808-34.21552a37.02609,37.02609,0,0,1,13.95545-1.441c1.48189.128,1.11179,2.41174-.367,2.28454a34.39833,34.39833,0,0,0-22.27164,5.89215c-6.27994,4.27453-11.16975,10.21755-15.30781,16.51907-2.53511,3.86051-4.80576,7.88445-7.07642,11.903C309.48824,742.78513,307.36641,741.85759,308.10042,740.55843Z" transform="translate(-259.58071 -157.88396)" fill="#f2f2f2"/><path id="ac20a106-7eb8-4a45-8835-674ef3bf3222-181" data-name="Path 141" d="M935.3957,569.31654H503.18092a5.03014,5.03014,0,0,1-5.02359-5.02359V162.90754a5.03017,5.03017,0,0,1,5.02359-5.02358H935.3957a5.03017,5.03017,0,0,1,5.02359,5.02358V564.292a5.02922,5.02922,0,0,1-5.02359,5.02359Z" transform="translate(-259.58071 -157.88396)" fill="#fff"/><path id="a8878079-c7cd-406f-a434-8b15b914b9b4-182" data-name="Path 141" d="M935.3957,569.31654H503.18092a5.03014,5.03014,0,0,1-5.02359-5.02359V162.90754a5.03017,5.03017,0,0,1,5.02359-5.02358H935.3957a5.03017,5.03017,0,0,1,5.02359,5.02358V564.292a5.02922,5.02922,0,0,1-5.02359,5.02359ZM503.18092,159.88944a3.01808,3.01808,0,0,0-3.01152,3.01151V564.292a3.01808,3.01808,0,0,0,3.01152,3.01152H935.3957a3.01717,3.01717,0,0,0,3.01153-3.01152V162.90754a3.01809,3.01809,0,0,0-3.01153-3.01151Z" transform="translate(-259.58071 -157.88396)" fill="#cacaca"/><path id="af64f961-e9a2-4c53-a333-5060c7f850d2-183" data-name="Path 142" d="M707.41023,262.18528a3.41053,3.41053,0,0,0,0,6.82105H894.55305a3.41053,3.41053,0,0,0,0-6.82105Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="baad4cfb-158d-4439-9cc3-22475bf47b22-184" data-name="Path 143" d="M707.41023,282.65037a3.41054,3.41054,0,0,0,0,6.82106h95.54019a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="f3456279-91e5-49ad-aa43-9838b26fb6ca-185" data-name="Path 142" d="M543.84146,392.7046a3.41054,3.41054,0,0,0,0,6.82106h350.8937a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="a3288adf-49f8-485f-8ae9-1e4f1a13d849-186" data-name="Path 143" d="M543.84146,413.1697a3.41054,3.41054,0,0,0,0,6.82106H803.13254a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="e63a5b48-5a7d-40a2-b9b0-6adec326348a-187" data-name="Path 142" d="M543.84146,433.17177a3.41054,3.41054,0,0,0,0,6.82106h350.8937a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="a1c669b4-dfc3-4cfa-a7be-66b71399844d-188" data-name="Path 143" d="M543.84146,453.63687a3.41054,3.41054,0,0,0,0,6.82106H803.13254a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="bfec50d1-ffb1-4de6-a9ef-a1085e40e016-189" data-name="Path 142" d="M543.84146,474.17177a3.41054,3.41054,0,0,0,0,6.82106h350.8937a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path id="bc9696ec-ec99-41d5-9116-3ad9737a38ac-190" data-name="Path 143" d="M543.84146,494.63687a3.41054,3.41054,0,0,0,0,6.82106H803.13254a3.41054,3.41054,0,0,0,0-6.82106Z" transform="translate(-259.58071 -157.88396)" fill="#e4e4e4"/><path d="M599.41943,324.82812a49,49,0,1,1,48.99952-49A49.05567,49.05567,0,0,1,599.41943,324.82812Z" transform="translate(-259.58071 -157.88396)" fill="#3e79bc"/><path d="M450.67833,510.10041a12.24754,12.24754,0,0,0-14.953-11.36231l-16.19641-22.82521-16.27138,6.45945,23.32519,31.91237a12.31392,12.31392,0,0,0,24.09559-4.1843Z" transform="translate(-259.58071 -157.88396)" fill="#a0616a"/><path d="M419.11211,508.40888l-49.00774-63.57777L388.46714,387.12c1.34563-14.50936,10.425-18.56089,10.81135-18.72645l.5893-.25281,15.979,42.6119-11.73235,31.28625,28.79671,48.4319Z" transform="translate(-259.58071 -157.88396)" fill="#3f3d56"/><path d="M589.30794,312.41993a12.24758,12.24758,0,0,0-10.17219,15.78672l-21.50463,17.91269,7.69816,15.72326,30.01343-25.72272a12.31392,12.31392,0,0,0-6.03477-23.69995Z" transform="translate(-259.58071 -157.88396)" fill="#a0616a"/><path d="M590.06206,344.02244l-59.59835,53.77665-58.95815-13.84578c-14.57-.21979-19.31136-8.9587-19.50629-9.33113l-.29761-.568,41.2489-19.22578,32.0997,9.27828,46.06046-32.45509Z" transform="translate(-259.58071 -157.88396)" fill="#3f3d56"/><polygon points="227.248 568.437 243.261 568.436 250.878 506.672 227.245 506.673 227.248 568.437" fill="#a0616a"/><path d="M483.39733,721.74476h50.32614a0,0,0,0,1,0,0V741.189a0,0,0,0,1,0,0h-36.207a14.11914,14.11914,0,0,1-14.11914-14.11914v-5.32505A0,0,0,0,1,483.39733,721.74476Z" transform="translate(757.57348 1305.02654) rotate(179.99738)" fill="#2f2e41"/><polygon points="163.247 568.437 179.26 568.436 186.878 506.672 163.245 506.673 163.247 568.437" fill="#a0616a"/><path d="M419.397,721.74476H469.7231a0,0,0,0,1,0,0V741.189a0,0,0,0,1,0,0h-36.207A14.11914,14.11914,0,0,1,419.397,727.06981v-5.32505a0,0,0,0,1,0,0Z" transform="translate(629.57273 1305.02946) rotate(179.99738)" fill="#2f2e41"/><polygon points="157.552 342.991 158.858 434.42 160.165 554.584 188.899 551.972 203.267 386.094 221.553 551.972 251.218 551.972 254.206 384.788 243.757 348.216 157.552 342.991" fill="#2f2e41"/><path d="M473.37417,513.1531c-31.26533.00239-60.04471-14.14839-60.43319-14.34263l-.32273-.16136-2.62373-62.96637c-.76082-2.22509-15.74263-46.13091-18.28-60.08625-2.57083-14.13882,34.68842-26.54742,39.213-27.99853l1.02678-11.37405,41.75366-4.49918,5.292,14.5536,14.97942,5.6168a7.40924,7.40924,0,0,1,4.59212,8.7043l-8.32539,33.85619,20.33325,112.01266-4.37755.18946C495.709,511.39658,484.38425,513.1525,473.37417,513.1531Z" transform="translate(-259.58071 -157.88396)" fill="#3f3d56"/><circle cx="454.46738" cy="294.45965" r="30.06284" transform="matrix(0.87745, -0.47966, 0.47966, 0.87745, -345.12824, 96.19037)" fill="#a0616a"/><path d="M430.1166,323.56132c5.72926,6.10289,16.36927,2.82672,17.1158-5.51069a10.07153,10.07153,0,0,0-.01268-1.94523c-.38544-3.69311-2.519-7.046-2.008-10.94542a5.73974,5.73974,0,0,1,1.05046-2.687c4.56548-6.11359,15.28263,2.73444,19.59138-2.8,2.642-3.39359-.46364-8.73664,1.56381-12.52956,2.67591-5.006,10.60183-2.53654,15.57222-5.27809,5.53017-3.05032,5.1994-11.53517,1.55907-16.6961-4.43955-6.294-12.22348-9.65241-19.91044-10.13643s-15.32094,1.59394-22.4974,4.39069c-8.15392,3.17767-16.23969,7.56925-21.25749,14.739-6.10218,8.71919-6.68942,20.44132-3.6376,30.63677C419.10222,311.0013,425.43805,318.57766,430.1166,323.56132Z" transform="translate(-259.58071 -157.88396)" fill="#2f2e41"/><path d="M641.58071,741.9626h-381a1,1,0,0,1,0-2h381a1,1,0,0,1,0,2Z" transform="translate(-259.58071 -157.88396)" fill="#cacaca"/><path d="M596.58984,294.33545a3.488,3.488,0,0,1-2.38134-.93555l-16.15723-15.00732a3.49994,3.49994,0,0,1,4.76367-5.12891l13.68555,12.71192,27.07666-27.07618a3.5,3.5,0,1,1,4.94922,4.9502l-29.46094,29.46094A3.49275,3.49275,0,0,1,596.58984,294.33545Z" transform="translate(-259.58071 -157.88396)" fill="#fff"/></svg>
defaultRedirect
passwordLength
Name
... ... @@ -1,0 +1,1 @@
1 +passwordLength
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +Require a password with the given length
Size
... ... @@ -1,0 +1,1 @@
1 +10
Number Type
... ... @@ -1,0 +1,1 @@
1 +integer
Number
... ... @@ -1,0 +1,1 @@
1 +10
passwordRuleOneLowerCaseEnabled
Name
... ... @@ -1,0 +1,1 @@
1 +passwordRuleOneLowerCaseEnabled
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +Require at least one lower case character in the password
Display Form Type
... ... @@ -1,0 +1,1 @@
1 +checkbox
Number
... ... @@ -1,0 +1,1 @@
1 +11
passwordRuleOneNumberEnabled
Name
... ... @@ -1,0 +1,1 @@
1 +passwordRuleOneNumberEnabled
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +Require at least one number in the password
Display Form Type
... ... @@ -1,0 +1,1 @@
1 +checkbox
Number
... ... @@ -1,0 +1,1 @@
1 +13
passwordRuleOneSymbolEnabled
Name
... ... @@ -1,0 +1,1 @@
1 +passwordRuleOneSymbolEnabled
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +Require at least one symbol character in the password
Display Form Type
... ... @@ -1,0 +1,1 @@
1 +checkbox
Number
... ... @@ -1,0 +1,1 @@
1 +14
passwordRuleOneUpperCaseEnabled
Name
... ... @@ -1,0 +1,1 @@
1 +passwordRuleOneUpperCaseEnabled
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +Require at least one upper case character in the password
Display Form Type
... ... @@ -1,0 +1,1 @@
1 +checkbox
Number
... ... @@ -1,0 +1,1 @@
1 +12
registrationSuccessMessage
Ограниченный
... ... @@ -1,0 +1,1 @@
1 +0
welcomeMessage
Ограниченный
... ... @@ -1,0 +1,1 @@
1 +0
liveValidation_defaultFieldOkMessage
Name
... ... @@ -1,1 +1,0 @@
1 -liveValidation_defaultFieldOkMessage
Pretty Name
... ... @@ -1,1 +1,0 @@
1 -Default field okay message
Size
... ... @@ -1,1 +1,0 @@
1 -30
Number
... ... @@ -1,1 +1,0 @@
1 -4
Use Suggest
... ... @@ -1,1 +1,0 @@
1 -0
liveValidation_enabled
Name
... ... @@ -1,1 +1,0 @@
1 -liveValidation_enabled
Pretty Name
... ... @@ -1,1 +1,0 @@
1 -Enable Javascript field validation
Display Form Type
... ... @@ -1,1 +1,0 @@
1 -checkbox
Number
... ... @@ -1,1 +1,0 @@
1 -3