CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- 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-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;
18 const SPTEVENT_NEWACCOUNTSIGNUP = 2;
19 const SPTEVENT_NEWACCOUNTCONFIRM = 3;
20 const SPTEVENT_SEARCH = 4;
21 const SPTEVENT_ADVANCEDSEARCH = 5;
22 const SPTEVENT_RESOURCELINKCLICK = 6;
23 const SPTEVENT_OAIHARVEST = 7;
24
25 # define user types
26 const SPTUSERTYPE_ALL = 1;
27 const SPTUSERTYPE_ANONYMOUS = 2;
28 const SPTUSERTYPE_NONPRIVILEGED = 3;
29 const SPTUSERTYPE_PRIVILEGED = 4;
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 {
54 case SPTUSERTYPE_NONPRIVILEGED:
55 $this->ExcludeUsersWithPrivileges("<", PRIV_POSTTOFORUMS);
56 $this->ExcludeUsersWithPrivileges(">", PRIV_USERDISABLED);
57 break;
58
59 case SPTUSERTYPE_PRIVILEGED:
60 break;
61 }
62 }
63
64
65 # ---- PRIVATE INTERFACE -------------------------------------------------
66 }
67
SPTEventLog\SPTUSERTYPE_PRIVILEGED
const SPTUSERTYPE_PRIVILEGED
Definition: SPTEventLog.php:29
SPTEventLog\SPTEVENT_OAIHARVEST
const SPTEVENT_OAIHARVEST
Definition: SPTEventLog.php:23
EventLog
Class for storing and retrieving event information from database.
Definition: EventLog.php:22
Database
SQL database abstraction object with smart query caching.
Definition: Database.php:22
SPTEventLog\SPTEVENT_USERLOGIN
const SPTEVENT_USERLOGIN
Definition: SPTEventLog.php:17
SPTEventLog\SPTEVENT_ADVANCEDSEARCH
const SPTEVENT_ADVANCEDSEARCH
Definition: SPTEventLog.php:21
SPTEventLog
Definition: SPTEventLog.php:11
SPTEventLog\__construct
__construct()
Object constructor.
Definition: SPTEventLog.php:34
PHP
PHP
Definition: RSSClient--Test.php:12
SPTEventLog\SPTEVENT_NEWACCOUNTCONFIRM
const SPTEVENT_NEWACCOUNTCONFIRM
Definition: SPTEventLog.php:19
SPTEventLog\SPTUSERTYPE_NONPRIVILEGED
const SPTUSERTYPE_NONPRIVILEGED
Definition: SPTEventLog.php:28
SPTEventLog\SPTEVENT_NEWACCOUNTSIGNUP
const SPTEVENT_NEWACCOUNTSIGNUP
Definition: SPTEventLog.php:18
SPTEventLog\LimitFindToUserType
LimitFindToUserType($UserType)
Limit events to specific user type.
Definition: SPTEventLog.php:49
SPTEventLog\SPTEVENT_SEARCH
const SPTEVENT_SEARCH
Definition: SPTEventLog.php:20
SPTEventLog\SPTEVENT_RESOURCELINKCLICK
const SPTEVENT_RESOURCELINKCLICK
Definition: SPTEventLog.php:22
SPTEventLog\SPTUSERTYPE_ALL
const SPTUSERTYPE_ALL
Definition: SPTEventLog.php:26
SPTEventLog\SPTUSERTYPE_ANONYMOUS
const SPTUSERTYPE_ANONYMOUS
Definition: SPTEventLog.php:27