Search:

# CWIS Developers Documentation

- Main Page
- Classes
- Files

- File List
- File Members

# SPTEventLog.php

Go to the documentation of this file.

    00001 <?PHP
    00002
    00003 #
    00004 #   FILE:  SPT--SPTEventLog.php
    00005 #
    00006 #   METHODS PROVIDED:
    00007 #       SPTEventLog()
    00008 #           - constructor
    00009 #       SomeMethod($SomeParameter, $AnotherParameter)
    00010 #           - short description of method
    00011 #
    00012 #   AUTHOR:  Edward Almasy
    00013 #
    00014 #   Part of the Scout Portal Toolkit
    00015 #   Copyright 2007 Internet Scout Project
    00016 #   http://scout.wisc.edu
    00017 #
    00018
    00019 class SPTEventLog extends EventLog {
    00020
    00021     # ---- PUBLIC INTERFACE --------------------------------------------------
    00022
    00023     # define event types
    00024     const SPTEVENT_USERLOGIN =  1;
    00025     const SPTEVENT_NEWACCOUNTSIGNUP =  2;
    00026     const SPTEVENT_NEWACCOUNTCONFIRM =  3;
    00027     const SPTEVENT_SEARCH =  4;
    00028     const SPTEVENT_ADVANCEDSEARCH =  5;
    00029     const SPTEVENT_RESOURCELINKCLICK =  6;
    00030     const SPTEVENT_OAIHARVEST =  7;
    00031
    00032     # define user types
    00033     const SPTUSERTYPE_ALL =  1;
    00034     const SPTUSERTYPE_ANONYMOUS =  2;
    00035     const SPTUSERTYPE_NONPRIVILEGED =  3;
    00036     const SPTUSERTYPE_PRIVILEGED =  4;
    00037
    00038     # object constructor
    00039     function SPTEventLog()
    00040     {
    00041         # create database for use by our parent
    00042         $DB = new SPTDatabase();
    00043
    00044         # invoke parent constructor
    00045         global $G_User;
    00046         $UserId = $G_User->IsLoggedIn() ? $G_User->Id() : -1;
    00047         $this->EventLog($DB, $UserId);
    00048     }
    00049
    00050     # limit events to specific user type
    00051     function LimitFindToUserType($UserType)
    00052     {
    00053         # set search conditions based on user type
    00054         switch ($UserType)
    00055         {
    00056             case SPTUSERTYPE_NONPRIVILEGED:
    00057                 $this->ExcludeUsersWithPrivileges("<", PRIV_POSTTOFORUMS);
    00058                 $this->ExcludeUsersWithPrivileges(">", PRIV_USERDISABLED);
    00059                 break;
    00060
    00061             case SPTUSERTYPE_PRIVILEGED:
    00062                 break;
    00063         }
    00064     }
    00065
    00066
    00067     # ---- PRIVATE INTERFACE -------------------------------------------------
    00068
    00069 }
    00070
    00071
    00072 ?>

Copyright 2010 Internet Scout