Hi there, I’m just starting with modx as a first CMS. I’ve only just begun working with PHP and MySQL so I’m having trouble setting up a user login.
Basically the website I am creating is for a local business I am interning for. Its more or less a file sharing system for four people, with a couple additional features. All of the pages within the website need to be accessible by only the four people as there may be information that only they should know.
I’ve installed the ’login’ package available from modx. Ive got the login/password fields to display on the page, however when the information is submitted nothing happens. The login/password fields simply reappear blank. Looking over the code for the snippet, I simply couldn’t figure out what I would need to change in order for another page to load once the login info is entered. (Or on another note, how to set up the error messages etc). I’ve been trying to figure this out for hours, however much of the information I have found has been to advanced for me to understand.
Is there any step by step tutorial available for this, or simply a page explaining what paramaters, etc I would need to change?
Thanks for the time, it is much appreciated;
Richard
I have everything set up through a local server running from wampserver:
------
PHP version: 5.3
Apache version: 2.2.11
OS: Windows 7
MySQL version: 5.1.36
Modx version: 2.0.6-pl
Browser: testing through IE 8 as i’m logged in through Firefox.
I found the documentation for it prior to creating this thread, however I have not been able to get it to work.
Whenever I drag the login fields snippet to my page, they appear correctly. However I’m not quite sure how to change the Post so that it would then show something like ’login successful’ and allow access to the pages within the site. As of now, when you hit submit, something loads and the login fields simply turn blank.
-
☆ A M B ☆
- 3,141 Posts
Can you post the snippet calls you’re using?
When working with users, you need to make sure you’re not calling Login, or user-specific content/resources as cached...
Cached call: [[Login]]
Uncached: [[!Login]]
As Mark says, it usually helps to post the snippet code that you’re using, if you want swifter help (easier to fix something partial than explain everything).
If you’ve definitely created a user, and you are logging in with that user, then the clearing of fields in itself means you’re logged in. You can redirect a user on successful login using this parameter - &loginResourceId=`#` replacing the # with the resource id of the page you want.
If all you want is a quick confirmation of what’s going on - try adding this to your form page somewhere prominent -
You're logged in as [[+modx.user.id:userinfo=`username`]]
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
-
☆ A M B ☆
- 3,141 Posts
I think the Login snippets outputs the login form only when you’re not logged in.. and if you are, it shows a logout link.
I’m still guessing cache issue
Awesome, works perfectly!
Thanks for the help.