Hi,
I want to realize a simple system to control the user activity (obviously, only for globeadmin).
I need to know which users are actually logged in and, if possible, which form (or objects) are working on.
Is there a system to have something like this?
I thougth to get info from zzsys-user_log table: I read, for each user, the last login and logout date/time and, by difference, I know if it is logged or not.
Is my thought right?
And how can I know which form is a user working on?
All suggestions are accepted!
Thank you
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Users activity
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
-
- Site Admin
- Posts: 2782
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 2 times
Re: Users activity
massiws,
You could record it by creating a table..
and putting the following in Before Browse and Before Open (changing the word in the sql statement from Browse to Form) of each Form you want to track..
Steven
You could record it by creating a table..
Code: Select all
CREATE TABLE current_users (current_users_id VARCHAR(15) NOT NULL,
cur_zzsys_user_id VARCHAR(15) NOT NULL,
cur_zzsys_form_id VARCHAR(15) NOT NULL,
cur_form_type VARCHAR(10) NOT NULL,
cur_time_stamp DATETIME NOT NULL,
PRIMARY KEY (current_users_id),
INDEX (cur_zzsys_user_id),
INDEX (cur_zzsys_form_id);
Code: Select all
//-- if you want to keep a history of where they have been, remove the next line.
nuRunQuery("DELETE FROM current_users WHERE cur_zzsys_user_id = '#zzsys_user_id#'");
$s = "INSERT INTO current_users (current_users_id, cur_zzsys_user_id, ";
$s .= "cur_zzsys_form_id, cur_form_type, cur_time_stamp) VALUES ('";
$s .= nuID() . "','#zzsys_user_id#','#formID#','Browse','";
$s .= date('Y-m-d H:i:s') . "')";
nuRunQuery($s);
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact: