GUI Logging?

Discussion in 'General' started by jonwatson, Mar 10, 2008.

  1. jonwatson

    jonwatson New Member

    Hi Guys,

    I have a client who is looking for some level of GUI logging to see what customer admin accounts are doing within the GUI.

    I've noted the obvious logs in the system such as the /home/admispconfig/ispconfig.log and I'm aware of the normal system logs, but I think we're looking for something more like "user foo changed password for email account [email protected]".

    Is there anything hiding away that would provide some of this information? And if not, can anyone give me a high-level idea of what I should consider before attempting to implement such a thing?

    Thanks

    Jon
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If you want to implement a function to log all actions done in the forms in the ispconfig interface, I recommend that you implement it in the file /home/admispconfig/ispconfig/web/multidoc/edit/edit.php which handles all forms.
     
  3. jonwatson

    jonwatson New Member

    Thanks Til, I will take a look.

    Jon
     
  4. jonwatson

    jonwatson New Member

    Hi Til,

    I've started coding this and am making some progess. I have a couple of questions, however.

    1. I want to trap the user who performed an action. I see that there are two variables in the edit.php file that may be useful. There us a variable user and a variabler userid. I find that the user variable always appears to be empty and that the userid variable always appears to hold the value '0' regardless of who is logged in. Can you shed some light on where I can find the correct value for the user defined in the 'Login data' tab?

    2. I need some way to show 'where' an action occurred. The script name is largely useless to me since it is always edit.php, so I am attempting to use the tabid. I see, however, that the tabid variable seems to be '0' most of the time. There are exceptions (like I see that the spam management tab is tab id 2), but for the most part it seems to be 0. Is there an easier way to figure out what page someone is one when they save changes?

    Thanks!

    Jon
     
  5. jonwatson

    jonwatson New Member

    Anyone? Tips?

    Thanks
     
  6. jonwatson

    jonwatson New Member

    I have figured out that I can use the $go_info["user"]["userid"] variable to get the UID of the logged in user and from there I can query the db for the name of that user. However, I'm not sure how to do the same for the page. I see that there is a $item["doc_id"] variable I can use which seems to provide a unique number for each tab/page, but I can't see what to do with that number in order to turn it into something more readable in the log.

    Any tips?

    Thanks

    Jon
     
  7. jonwatson

    jonwatson New Member

    Hi

    I don't understand why I'm not getting any response to this thread. Am I being completely unclear about what I am looking for? I'm going to try again.

    I need to trap the name of the tab that a user makes a change to when logged into the GUI. For example, if I log in as an admin, select SIte, click on a domain, then the right pane changes to display all of the settings for that domain. There are tabs labelled 'Basis', 'User & Email', 'Co-domains', etc.

    If the user changes the Space on the Basis tab, for example, I need to trap the 'Basis' so we know what tab he made that change on.

    So, I guess what I need to know is where is the query that pulls the word 'Basis' from the database and writes it to that tab? If I knew that, I could probably trap it and write it to the log.

    Thanks

    Jon
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The internal name of the tab is stored in the variable $deck_id
     
  9. jonwatson

    jonwatson New Member

    Hi Till,

    Thanks - I'll give it a whirl.

    Jon
     
  10. jonwatson

    jonwatson New Member

    Hi Till,

    $deck_id apprears to be a numeric value. I am looking for the text that is written to the tab. Where is that stored?

    Thanks

    Jon
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The forms are objects, to get the title of a tab, use it like this:

    $title = $doc->deck[$deck_id]->title;

    and if you want to get the ttle in your own language:

    $title = $go_api->lng($doc->deck[$deck_id]->title);
     
  12. jonwatson

    jonwatson New Member

    Aha! Thanks. Exactly what I was looking for.

    Now, for my final trick, I need to trap the username of the user who is making the changes. I see that I can trap the user id using:

    $go_info["user"]["userid"]

    But I'd like to trap the actual name if possible. Is that stored anywhere that I can use?

    Thanks,

    Jon
     
  13. jonwatson

    jonwatson New Member

    Duh

    Apparently I can use $go_info["user"]["username"] for this.

    Thanks!

    Jon
     

Share This Page