Initial commit.
[dead/third_party_db_auth.git] / LocalSettings.third_party_db_auth.php
1 <?php
2 // First, require the plugin.
3 require_once './extensions/third_party_db_auth.class.php';
4
5 // Now create the plugin object.
6 $wgAuth = new ThirdPartyDbAuth('localhost',
7 'db_name',
8 'db_username',
9 'db_password');
10
11 /* Here, you have to set the two queries that the class will
12 * use to determine:
13 *
14 * a) whether or not a given username/password combination is valid
15 * b) whether or not a given user exists in the database
16 *
17 * These defaults (below) should give you some idea of how this works.
18 * There are two variables allowed in the quereis, %u and %p
19 * which will be expanded to the supplied username and password
20 * respectively.
21 *
22 * The authentication or existence check will succeed (return true)
23 * if the query returns any rows. Note that this implementation
24 * makes the username/password case-insensitve.
25 */
26 $wgAuth->set_authentication_query("SELECT * FROM users WHERE username='%u' AND password='%p'");
27 $wgAuth->set_user_exists_query("SELECT * FROM users WHERE username='%u'");
28 ?>