Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-05-19 21:50:37
- KurtRaschke
- Plugin Author
- Registered: 2004-05-16
- Posts: 275
TypeKey authentication support
I am releasing the first second version of my patch to enable TypeKey authentication for Textpattern. The patch consists of five modified files, and one new file, which is Daiji Hriata’s Auth_TypeKey code for PHP. I had to make a few changes to Auth_TypeKey to get it to work, but for the most part the patch is just code to glue the various parts together.
You can either download the patch for the changed files and the one new file by itself, or you can download the changed files individually (if you’re not comfortable with the <code>patch</code> utility):
- http://www.raschke.net/~kurt/software/textpattern/auth/txp_typekey.patch
- http://www.raschke.net/~kurt/software/textpattern/auth/lib/Auth_TypeKey.phps
or, as individual files:
- http://www.raschke.net/~kurt/software/textpattern/auth/publish.php
- http://www.raschke.net/~kurt/software/textpattern/auth/_update.php
- http://www.raschke.net/~kurt/software/textpattern/auth/publish/comment.php
- http://www.raschke.net/~kurt/software/textpattern/auth/lang/en-us.txt
- http://www.raschke.net/~kurt/software/textpattern/auth/include/txp_prefs.php
- http://www.raschke.net/~kurt/software/textpattern/auth/lib/Auth_TypeKey.phps
After you have either applied the patch and added Auth_TypeKey or moved the new files into their respective locations, you’ll need to sign up for a TypeKey account and site token at http://www.typekey.com. Log in to Textpattern, then turn on TypeKey on the prefs page. Save the prefs, then you’ll see a new prefs option where you can enter the site token. Save that, and you’re set.
Then, all you need to do is place <code><txp:comment_typekey /></code> somewhere in your comment form. That tag will automatically generate a link to the TypeKey login page. After the user logs into TypeKey (if they’re not already logged in), then they’ll be redirected back to your site, and the comment form will be filled in with their information.
Comments left by authenticated users are specifically marked in the database. You can then add <code><txp:comment_isauthenticated></txp:comment_isauthenticated></code> to your comment form if you want to display specific content for authenticated comments. Additionally, there is a new option in the prefs to allow authenticated comments to bypass moderation. If you trust authenticated users to leave only legitimate comments, then this may reduce your workload in terms of moderating comments.
Some final notes: At this point I would suggest that you apply this patch only if you are familiar with PHP debugging and are willing to go hunting for bugs if things break. I have tested it on my own server running PHP 5, but that’s it. Obviously, you may run into issues on your own server, and I would be more than happy to help you debug those issues, but it will help if you have some PHP programming experience. Additionally, please be advised that this patch requires that PHP be compiled with either the BCMath or GMP extensions…check the output of <code>phpinfo()</code> to confirm.
Translators, be advised that the following new strings are used (and are already in en_us):- use_typekey => Use TypeKey?
- typekey_token => TypeKey site token
- comments_authenticated_bypass => Authenticated comments bypass moderation?
- typekey_login => TypeKey login
- typekey_logout => TypeKey logout
To-do (in future revisions):
- Better error handling
Localized strings in login/logout link- -Move preferences out of admin_config.php and into txp_prefs (will require adding rows to the database in _update.php, unless prefs get fixed soon
Last edited by KurtRaschke (2005-05-30 23:31:44)
kurt@kurtraschke.com
Offline
Pages: 1