plugin:authpdo
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:authpdo [2018-04-29 19:42] – Aleksandr | plugin:authpdo [2020-10-31 18:31] (current) – [Real World Examples] webtist_hanschur | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
Line 22: | Line 22: | ||
This plugin allows to configure your wiki to authenticate against an existing database using PHP's PDO extension. Typical use cases are integrating DokuWiki with a web forum, blog or bug tracker. | This plugin allows to configure your wiki to authenticate against an existing database using PHP's PDO extension. Typical use cases are integrating DokuWiki with a web forum, blog or bug tracker. | ||
+ | |||
===== Real World Examples ===== | ===== Real World Examples ===== | ||
Line 27: | Line 28: | ||
Before you go forward to [[# | Before you go forward to [[# | ||
- | * [[plugin: | + | * [[plugin: |
- | * [[plugin: | + | * [[plugin: |
- | * [[plugin: | + | * [[plugin: |
- | * [[plugin: | + | * [[plugin: |
- | + | * [[plugin: | |
+ | * [[plugin: | ||
===== Configuration ===== | ===== Configuration ===== | ||
To configure this plugin, some experience with database queries and the SQL query language is required. Sample configurations for popular systems will soon be provided by the community. | To configure this plugin, some experience with database queries and the SQL query language is required. Sample configurations for popular systems will soon be provided by the community. | ||
- | The configuration consists mostly of SQL statements to access your database. The plugin itself is completely database agnostic. You can use it to access any database supported by PDO - refer to [[http:// | + | The configuration consists mostly of SQL statements to access your database. The plugin itself is completely database agnostic. You can use it to access any database supported by PDO -- refer to [[http:// |
In most of the statements named PDO placeholders are used (colon prefixed alphanumeric). These represent the actual data that will be inserted into the statement. The PDO driver takes care of proper escaping - you do not have to worry about it. | In most of the statements named PDO placeholders are used (colon prefixed alphanumeric). These represent the actual data that will be inserted into the statement. The PDO driver takes care of proper escaping - you do not have to worry about it. | ||
Line 43: | Line 46: | ||
Each option below comes with an example that shows how the statement would look for a fictive [[#example database]] given at the end of this page. | Each option below comes with an example that shows how the statement would look for a fictive [[#example database]] given at the end of this page. | ||
+ | |||
==== General Settings ==== | ==== General Settings ==== | ||
+ | |||
=== Option ' | === Option ' | ||
This setting will output detailed error messages whenever something goes wrong. You most probably want to enable this during the initial configuration of the plugin. Once everything works you should definitely disable this again as it may leak important information to possible attackers. | This setting will output detailed error messages whenever something goes wrong. You most probably want to enable this during the initial configuration of the plugin. Once everything works you should definitely disable this again as it may leak important information to possible attackers. | ||
+ | |||
=== Option ' | === Option ' | ||
Line 66: | Line 72: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | |||
=== Option ' | === Option ' | ||
This option configures the user to use to connect to the database. You can leave it empty for sqlite databases. | This option configures the user to use to connect to the database. You can leave it empty for sqlite databases. | ||
+ | |||
=== Option ' | === Option ' | ||
This is the password for above user. You can leave it empty for sqlite databases. | This is the password for above user. You can leave it empty for sqlite databases. | ||
+ | |||
==== Related Core Settings ==== | ==== Related Core Settings ==== | ||
Line 79: | Line 88: | ||
There are a couple of settings you most probably want to tune when enabling authpdo: | There are a couple of settings you most probably want to tune when enabling authpdo: | ||
- | * [[config: | + | * [[config: |
- | * [[config: | + | * [[config: |
- | * [[config: | + | * [[config: |
- | * [[config: | + | * [[config: |
Line 88: | Line 97: | ||
This plugin gains more capabilities the more of the configuration you fill in. You can leave out configuration at the expense of functionality. However a few statements are required to have minimal login functionality: | This plugin gains more capabilities the more of the configuration you fill in. You can leave out configuration at the expense of functionality. However a few statements are required to have minimal login functionality: | ||
+ | |||
=== Option ' | === Option ' | ||
Line 113: | Line 123: | ||
WHERE " | WHERE " | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 133: | Line 144: | ||
AND m." | AND m." | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 152: | Line 164: | ||
Example: | Example: | ||
- | < | + | < |
SELECT uid | SELECT uid | ||
FROM user | FROM user | ||
Line 158: | Line 170: | ||
AND pass = MD5(CONCAT(MD5(user), | AND pass = MD5(CONCAT(MD5(user), | ||
</ | </ | ||
+ | |||
+ | |||
==== Additional SQL Setup ==== | ==== Additional SQL Setup ==== | ||
Line 222: | Line 236: | ||
| | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 236: | Line 251: | ||
DELETE FROM " | DELETE FROM " | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 243: | Line 259: | ||
^ Guaranteed Placeholders ^^ | ^ Guaranteed Placeholders ^^ | ||
| '': | | '': | ||
- | | '': | + | | '': |
| '': | | '': | ||
| '': | | '': | ||
- | | '': | + | | '': |
- | | '': | + | | '': |
- | | '': | + | | '': |
^ Mandatory fields to return ^^ | ^ Mandatory fields to return ^^ | ||
| '' | | '' | ||
Line 267: | Line 283: | ||
LIMIT : | LIMIT : | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 274: | Line 291: | ||
^ Guaranteed Placeholders ^^ | ^ Guaranteed Placeholders ^^ | ||
| '': | | '': | ||
- | | '': | + | | '': |
| '': | | '': | ||
| '': | | '': | ||
^ Mandatory fields to return ^^ | ^ Mandatory fields to return ^^ | ||
- | | '' | + | | '' |
<code tsql> | <code tsql> | ||
Line 293: | Line 309: | ||
AND U." | AND U." | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 310: | Line 327: | ||
WHERE " | WHERE " | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 331: | Line 349: | ||
WHERE " | WHERE " | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 350: | Line 369: | ||
WHERE " | WHERE " | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 362: | Line 382: | ||
| | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 378: | Line 399: | ||
| | ||
</ | </ | ||
+ | |||
=== Option ' | === Option ' | ||
Line 394: | Line 416: | ||
AND " | AND " | ||
</ | </ | ||
+ | |||
===== Example Database ===== | ===== Example Database ===== | ||
Line 401: | Line 424: | ||
{{ : | {{ : | ||
- | < | + | < |
CREATE TABLE user ( | CREATE TABLE user ( | ||
" | " | ||
Line 419: | Line 442: | ||
); | ); | ||
</ | </ | ||
+ | |||
===== A Warning on MySQL MyISAM ===== | ===== A Warning on MySQL MyISAM ===== |
plugin/authpdo.1525023772.txt.gz · Last modified: 2018-04-29 19:42 by Aleksandr