Phorum member system for complete site
Posted by Terradon
Phorum member system for complete site June 12, 2011 07:24AM |
Registered: 14 years ago Posts: 160 |
It seems an easy question and i think it should be an easy answer too, but i just don't see how to use the phorum member system as a membersystem for an whole site?
All questions are about integrating an existing membersystem into phorum, but i just want to try to replace my existing login system by the phorum login system. Our (boardgame)site uses sessions to keep track of user items/game-state and so on.
All questions are about integrating an existing membersystem into phorum, but i just want to try to replace my existing login system by the phorum login system. Our (boardgame)site uses sessions to keep track of user items/game-state and so on.
Re: Phorum member system for complete site June 12, 2011 11:11AM |
Admin Registered: 19 years ago Posts: 8,532 |
There are various options for that.
One is to include the Phorum framework code, by including common.php. By doing that, you can make use of the Phorum authentication in the same way as the Phorum scripts. Note that in 5.2 you need to chdir() to the Phorum install directory to make this work. In 5.3, it will be possible to include common.php from any script, making this method somewhat easier to use.
The other method, is to use the quick authentication script that Brian wrote. If you search for "quick authentication" on these boards, then you'll find information about that. This script does a lightweight implementation of the Phorum authentication. It takes thePhorum session cookie and uses that to lookup the user data from the Phorum database. This data is stored in a global variable, so you can reference it from your own code.
If you only need to check for the authenticated user, then the quick authentication method is probably best. If you also want to be able to use the Phorum framework, e.g. to store new data for the user in the Phorum database, then it's more useful to include the framework code. Of course, a hybrid path could be useful to, depending on the kind of integration needs that you have.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
One is to include the Phorum framework code, by including common.php. By doing that, you can make use of the Phorum authentication in the same way as the Phorum scripts. Note that in 5.2 you need to chdir() to the Phorum install directory to make this work. In 5.3, it will be possible to include common.php from any script, making this method somewhat easier to use.
The other method, is to use the quick authentication script that Brian wrote. If you search for "quick authentication" on these boards, then you'll find information about that. This script does a lightweight implementation of the Phorum authentication. It takes thePhorum session cookie and uses that to lookup the user data from the Phorum database. This data is stored in a global variable, so you can reference it from your own code.
If you only need to check for the authenticated user, then the quick authentication method is probably best. If you also want to be able to use the Phorum framework, e.g. to store new data for the user in the Phorum database, then it's more useful to include the framework code. Of course, a hybrid path could be useful to, depending on the kind of integration needs that you have.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Phorum member system for complete site July 17, 2011 04:53PM |
Registered: 14 years ago Posts: 160 |
Thank you, i will include common.php in my header file, so it will be available through our whole site.
If i understand it well, i can easily use my own forms for logging in, register and sending forgotten passwords?
One more question, phorum uses all myisam tables, while i rather wanna use InnoDB, especially for committing multiple updates, inserts ,delete actions and storing images inside a table.
InnoDB actually does store images not in the table itself, but stores it in its own filesystem and in the table it stores a reference to it. The advantage is, when reading rows in a very large table, it only reads the reference instead all the bits of the image. So storing images in a table won't slow down reading large tables and you still can rely on the database for keeping the integrity of your data (images) on the database .
If i understand it well, i can easily use my own forms for logging in, register and sending forgotten passwords?
One more question, phorum uses all myisam tables, while i rather wanna use InnoDB, especially for committing multiple updates, inserts ,delete actions and storing images inside a table.
InnoDB actually does store images not in the table itself, but stores it in its own filesystem and in the table it stores a reference to it. The advantage is, when reading rows in a very large table, it only reads the reference instead all the bits of the image. So storing images in a table won't slow down reading large tables and you still can rely on the database for keeping the integrity of your data (images) on the database .
Re: Phorum member system for complete site July 18, 2011 01:01AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Phorum member system for complete site July 18, 2011 01:14AM |
Admin Registered: 19 years ago Posts: 8,532 |
Like Thomas says, you can convert the tables at will. Only not the search table, which needs to be a MyISAM table because of the full text indexing that is in use for it.
Creating your own login form is possible. Just remember to set the temporary cookie that is normally set by the login.php script in order to prove to the server that the browser supports cookies.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Creating your own login form is possible. Just remember to set the temporary cookie that is normally set by the login.php script in order to prove to the server that the browser supports cookies.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Phorum member system for complete site July 18, 2011 01:45PM |
Registered: 14 years ago Posts: 160 |
i was just wondering if their is phorum code which is especially optimized for myisam tables, which could be potentially less for innodb tables. For example: count(*) has a different behaviour in myisam and innoDB (in terms of speed, not result, because they both handle count(*) on a different way. The other example has been mentioned above, about the way these tables store images).
For now, i will convert all tables, except the search table, to innoDB.
Thanks for both answers.
For now, i will convert all tables, except the search table, to innoDB.
Thanks for both answers.
Re: Phorum member system for complete site July 18, 2011 02:05PM |
Admin Registered: 19 years ago Posts: 8,532 |
I am not aware of any MyISAM-specific code, except for the search table index. The reason for using MyISAM by default is one born from the need for system compatibility, not because we prefer it over innodb.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Phorum member system for complete site July 19, 2011 01:36PM |
Registered: 14 years ago Posts: 160 |
Sorry, only registered users may post in this forum.