xref: /dokuwiki/lib/plugins/authpdo/_test/mysql/wordpress.php (revision 964d95c6130dddb157480af3e30604388849f24f)
13f4d1534SAndreas Gohr<?php
23f4d1534SAndreas Gohr/**
33f4d1534SAndreas Gohr * Basic Wordpress config
43f4d1534SAndreas Gohr *
53f4d1534SAndreas Gohr * Wordpress has no proper groups. This configures the default access permissions as groups. Better group
63f4d1534SAndreas Gohr * support is available through a Wrdpress plugin
73f4d1534SAndreas Gohr */
83f4d1534SAndreas Gohr/** @noinspection SqlResolve */
93f4d1534SAndreas Gohr$data = array(
103f4d1534SAndreas Gohr    'passcrypt' => 'pmd5',
113f4d1534SAndreas Gohr    'conf' => array(
123f4d1534SAndreas Gohr        'select-user' => '
133f4d1534SAndreas Gohr            SELECT ID AS uid,
143f4d1534SAndreas Gohr                   user_login AS user,
153f4d1534SAndreas Gohr                   display_name AS name,
163f4d1534SAndreas Gohr                   user_pass AS hash,
173f4d1534SAndreas Gohr                   user_email AS mail
183f4d1534SAndreas Gohr              FROM wpvk_users
193f4d1534SAndreas Gohr             WHERE user_login = :user
203f4d1534SAndreas Gohr        ',
213f4d1534SAndreas Gohr        'select-user-groups' => '
22*964d95c6SAndreas Gohr            SELECT CONCAT("group",meta_value) AS `group`
233f4d1534SAndreas Gohr              FROM wpvk_usermeta
243f4d1534SAndreas Gohr             WHERE user_id = :uid
253f4d1534SAndreas Gohr               AND meta_key = "wpvk_user_level"
263f4d1534SAndreas Gohr        ',
273f4d1534SAndreas Gohr        'select-groups' => '',
283f4d1534SAndreas Gohr        'insert-user' => '',
293f4d1534SAndreas Gohr        'delete-user' => '',
30*964d95c6SAndreas Gohr        'list-users' => '
31*964d95c6SAndreas Gohr            SELECT DISTINCT user_login AS user
32*964d95c6SAndreas Gohr              FROM wpvk_users U, wpvk_usermeta M
33*964d95c6SAndreas Gohr             WHERE U.ID = M.user_id
34*964d95c6SAndreas Gohr               AND M.meta_key = "wpvk_user_level"
35*964d95c6SAndreas Gohr               AND CONCAT("group", M.meta_value) LIKE :group
36*964d95c6SAndreas Gohr               AND U.user_login LIKE :user
37*964d95c6SAndreas Gohr               AND U.display_name LIKE :name
38*964d95c6SAndreas Gohr               AND U.user_email LIKE :mail
39*964d95c6SAndreas Gohr          ORDER BY user_login
40*964d95c6SAndreas Gohr             LIMIT :limit
41*964d95c6SAndreas Gohr            OFFSET :start
42*964d95c6SAndreas Gohr        ',
43*964d95c6SAndreas Gohr        'count-users' => '
44*964d95c6SAndreas Gohr            SELECT COUNT(DISTINCT user_login) as `count`
45*964d95c6SAndreas Gohr              FROM wpvk_users U, wpvk_usermeta M
46*964d95c6SAndreas Gohr             WHERE U.ID = M.user_id
47*964d95c6SAndreas Gohr               AND M.meta_key = "wpvk_user_level"
48*964d95c6SAndreas Gohr               AND CONCAT("group", M.meta_value) LIKE :group
49*964d95c6SAndreas Gohr               AND U.user_login LIKE :user
50*964d95c6SAndreas Gohr               AND U.display_name LIKE :name
51*964d95c6SAndreas Gohr               AND U.user_email LIKE :mail
52*964d95c6SAndreas Gohr        ',
533f4d1534SAndreas Gohr        'update-user-info' => '
543f4d1534SAndreas Gohr            UPDATE wpvk_users
553f4d1534SAndreas Gohr               SET display_name = :name,
563f4d1534SAndreas Gohr                   user_email = :mail
573f4d1534SAndreas Gohr             WHERE ID = :uid
583f4d1534SAndreas Gohr        ',
593f4d1534SAndreas Gohr        'update-user-login' => '
603f4d1534SAndreas Gohr            UPDATE wpvk_users
613f4d1534SAndreas Gohr               SET user_login  = :newlogin
623f4d1534SAndreas Gohr             WHERE ID = :uid
633f4d1534SAndreas Gohr        ',
643f4d1534SAndreas Gohr        'update-user-pass' => '
653f4d1534SAndreas Gohr            UPDATE wpvk_users
663f4d1534SAndreas Gohr               SET user_pass = :hash
673f4d1534SAndreas Gohr             WHERE ID = :uid
683f4d1534SAndreas Gohr        ',
693f4d1534SAndreas Gohr        'insert-group' => '',
703f4d1534SAndreas Gohr        'join-group' => '',
713f4d1534SAndreas Gohr        'leave-group' => '',
723f4d1534SAndreas Gohr    ),
733f4d1534SAndreas Gohr    'users' => array(
743f4d1534SAndreas Gohr        array(
753f4d1534SAndreas Gohr            'user' => 'admin',
763f4d1534SAndreas Gohr            'pass' => 'pass',
773f4d1534SAndreas Gohr            'name' => 'admin',
783f4d1534SAndreas Gohr            'mail' => 'admin@example.com',
793f4d1534SAndreas Gohr            'grps' =>
803f4d1534SAndreas Gohr                array(
813f4d1534SAndreas Gohr                    0 => 'group10',
823f4d1534SAndreas Gohr                ),
833f4d1534SAndreas Gohr        ),
843f4d1534SAndreas Gohr        array(
853f4d1534SAndreas Gohr            'user' => 'test1',
863f4d1534SAndreas Gohr            'pass' => 'pass',
873f4d1534SAndreas Gohr            'name' => 'Test1 Subscriber',
883f4d1534SAndreas Gohr            'mail' => 'test1@example.com',
893f4d1534SAndreas Gohr            'grps' =>
903f4d1534SAndreas Gohr                array(
913f4d1534SAndreas Gohr                    0 => 'group0',
923f4d1534SAndreas Gohr                ),
933f4d1534SAndreas Gohr        ),
943f4d1534SAndreas Gohr        array(
953f4d1534SAndreas Gohr            'user' => 'test2',
963f4d1534SAndreas Gohr            'pass' => 'pass',
973f4d1534SAndreas Gohr            'name' => 'Test2 Contributor',
983f4d1534SAndreas Gohr            'mail' => 'test2@example.com',
993f4d1534SAndreas Gohr            'grps' =>
1003f4d1534SAndreas Gohr                array(
1013f4d1534SAndreas Gohr                    0 => 'group1',
1023f4d1534SAndreas Gohr                ),
1033f4d1534SAndreas Gohr        ),
1043f4d1534SAndreas Gohr        array(
1053f4d1534SAndreas Gohr            'user' => 'test3',
1063f4d1534SAndreas Gohr            'pass' => 'pass',
1073f4d1534SAndreas Gohr            'name' => 'Test3 Author',
1083f4d1534SAndreas Gohr            'mail' => 'test3@example.com',
1093f4d1534SAndreas Gohr            'grps' =>
1103f4d1534SAndreas Gohr                array(
1113f4d1534SAndreas Gohr                    0 => 'group2',
1123f4d1534SAndreas Gohr                ),
1133f4d1534SAndreas Gohr        ),
1143f4d1534SAndreas Gohr    ),
1153f4d1534SAndreas Gohr);
116