/includes/common_functions.inc.php

Description
Functions
check (line 57)
void check ( $tbl_val,  $form_val, [ $return = false])
  • $tbl_val
  • $form_val
  • $return
checkNull (line 112)

function checkNull()

handles null value from checkboxes for insertion into DB

  • return: potentially modifed string value
string checkNull (string $strKey)
  • string $strKey: input from form.
decode_request_vars (line 305)
void decode_request_vars ()
do_login_div (line 160)
void do_login_div ()
dump_request (line 151)

function dump_request()

debugging function to print $_REQUEST variables in a readable format in the browser

void dump_request ()
grab_array_var (line 293)

grabs and preprocess array variable

  • return: returns either the value found or the default value
  • author: Ethan Galstad
mixed grab_array_var ( $arr, string $varname, [mixed $default = ""])
  • string $varname: the array index to grab
  • mixed $default: set an optional default value for the request var
  • $arr
grab_request_var (line 261)

grabs and preprocess a single GET and POST request variable

  • return: returns either the value found or the default value
  • author: Ethan Galstad
mixed grab_request_var (string $varname, [mixed $default = ""])
  • string $varname: the GET or POST variable to grab
  • mixed $default: set an optional default value for the request var
grab_request_vars (line 192)

grabs and preprocesses all GET and POST request variables

  • author: Ethan Galstad
void grab_request_vars ([ $preprocess = true], [ $type = ""])
  • $preprocess
  • $type
is_active (line 124)

function is_active

simple wrapper function for main ccm_table function, turns a bool into a string for table display

  • return: 'Yes' | 'No'
string is_active (int $int)
  • int $int: (0 | 1) active or inactive?
is_selected (line 93)

function: is_selected()

checks to see if a select list item should be preselected, prints selected='selected' upon true

null is_selected (string $tbl_val, string/int $form_val)
  • string $tbl_val: the DB table's field name
  • string/int $form_val: the value of the select option
preprocess_request_vars (line 324)

does nothing at this time

void preprocess_request_vars ()
sql_output (line 135)

function sql_output ()

debugging function to dump sql results into a human readable formar into the browser

void sql_output ([ $query = ''])
  • $query
val (line 175)

wrapper function that only prints a value if it exists

  • return: | string $output
null val (mixed $value, [bool $print = true])
  • mixed $value: the form value to check for
  • bool $print: defaults to printing output, else returns it
verify_token (line 11)

function verify_token()

security measure to protect against form spoofing for commands that modify configs

  • return: modifies referenced $cmd variable if token is bad
null verify_token ( &$cmd, string $token, string $cmd)
  • string $cmd: REFERENCE variable to string command
  • string $token: token submitted from the ccm form
  • &$cmd
verify_type (line 36)

function verify_type()

security measure to protect against form spoofing for commands that modify configs

  • return: modifies referenced $cmd variable if type is bad
null verify_type ( &$cmd, string $type, string $cmd)
  • string $cmd: REFERENCE variable to string command
  • string $type: nagios object type (host,service,contact, etc)
  • &$cmd

Documentation generated on Thu, 04 Aug 2011 14:15:14 -0500 by phpDocumentor 1.4.3