09-09-2017, 04:33 PM
The token should be generated in the form itself and read in the $_POST section. The class itself is auto-instantiated in the init.
Ok. So let's take a step back. There's a "proper" way to do this that will allow us to help you and make sure our updates don't break your system.
Step 1.
Don't modify anything in the users folder. Leave that alone. We've worked super hard to make sure it's not necessary to change anything there. Maybe the login links in the navigation or something like that, but no "real" editing. To be honest, I think if I wanted ABSOLUTE compatibility, I wouldn't even change the login links. I would create a login.php in usersc and put
<?php require_once '../users/init.php';
Redirect::to('../login.php');
This lets you leave EVERYTHING alone and won't have compatibility options.
Step 2.
You're absolutely fine putting your login file in the root.
In fact, if I take your paste here
http://pasted.co/fd5abeea
and create a login.php file in the root, it works fine for me.
Step 3.
If that paste doesn't work for you... go back and revert any core userspice files you changed because you probably broke something.
Note that my paste from you didn't have your header and footer stuff. See the screenshot...
http://puu.sh/xvC01/7517444e95.png
So, if you revert your files and are still having a problem, then your problem is in the header/footer files that you created (which weren't loaded on my system). Try commenting those out until you can login and that will point you to where your problem is.
Step 4.
Includes. When you're doing include/require once, we have some magic urls that are available to you.
A require once should look like this
note that there is no / between the us_url_root and users. You can point that wherever you want. It doesn't have to go to the users file, but that formatting will "magically" grab the beginning part of your path so it will always be right.
These are little nit picks, but if you start doing things this way, your life will be INCREDIBLY easier down the road when you try to upgrade and when you want help in the forums.
And as always, I tell newbies with userspice to check out this video on dealing with the database...
https://www.youtube.com/watch?v=rb0kD5tCENM
Ok. So let's take a step back. There's a "proper" way to do this that will allow us to help you and make sure our updates don't break your system.
Step 1.
Don't modify anything in the users folder. Leave that alone. We've worked super hard to make sure it's not necessary to change anything there. Maybe the login links in the navigation or something like that, but no "real" editing. To be honest, I think if I wanted ABSOLUTE compatibility, I wouldn't even change the login links. I would create a login.php in usersc and put
<?php require_once '../users/init.php';
Redirect::to('../login.php');
This lets you leave EVERYTHING alone and won't have compatibility options.
Step 2.
You're absolutely fine putting your login file in the root.
In fact, if I take your paste here
http://pasted.co/fd5abeea
and create a login.php file in the root, it works fine for me.
Step 3.
If that paste doesn't work for you... go back and revert any core userspice files you changed because you probably broke something.
Note that my paste from you didn't have your header and footer stuff. See the screenshot...
http://puu.sh/xvC01/7517444e95.png
So, if you revert your files and are still having a problem, then your problem is in the header/footer files that you created (which weren't loaded on my system). Try commenting those out until you can login and that will point you to where your problem is.
Step 4.
Includes. When you're doing include/require once, we have some magic urls that are available to you.
A require once should look like this
Code:
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
These are little nit picks, but if you start doing things this way, your life will be INCREDIBLY easier down the road when you try to upgrade and when you want help in the forums.
And as always, I tell newbies with userspice to check out this video on dealing with the database...
https://www.youtube.com/watch?v=rb0kD5tCENM