Class Common

Description

Define this common parent class to ensure consistent logging and access to configuration settings.

This class can be extended with 'common' code to simplify derived classes and ensure consistency.

Located in /lib/Common.php (line 23)


	
			
Direct descendents
Class Description
 class Switch_SNMP This class is intended to perform SNMP queries to all kind of switches.
 class Policy Base Policy class This is the basic policy implementation The real policy implementation can override what happens by simply providing an implementation of the pre and post connect methods.
 class Location EndDevice.php
 class CallWrapper This class creates proxy-objects, that wrap other objects, and log:
  • The methods that were called
  • The parameters of the calls
  • The return values.
Abstract class Result Define the Result template class. This class doesn't define anything,
 class Port The Port class describes the interfaces to information on Ports and Switches This class extends the Common class.
 class EndDevice This class represents a row in the systems table in the database.
Abstract class Request Define the Request request class. This class doesn't implement anything,
 class WebCommon WebCommon.php
Variable Summary
 mixed $conf
 mixed $db_conn
 mixed $logger
Method Summary
 Common __construct ()
 void getConnection ()
 void htmlescape ( $in_string)
 void log2db ([mixed $level = 'info'], [mixed $msg = ''])
 void real_escape_string1 ( $in_string,  $in_conn, [ $in_removePct = FALSE])
 void sqlescape ( $in_string, [ $in_removePct = FALSE])
Variables
mixed $conf (line 24)
  • access: public
mixed $db_conn (line 24)
  • access: public
mixed $logger (line 24)
  • access: public
Methods
Constructor __construct (line 29)

Get the current instance of our Settings and Logger classes

  • access: public
Common __construct ()

Redefined in descendants as:
getConnection (line 38)

Connect to database via mysqli

  • access: public
void getConnection ()
htmlescape (line 60)

htmlescape: escape date before outputting to a Browser

  • access: public
void htmlescape ( $in_string)
  • $in_string
log2db (line 106)

Write key events to naclog which is visible from the GUI

To view recent entries: select * from naclog ORDER BY datetime DESC LIMIT 5;

void log2db ([mixed $level = 'info'], [mixed $msg = ''])
  • mixed $level: Level of severity of the message
  • mixed $msg: Message to log
real_escape_string1 (line 81)

Escape possibly dangerous characters, to prevent SQL injection

Trim leading/trailing spaces too TBD: what about ';'?

  • access: public
void real_escape_string1 ( $in_string,  $in_conn, [ $in_removePct = FALSE])
  • $in_string
  • $in_conn
  • $in_removePct
sqlescape (line 69)

sqlescape: call real_escape_string1 with DB connection

  • access: public
void sqlescape ( $in_string, [ $in_removePct = FALSE])
  • $in_string
  • $in_removePct

Documentation generated on Mon, 06 Oct 2008 01:10:20 +0200 by phpDocumentor 1.4.0