I really am a noob, then again, they explain these directions poorly.
I have accountify in a different folder, so what do I have to change to make it right?
I've read the directions, but it confuses me. I want to do this the right way.
SITE_BASE, which automatically expands to your site's home page. That's a good choice for most sites. But if it is not what you want, be sure to change this setting.
9. Accountify sends email messages to users in several situations: when they first create their accounts (and must verify them), when accounts require administrator approval (this message goes to the administrator), when users are invited to join the site, when users forget their passwords and need to change them, and when an account has been approved or rejected.
By default, Accountify will send these messages "from" whatever the default "From:" address is on your web server. This can be confusing. Fortunately, beginning in Accountify 2.02, you can fix this by setting the fromAddress option in login_config.php to any email address (although email addresses in domains not residing on the same company's mail servers are unlikely to work well).
For example, you can set this option as follows:
fromAddress = "Our Staff <staff@example.com>"
Keep in mind that options in login_config.php are separated by commas. I have no trailing comma here because this is the last option in my copy of login_config.php, but if you choose to list the options in another order, don't forget the comma.
The email messages sent in these situations are very generic, because I don't know much about your site! So I strongly recommend that you also edit the verificationBody, resetBody, approvalBody, approvedBody and deniedBody settings in login_config.php to better reflect what your site is about. That way users won't just delete the email. Make sure you keep VERIFICATION_URL, RESET_URL and similar capitalized macro names— these are automatically replaced with the links that users must follow to complete an action.
Prior to version 2.0, Accountify required email verification to change an email address or close an account. Beginning in version 2.0, such actions simply require that the user reenter their password. This is much less tedious for everyone. Of course, we still offer an "I forgot my password" feature that allows the password to be reset by email.
10. Decide whether you want to use Accountify's built-in PHP session manager. While PHP's standard support for sessions does work, it is insecure on shared hosts, and less efficient than the use of a database. Accountify's built-in session manager takes advantage of Pear::DB and MySQL. If you don't want this, you can disable it by setting builtInSessions to false in login_config.php. In most cases, this is only worthwhile for high-traffic sites that wish to use session managers like memcached. If you don't understand the issue, I strongly recommend that you leave this setting alone.
10. Upload the accountify folder to your website, complete with your edited version of login_config.php. Upload the entire accountify folder so that it appears just below your web site's document root. Note that if you prefer another location, you will need to adjust the cssUrl setting in login_config.php.
11. Visit the setup.php page once to create the database tables:
http://www.example.com/accountify/setup.php
Although the table-creation code is harmless to run more than once, it's not a bad idea to remove setup.php after the table has been successfully created. If the table creation code generates an error message, it is likely that your database settings are incorrect in login_config.php. You should fix those before continuing.
12. Modify your pages to load Accountify at the beginning, include the appropriate CSS, and display the login prompt, as described later in this article.
13. Take advantage of Accountify in your own code, as described later in this article.
How To Use Accountify
PHP provides us with a built-in mechanism for handling "sessions." That is, we can easily keep track of a user's choices during a particular visit to a website. But PHP does not have a built-in system for handling accounts. So most PHP developers wind up reinventing it, writing PHP and MySQL code to store account information in a database.
That's a shame, because PHP's sessions are convenient and require very little programmer effort. If only there were a similar solution for accounts...
That's where Accountify comes in handy.
Adding Accounts With Accountify
Your first step is to add the following code at the very beginning of each page, assuming that the page is in the same folder with Accountify. If your page is in a different folder, and it probably will be, adjust your require command accordingly with a relative path or an absolute file system path (not a URL) that is appropriate for your system:
<?php
# The above line must be THE FIRST LINE in the ENTIRE file
# The path that follows will work if you have installed
# Accountify's 'accountify' folder in your document root
# (where your site's home page lives)
require $_SERVER['DOCUMENT_ROOT'] . '/accountify/login.php';
?>
You can, of course, install Accountify in a different location, in which case your require command will be different. If you don't understand this, install Accountify in the suggested location.
If you have installed the accountify folder in the suggested location, you will also find it easy to bring in Accountify's style sheet in the head element of your pages:
<link
href="/accountify/chrome/login.css"
rel="stylesheet" type="text/css"/>
If you have placed Accountify somewhere else, you will need to alter the URL above accordingly.
The require command above fetches information from the user's account and automatically folds it into the $_SESSION array... much like PHP's normal session support. In fact, since Accountify is built on top of PHP sessions, you'll still get session data storage for users who are not logged in. And if the user has logged into an account, their session is automatically reloaded from a MySQL database. Cookies expire, but accounts are forever.