Skip to content

Commit

Permalink
Update to 1.9.6
Browse files Browse the repository at this point in the history
- Register snippet PII improvements [#130]
- JSON responses for the Login controller/snippet [#121]
- Use Crowdin for translations: https://crowdin.com/project/modx-login
  • Loading branch information
Jako committed May 24, 2018
1 parent 9bb1077 commit 431eb2d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
7 changes: 6 additions & 1 deletion _build/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,13 @@
]
},
"build": {
"readme": "docs/readme.md",
"license": "docs/license.md",
"changelog": "docs/changelog.md",
"resolver": {
"after": ["fix.namespace.php"]
"after": [
"fix.namespace.php"
]
}
}
}
Binary file added _packages/login-1.9.6-pl.transport.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog file for Login component.

Login 1.9.6
====================================
- Register snippet PII improvements [#130]
- JSON responses for the Login controller/snippet [#121]
- Use Crowdin for translations: https://crowdin.com/project/modx-login

Login 1.9.5
====================================
- Fix ResetPassword passing null instead of an array to getChunk
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--------------------
Snippet: Login
--------------------
Version: 1.9.5
Since: June 21, 2010
Author: Jason Coward <[email protected]>
- Version: 1.9.6
- Since: June 21, 2010
- Author: Jason Coward <[email protected]>,
Shaun McCormick <[email protected]>

This component loads a simple login and logout form. It also comes packaged
Expand All @@ -12,11 +12,15 @@ in their username or email to receive a confirmation email which will reset
their password.

Example for Login:
```
[[!Login]]
```

You can also specify the template:

```
[[!Login? &tpl=`myLoginChunk`]]
```

See the snippet properties for more options.

Expand All @@ -29,16 +33,21 @@ user will log in to should they click on the confirmation email, and put
the Reset Password snippet in. Tell it what Resource the Login snippet is
in - or where you'd like it to provide a link back to:

```
[[ResetPassword? &loginResourceId=`72`]]
```

Then create another resource with the Forgot Password snippet, and tell it
what Resource the Reset snippet is in:

```
[[!ForgotPassword? &resetResourceId=`123`]]
```

--------
Register
--------

To use the Register snippet, simply place the Snippet in the Resource where
your HTML register form is. (A default one called lgnRegisterFormTpl has
been provided.). This snippet also requires Activation by the User, so they
Expand All @@ -47,13 +56,15 @@ will get an email in their inbox regarding their signup.
In your form field names, you can use validation filters to validate your
fields. They are separated with the colon : symbol. Example:

<input type="password" name="password:required:minLength=6" id="password"
value="[[+password]]" />
```
<input type="password" name="password:required:minLength=6" id="password" value="[[+password]]" />
```

will require that the password field not be empty, and have a minimum
length of 6 chars. You can encapsulate validator params (6 here) with ` if
the param has spaces in the name. The default validators provided are:

```
required
blank
email
Expand All @@ -62,21 +73,26 @@ minLength=`123`
maxLength=`123`
minValue=`123`
maxValue=`123`
```

You can also do custom validators by creating a Snippet and using that as
the validator name. Example: We create a Snippet called 'equalTo' and
on our field, we set:

```
<input type="text" name="field:equalTo=`123`" id="field" />
```

Now, in our snippet, our code would look like so:

```
<?php
if ($scriptProperties['value'] !== $scriptProperties['param']) {
return 'Value not equal to: '.$scriptProperties['param'];
}
return true;
?>
```

Returning true will make the field valid. Any other return value will
be the error message. Snippets get passed the following parameters:
Expand All @@ -87,7 +103,7 @@ be the error message. Snippets get passed the following parameters:
- type: The name of the validator.
- validator: A reference to the lgnValidator instance.

See the Snippet Properties for more options.
See the Snippet Properties and the [MODX Docs](https://docs.modx.com/extras/revo/login) for more options.

Thanks,
Jason Coward & Shaun McCormick
Expand Down

0 comments on commit 431eb2d

Please sign in to comment.