Update WordPressInt.md file

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Vitalii Koshura 2023-04-09 17:08:34 +02:00
parent eaf61ee502
commit 682a6d95c7
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
3 changed files with 32 additions and 15 deletions

@ -1,24 +1,41 @@
# [WordPress](http://wordpress.org) CMS Integration with BOINC
[WordPress](http://wordpress.org) is a popular Content Management System (CMS) for easily creating robust and feature-rich websites. It is ideal to use for a main website with or without integrating BOINC pages. It can be useful to have a basic [WordPress](http://wordpress.org) website with no logins, but if a user logins they get more features from the website. Rather than having a separate [WordPress](http://wordpress.org) user table, it is possible to authenticate using an external database table, such as the mysql database table 'users' in BOINC.
* To setup [WordPress](http://wordpress.org) to authenticate with your BOINC mysql 'user' table, install the external database authentication plugin http://wordpress.org/extend/plugins/external-database-authentication [[BR]]
* You will then want to 'Activate' this plug-in in your [WordPress](http://wordpress.org) Plugins admin screen [[BR]]
* In the Settings bar on the left side of your [WordPress](http://wordpress.org) Dashboard screen, choose the 'External DB Settings' link [[BR]]
* You will want to select the MySQL support, fill in your appropriate names for the database host, TCP port (if not the mysql default of 3306), username, password, and of course the BOINC mysql table name 'user' [[BR]]
* in the External Database Source fields, you will want to make username "email_addr" (mapping the BOINC user table email_addr to the wordpress username - a record will be created in WordPress to match these defaults). [[BR]]
* for Password, put in "passwd_hash", and Password Encryption Method is "Other" [[BR]]
* the Hash Code field should be "$password2 = md5($password . $username)". This is how WordPress can create a password hash that the BOINC mysql 'user' table can authenticate. [[BR]]
* Then for Homepage you can put the user's boinc "url" and Email is of course the BOINC user field "email_addr" [[BR]]
* You may want to put in a special login message (not shown on the screenshot, but the last entry on the page) such as:
Please use your BOINC account to sign in. <BR>
If you dont have one, please <a href="http://your.boinc.site.url/login_form.php" target="blank" class="fancy_button">register!</a>
* To setup [WordPress](http://wordpress.org) to authenticate with your BOINC mysql 'user' table, install the external database authentication plugin http://wordpress.org/extend/plugins/external-database-authentication
Screenshot: [[Image(wpauth.jpg)]]
* You will then want to 'Activate' this plug-in in your [WordPress](http://wordpress.org) Plugins admin screen
* In the Settings bar on the left side of your [WordPress](http://wordpress.org) Dashboard screen, choose the 'External DB Settings' link
* You will want to select the MySQL support, fill in your appropriate names for the database host, TCP port (if not the mysql default of 3306), username, password, and of course the BOINC mysql table name 'user'
* in the External Database Source fields, you will want to make username "email_addr" (mapping the BOINC user table email_addr to the wordpress username - a record will be created in WordPress to match these defaults).
* for Password, put in "passwd_hash", and Password Encryption Method is "Other"
* the Hash Code field should be "$password2 = md5($password . $username)". This is how WordPress can create a password hash that the BOINC mysql 'user' table can authenticate.
* Then for Homepage you can put the user's boinc "url" and Email is of course the BOINC user field "email_addr"
* You may want to put in a special login message (not shown on the screenshot, but the last entry on the page) such as:
```
Please use your BOINC account to sign in. <BR>
If you dont have one, please <a href="http://your.boinc.site.url/login_form.php" target="blank" class="fancy_button">register!</a>
```
![Image](wpauth.jpg)
There is a modified version of this plugin attached to this page. It will allow you to add an authenticator field which will set a cookie named 'auth' for your website - so that it effectively will have an 'auto-login' via BOINC when coming to your site's BOINC pages from your WordPress pages. The screenshot below shows how the plug-in screen looks with this mod (it just adds the authenticator field and sets the cookie upon a successful login).
Screenshot: [[Image(wpauthmod.jpg)]]
![Image](wpauthmod.jpg)
Next will be how to port your WordPress theme stylesheet to the BOINC stylesheets so the different sites look similar!

BIN
wpauth.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

BIN
wpauthmod.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB