/** * Takes a username whos log the record should go in, the activity, the actor, and the notes * and creates a new Activity_Log object and saves it to the db. */ public static function log_activity($userid, $activity, $actor, $notes = NULL) { if (UserStatus::isMasquerading()) { $notes .= " Admin: " . UserStatus::getUsername(FALSE); // get the *real* username } $activity_log = new HMS_Activity_Log(NULL, $userid, time(), $activity, $actor, $notes); $activity_log->save(); }