CWIS Developer Documentation
SPTEventLog.php
Go to the documentation of this file.
1 <?PHP
2 
3 #
4 # FILE: SPT--SPTEventLog.php
5 #
6 # Part of the Collection Workflow Integration System (CWIS)
7 # Copyright 2007-2017 Edward Almasy and Internet Scout Research Group
8 # http://scout.wisc.edu/cwis/
9 #
10 
11 class SPTEventLog extends EventLog
12 {
13 
14  # ---- PUBLIC INTERFACE --------------------------------------------------
15 
16  # define event types
17  const SPTEVENT_USERLOGIN = 1;
20  const SPTEVENT_SEARCH = 4;
24 
25  # define user types
26  const SPTUSERTYPE_ALL = 1;
30 
34  public function __construct()
35  {
36  # create database for use by our parent
37  $DB = new Database();
38 
39  # invoke parent constructor
40  global $G_User;
41  $UserId = $G_User->IsLoggedIn() ? $G_User->Id() : -1;
42  parent::__construct($DB, $UserId);
43  }
44 
49  public function LimitFindToUserType($UserType)
50  {
51  # set search conditions based on user type
52  switch ($UserType)
53  {
55  $this->ExcludeUsersWithPrivileges("<", PRIV_POSTTOFORUMS);
56  $this->ExcludeUsersWithPrivileges(">", PRIV_USERDISABLED);
57  break;
58 
60  break;
61  }
62  }
63 
64 
65  # ---- PRIVATE INTERFACE -------------------------------------------------
66 }
67 
const SPTUSERTYPE_PRIVILEGED
Definition: SPTEventLog.php:29
const SPTEVENT_OAIHARVEST
Definition: SPTEventLog.php:23
Class for storing and retrieving event information from database.
Definition: EventLog.php:22
SQL database abstraction object with smart query caching.
Definition: Database.php:22
const SPTEVENT_USERLOGIN
Definition: SPTEventLog.php:17
const SPTEVENT_ADVANCEDSEARCH
Definition: SPTEventLog.php:21
__construct()
Object constructor.
Definition: SPTEventLog.php:34
const SPTEVENT_NEWACCOUNTCONFIRM
Definition: SPTEventLog.php:19
const SPTUSERTYPE_NONPRIVILEGED
Definition: SPTEventLog.php:28
const SPTEVENT_NEWACCOUNTSIGNUP
Definition: SPTEventLog.php:18
LimitFindToUserType($UserType)
Limit events to specific user type.
Definition: SPTEventLog.php:49
const SPTEVENT_SEARCH
Definition: SPTEventLog.php:20
const SPTEVENT_RESOURCELINKCLICK
Definition: SPTEventLog.php:22
const SPTUSERTYPE_ALL
Definition: SPTEventLog.php:26
const SPTUSERTYPE_ANONYMOUS
Definition: SPTEventLog.php:27