User who delete share or file


#1

Hello, I shall wish to watch the movements of deletion in tables oc_filecache and oc_share. How to know the users who make the deletion ?

I create two trigger and in the column who , i use the function user(), but it returns the database's user and not the user who do the deletion.


#2

Is this not all visible in the activity app? Or what exactly are you looking for?


#3

i have have not activate activity app and no logs on mysql transaction . For example , i have create a trigger to log activity

DELIMITER $$
CREATE TRIGGER trig_apres_delete_share
AFTER DELETE ON oc_share FOR EACH ROW
BEGIN
INSERT INTO histo_share
(action, date_action, uid_owner, file_target,who)
VALUES
('delete', NOW(),OLD.uid_owner, OLD.file_target , user() );
END$$
DELIMITER ;


#4

Hello, i waiting an anwser . Any one to help me ?


#5

The activiy app does this for you. If you like to reduce the function of it, I would start with that source code and focus on your usecase. Not sure what else to answer ...


#6

Thanks. It's over for me for this topic.