It's better when it's simple

User Tools

Site Tools


« MySQL Authentification Backend


Flyspray 0.9.9

Flyspray 0.9.8

This is the setup used here at splitbrain to authenticate against the Flyspray Bugtrackingsystem.

$conf['passcrypt'] = 'md5';
$conf['authtype'] = 'mysql';
$conf['defaultgroup'] = 'reporters';
$conf['auth']['mysql']['debug'] = 0; //set to 1 during config
$conf['auth']['mysql']['server']   = 'localhost';
$conf['auth']['mysql']['user']     = 'flyspray';
$conf['auth']['mysql']['password'] = 'secret';
$conf['auth']['mysql']['database'] = 'flyspray';
$conf['auth']['mysql']['getUserID']   = "SELECT user_id AS id
                                           FROM flyspray_users
                                          WHERE user_name='%{user}'";
$conf['auth']['mysql']['getGroupID']  = "SELECT group_id AS id
                                           FROM flyspray_groups
                                          WHERE LOWER(group_name)='%{group}'";
$conf['auth']['mysql']['checkPass']   = "SELECT user_pass AS pass
                                           FROM flyspray_users
                                          WHERE user_name='%{user}'
                                            AND account_enabled=1";
$conf['auth']['mysql']['getGroups']   = "SELECT LOWER(g.group_name) as `group`
                                           FROM flyspray_groups AS g, flyspray_users AS u, flyspray_users_in_groups AS ug
                                          WHERE g.group_id = ug.group_id
                                            AND ug.user_id = u.user_id
                                            AND u.user_name='%{user}'";
$conf['auth']['mysql']['getUserInfo'] = "SELECT user_pass AS pass, real_name AS name, email_address AS mail
                                           FROM flyspray_users
                                          WHERE user_name='%{user}'";
$conf['auth']['mysql']['getUsers']    = "SELECT DISTINCT u.user_name AS user
                                           FROM flyspray_users AS u
                                           LEFT JOIN flyspray_users_in_groups AS ug ON u.user_id=ug.user_id
                                           LEFT JOIN flyspray_groups AS g ON ug.group_id=g.group_id";
$conf['auth']['mysql']['FilterLogin'] = "u.user_name LIKE '%{user}'";
$conf['auth']['mysql']['FilterName']  = "u.real_name LIKE '%{name}'";
$conf['auth']['mysql']['FilterEmail'] = "u.email_address LIKE '%{email}'";
$conf['auth']['mysql']['FilterGroup'] = "g.group_name LIKE '%{group}'";
$conf['auth']['mysql']['SortOrder']   = "ORDER BY u.user_name";
$conf['auth']['mysql']['addUser']     = "INSERT INTO flyspray_users
                                                 SET user_name = '%{user}',
                                                    user_pass = '%{pass}',
                                                    real_name = '%{name}',
                                                    email_address = '%{email}',
                                                    jabber_id = '',
                                                    notify_type = 1,
                                                    account_enabled = 1,
                                                    dateformat = '',
                                                    dateformat_extended = '',
                                                    magic_url = '',
                                                    last_search = '',
                                                    tasks_perpage = 25";
$conf['auth']['mysql']['updateUser']  = "UPDATE flyspray_users SET";
$conf['auth']['mysql']['UpdateLogin'] = "user_name='%{user}'";
$conf['auth']['mysql']['UpdatePass']  = "user_pass='%{pass}'";
$conf['auth']['mysql']['UpdateEmail'] = "email_address='%{email}'";
$conf['auth']['mysql']['UpdateName']  = "real_name='%{name}'";
$conf['auth']['mysql']['UpdateTarget']= "WHERE user_id=%{uid}";
$conf['auth']['mysql']['addGroup']    = "INSERT INTO flyspray_groups
                                            SET group_name = '%{group}',
                                                group_desc = '%{group} group'";
#$conf['auth']['mysql']['delGroup']    = "DELETE FROM flyspray_groups
#                                          WHERE group_id='%{gid}'";

$conf['auth']['mysql']['addUserGroup']= "INSERT INTO flyspray_users_in_groups
                                                (user_id,group_id) VALUES ('%{uid}', '%{gid}')";
$conf['auth']['mysql']['delUserGroup']= "DELETE FROM flyspray_users_in_groups
                                          WHERE user_id='%{uid}'
                                            AND group_id='%{gid}'";
#$conf['auth']['mysql']['delUserRefs'] = "DELETE FROM flyspray_users_in_groups
#                                          WHERE group_id='%{gid}';";

$conf['auth']['mysql']['TablesToLock']= array("flyspray_users",
                                              "flyspray_users AS u",
                                              "flyspray_groups AS g",
                                              "flyspray_users_in_groups AS ug");

Note all delete commands are commented because I don't use them, so these are untested but should work.

auth/mysql_flyspray.txt · Last modified: 2011-03-22 17:27 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki