CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

- File List
- File Members

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-2013 Edward Almasy and Internet Scout Research Group
8 # http://scout.wisc.edu/cwis/
9 #
10
11 class SPTEventLog extends EventLog {
12
13 # ---- PUBLIC INTERFACE --------------------------------------------------
14
15 # define event types
16 const SPTEVENT_USERLOGIN = 1;
17 const SPTEVENT_NEWACCOUNTSIGNUP = 2;
18 const SPTEVENT_NEWACCOUNTCONFIRM = 3;
19 const SPTEVENT_SEARCH = 4;
20 const SPTEVENT_ADVANCEDSEARCH = 5;
21 const SPTEVENT_RESOURCELINKCLICK = 6;
22 const SPTEVENT_OAIHARVEST = 7;
23
24 # define user types
25 const SPTUSERTYPE_ALL = 1;
26 const SPTUSERTYPE_ANONYMOUS = 2;
27 const SPTUSERTYPE_NONPRIVILEGED = 3;
28 const SPTUSERTYPE_PRIVILEGED = 4;
29
30 # object constructor
31 function SPTEventLog()
32 {
33 # create database for use by our parent
34 $DB = new Database();
35
36 # invoke parent constructor
37 global $G_User;
38 $UserId = $G_User->IsLoggedIn() ? $G_User->Id() : -1;
39 $this->EventLog($DB, $UserId);
40 }
41
42 # limit events to specific user type
43 function LimitFindToUserType($UserType)
44 {
45 # set search conditions based on user type
46 switch ($UserType)
47 {
48 case SPTUSERTYPE_NONPRIVILEGED:
49 $this->ExcludeUsersWithPrivileges("<", PRIV_POSTTOFORUMS);
50 $this->ExcludeUsersWithPrivileges(">", PRIV_USERDISABLED);
51 break;
52
53 case SPTUSERTYPE_PRIVILEGED:
54 break;
55 }
56 }
57
58
59 # ---- PRIVATE INTERFACE -------------------------------------------------
60
61 }
62
63
64 ?>
SPTEventLog\SPTEventLog
SPTEventLog()
Definition: SPTEventLog.php:31
SPTEventLog\SPTUSERTYPE_PRIVILEGED
const SPTUSERTYPE_PRIVILEGED
Definition: SPTEventLog.php:28
SPTEventLog\SPTEVENT_OAIHARVEST
const SPTEVENT_OAIHARVEST
Definition: SPTEventLog.php:22
EventLog
Class for storing and retrieving event information from database.
Definition: EventLog.php:22
Database
SQL database abstraction object with smart query caching.
Definition: Axis--Database.php:22
SPTEventLog\SPTEVENT_USERLOGIN
const SPTEVENT_USERLOGIN
Definition: SPTEventLog.php:16
SPTEventLog\SPTEVENT_ADVANCEDSEARCH
const SPTEVENT_ADVANCEDSEARCH
Definition: SPTEventLog.php:20
SPTEventLog
Definition: SPTEventLog.php:11
PHP
PHP
Definition: OAIClient.php:39
SPTEventLog\SPTEVENT_NEWACCOUNTCONFIRM
const SPTEVENT_NEWACCOUNTCONFIRM
Definition: SPTEventLog.php:18
SPTEventLog\SPTUSERTYPE_NONPRIVILEGED
const SPTUSERTYPE_NONPRIVILEGED
Definition: SPTEventLog.php:27
SPTEventLog\SPTEVENT_NEWACCOUNTSIGNUP
const SPTEVENT_NEWACCOUNTSIGNUP
Definition: SPTEventLog.php:17
SPTEventLog\LimitFindToUserType
LimitFindToUserType($UserType)
Definition: SPTEventLog.php:43
SPTEventLog\SPTEVENT_SEARCH
const SPTEVENT_SEARCH
Definition: SPTEventLog.php:19
SPTEventLog\SPTEVENT_RESOURCELINKCLICK
const SPTEVENT_RESOURCELINKCLICK
Definition: SPTEventLog.php:21
SPTEventLog\SPTUSERTYPE_ALL
const SPTUSERTYPE_ALL
Definition: SPTEventLog.php:25
SPTEventLog\SPTUSERTYPE_ANONYMOUS
const SPTUSERTYPE_ANONYMOUS
Definition: SPTEventLog.php:26
EventLog\EventLog
EventLog($DB, $UserId=-1, $LoggingEnabled=TRUE)
Object constructor.
Definition: EventLog.php:33