CWIS Developer Documentation
Home
Main Page
Namespaces
Classes
Files
File List
File Members
objects
SPTEventLog.php
Go to the documentation of this file.
1
<?
PHP
2
3
#
4
# FILE: SPT--SPTEventLog.php
5
#
6
# METHODS PROVIDED:
7
# SPTEventLog()
8
# - constructor
9
# SomeMethod($SomeParameter, $AnotherParameter)
10
# - short description of method
11
#
12
# AUTHOR: Edward Almasy
13
#
14
# Part of the Scout Portal Toolkit
15
# Copyright 2007 Internet Scout Project
16
# http://scout.wisc.edu
17
#
18
19
class
SPTEventLog
extends
EventLog
{
20
21
# ---- PUBLIC INTERFACE --------------------------------------------------
22
23
# define event types
24
const
SPTEVENT_USERLOGIN
= 1;
25
const
SPTEVENT_NEWACCOUNTSIGNUP
= 2;
26
const
SPTEVENT_NEWACCOUNTCONFIRM
= 3;
27
const
SPTEVENT_SEARCH
= 4;
28
const
SPTEVENT_ADVANCEDSEARCH
= 5;
29
const
SPTEVENT_RESOURCELINKCLICK
= 6;
30
const
SPTEVENT_OAIHARVEST
= 7;
31
32
# define user types
33
const
SPTUSERTYPE_ALL
= 1;
34
const
SPTUSERTYPE_ANONYMOUS
= 2;
35
const
SPTUSERTYPE_NONPRIVILEGED
= 3;
36
const
SPTUSERTYPE_PRIVILEGED
= 4;
37
38
# object constructor
39
function
SPTEventLog
()
40
{
41
# create database for use by our parent
42
$DB =
new
Database
();
43
44
# invoke parent constructor
45
global $G_User;
46
$UserId = $G_User->IsLoggedIn() ? $G_User->Id() : -1;
47
$this->
EventLog
($DB, $UserId);
48
}
49
50
# limit events to specific user type
51
function
LimitFindToUserType
($UserType)
52
{
53
# set search conditions based on user type
54
switch
($UserType)
55
{
56
case
SPTUSERTYPE_NONPRIVILEGED
:
57
$this->ExcludeUsersWithPrivileges(
"<"
, PRIV_POSTTOFORUMS);
58
$this->ExcludeUsersWithPrivileges(
">"
, PRIV_USERDISABLED);
59
break
;
60
61
case
SPTUSERTYPE_PRIVILEGED
:
62
break
;
63
}
64
}
65
66
67
# ---- PRIVATE INTERFACE -------------------------------------------------
68
69
}
70
71
72
?>
Copyright 2012 Internet Scout