xref: /dokuwiki/lib/plugins/authpdo/_test/mysql/fluxbb.php (revision df01249e8b85052013de1deba4557864723e13a5)
1*df01249eSAndreas Gohr<?php
2*df01249eSAndreas Gohr/**
3*df01249eSAndreas Gohr * Confiuration for fluxbb. They have a very simplistic model. There is no separate display name and a user can
4*df01249eSAndreas Gohr * only be in a single group.
5*df01249eSAndreas Gohr */
6*df01249eSAndreas Gohr/** @noinspection SqlResolve */
7*df01249eSAndreas Gohr$data = array(
8*df01249eSAndreas Gohr    'passcrypt' => 'sha1',
9*df01249eSAndreas Gohr    'conf' => array(
10*df01249eSAndreas Gohr        'select-user' => '
11*df01249eSAndreas Gohr            SELECT id AS uid,
12*df01249eSAndreas Gohr                   username AS user,
13*df01249eSAndreas Gohr                   username AS name,
14*df01249eSAndreas Gohr                   password AS hash,
15*df01249eSAndreas Gohr                   email AS mail
16*df01249eSAndreas Gohr              FROM fluy_users
17*df01249eSAndreas Gohr             WHERE username = :user
18*df01249eSAndreas Gohr        ',
19*df01249eSAndreas Gohr        'select-user-groups' => '
20*df01249eSAndreas Gohr            SELECT g_title AS `group`
21*df01249eSAndreas Gohr              FROM fluy_groups G, fluy_users U
22*df01249eSAndreas Gohr             WHERE U.id = :uid
23*df01249eSAndreas Gohr               AND U.group_id = G.g_id
24*df01249eSAndreas Gohr        ',
25*df01249eSAndreas Gohr        'select-groups' => '
26*df01249eSAndreas Gohr            SELECT g_id AS gid, g_title AS `group`
27*df01249eSAndreas Gohr              FROM fluy_groups
28*df01249eSAndreas Gohr        ',
29*df01249eSAndreas Gohr        'insert-user' => '
30*df01249eSAndreas Gohr            INSERT INTO fluy_users
31*df01249eSAndreas Gohr                   (group_id, username, password, email)
32*df01249eSAndreas Gohr            VALUES (0, :user, :hash, :mail)
33*df01249eSAndreas Gohr        ',
34*df01249eSAndreas Gohr        'delete-user' => '
35*df01249eSAndreas Gohr            DELETE FROM fluy_users
36*df01249eSAndreas Gohr             WHERE id = :uid
37*df01249eSAndreas Gohr        ',
38*df01249eSAndreas Gohr        'list-users' => '
39*df01249eSAndreas Gohr            SELECT DISTINCT username AS user
40*df01249eSAndreas Gohr              FROM fluy_users U, fluy_groups G
41*df01249eSAndreas Gohr             WHERE U.id = G.g_id
42*df01249eSAndreas Gohr               AND G.g_title LIKE :group
43*df01249eSAndreas Gohr               AND U.username LIKE :user
44*df01249eSAndreas Gohr               AND U.username LIKE :name
45*df01249eSAndreas Gohr               AND U.email LIKE :mail
46*df01249eSAndreas Gohr          ORDER BY username
47*df01249eSAndreas Gohr             LIMIT :limit
48*df01249eSAndreas Gohr            OFFSET :start
49*df01249eSAndreas Gohr        ',
50*df01249eSAndreas Gohr        'count-users' => '
51*df01249eSAndreas Gohr            SELECT COUNT(DISTINCT username) AS `count`
52*df01249eSAndreas Gohr              FROM fluy_users U, fluy_groups G
53*df01249eSAndreas Gohr             WHERE U.id = G.g_id
54*df01249eSAndreas Gohr               AND G.g_title LIKE :group
55*df01249eSAndreas Gohr               AND U.username LIKE :user
56*df01249eSAndreas Gohr               AND U.username LIKE :name
57*df01249eSAndreas Gohr               AND U.email LIKE :mail
58*df01249eSAndreas Gohr        ',
59*df01249eSAndreas Gohr        'update-user-info' => '', // we can't do this because username = displayname
60*df01249eSAndreas Gohr        'update-user-login' => '
61*df01249eSAndreas Gohr            UPDATE fluy_users
62*df01249eSAndreas Gohr               SET username = :newlogin
63*df01249eSAndreas Gohr             WHERE id = :uid
64*df01249eSAndreas Gohr        ',
65*df01249eSAndreas Gohr        'update-user-pass' => '
66*df01249eSAndreas Gohr            UPDATE fluy_users
67*df01249eSAndreas Gohr               SET password = :hash
68*df01249eSAndreas Gohr             WHERE id = :uid
69*df01249eSAndreas Gohr        ',
70*df01249eSAndreas Gohr        'insert-group' => '
71*df01249eSAndreas Gohr            INSERT INTO fluy_groups (g_title) VALUES (:group)
72*df01249eSAndreas Gohr        ',
73*df01249eSAndreas Gohr        'join-group' => '
74*df01249eSAndreas Gohr            UPDATE fluy_users
75*df01249eSAndreas Gohr               SET group_id = :gid
76*df01249eSAndreas Gohr             WHERE id = :uid
77*df01249eSAndreas Gohr        ',
78*df01249eSAndreas Gohr        'leave-group' => '
79*df01249eSAndreas Gohr            SELECT 1
80*df01249eSAndreas Gohr        ', // we do a no-op for this
81*df01249eSAndreas Gohr    ),
82*df01249eSAndreas Gohr    'users' => array(
83*df01249eSAndreas Gohr        array(
84*df01249eSAndreas Gohr            'user' => 'admin',
85*df01249eSAndreas Gohr            'pass' => 'pass',
86*df01249eSAndreas Gohr            'name' => 'admin',
87*df01249eSAndreas Gohr            'mail' => 'admin@example.com',
88*df01249eSAndreas Gohr            'grps' =>
89*df01249eSAndreas Gohr                array(
90*df01249eSAndreas Gohr                    0 => 'Administrators',
91*df01249eSAndreas Gohr                ),
92*df01249eSAndreas Gohr        ),
93*df01249eSAndreas Gohr        array(
94*df01249eSAndreas Gohr            'user' => 'test1',
95*df01249eSAndreas Gohr            'pass' => 'password',
96*df01249eSAndreas Gohr            'name' => 'test1',
97*df01249eSAndreas Gohr            'mail' => 'test1@example.com',
98*df01249eSAndreas Gohr            'grps' =>
99*df01249eSAndreas Gohr                array(
100*df01249eSAndreas Gohr                    0 => 'test',
101*df01249eSAndreas Gohr                ),
102*df01249eSAndreas Gohr        ),
103*df01249eSAndreas Gohr    ),
104*df01249eSAndreas Gohr);
105