View Issue Details

IDProjectCategoryView StatusLast Update
0009458mantisbtintegrationpublic2022-10-21 14:27
Reporterrstens Assigned Tograngeway  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
PlatformFirefox 2.0.0.14OSWindows XPOS VersionSP2
Product Version1.1.2 
Summary0009458: MySQL Triggers that let you use Mantis User Management to control TestLink Users
Description

I am running TestLink and Mantis on the same system (and database) for the same users and I wanted to have a quick (and dirty) integration of the user management facility. I came up with the following triggers for MySQL that will allow you to use the Mantis User management function to create users, delete users and change passwords. All other settings that TestLink needs (like roles and access levels) still need to be set by using the appropriate functionality in TestLink.

As long as you avoid doing the creation/deletion and update passwords thing in TestLink, your user database tables will be in sync and your users can use the same ID and PW for both systems.

--
-- Triggers mantis_user_table

DROP TRIGGER IF EXISTS bugtracker.tluserinsert;
DELIMITER //
CREATE TRIGGER bugtracker.tluserinsert AFTER INSERT ON bugtracker.mantis_user_table
FOR EACH ROW INSERT INTO
users(users.id,
users.login,
users.password,
users.email,
users.first,
users.last)
values (new.id,
new.username,
new.password,
new.email,
SUBSTRING_INDEX( new.realname , ' ', 1 ),SUBSTRING_INDEX( new.realname , ' ', -1 ))
//
DELIMITER ;
DROP TRIGGER IF EXISTS bugtracker.tluserupd;
DELIMITER //
CREATE TRIGGER bugtracker.tluserupd AFTER UPDATE ON bugtracker.mantis_user_table
FOR EACH ROW update users set users.password=new.password where users.id=old.id
//
DELIMITER ;
DROP TRIGGER IF EXISTS bugtracker.tluserdel;
DELIMITER //
CREATE TRIGGER bugtracker.tluserdel AFTER DELETE ON bugtracker.mantis_user_table
FOR EACH ROW delete from users where users.id=old.id
//
DELIMITER ;

TagsNo tags attached.

Activities

giallu

giallu

2008-07-31 05:45

reporter   ~0018951

What about moving this to:

http://www.mantisbt.org/wiki/doku.php/mantisbt:mantis_recipies

as it surely is not a bug with mantis...

rstens

rstens

2008-07-31 12:21

reporter   ~0018960

Last edited: 2008-07-31 12:22

Sure, that would have been my first choice, but how?
I do not seem to be able to add a new page or edit anything in the wiki.

grangeway

grangeway

2008-08-01 18:19

reporter   ~0018993

Giallu, can you investigate this?

Paul

atrol

atrol

2013-08-16 12:44

developer   ~0037888

Removed assignment. giallu will not contribute to this issue in near future.

grangeway

grangeway

2013-09-07 11:47

reporter   ~0038006

Hi,

Marking this issue as resolved, as whilst useful for historical purposes, doesn't lead to anything that needs fixing in mantis.

Paul