|
Support Incident Tracker GIT4.x
|
Go to the source code of this file.
Functions | |
| stripslashes_array ($data) | |
| cleanvar ($vars, $striphtml=TRUE, $transentities=FALSE, $mysqlescape=TRUE, $disallowedchars=array(), $replacechars=array(), $intval=FALSE) | |
| clean_int ($vars) | |
| clean_float ($vars) | |
| clean_dbstring ($string) | |
| clean_fixed_list ($string, $list, $strict=FALSE) | |
| available_languages ($test=FALSE) | |
Variables | |
| if(realpath(__FILE__)==realpath($_SERVER['SCRIPT_FILENAME'])) | $application_version = '3.90' |
| $application_revision = 'git' | |
| $siterrors = 0 | |
| $now = time() | |
| $today = $now + (16 * 3600) | |
| $lastweek = $now - (7 * 86400) | |
| $todayrecent = $now - (16 * 3600) | |
| $startofsession = $now - ini_get("session.gc_maxlifetime") | |
| $CONFIG ['upload_max_filesize'] = return_bytes($CONFIG['upload_max_filesize']) | |
| $iconset = $CONFIG['default_iconset'] | |
| $application_version_string = trim("v{$application_version} {$application_revision}") | |
| $ldap_conn = "" | |
| $_SERVER ['PHP_SELF'] | |
| $oldeh = set_error_handler("sit_error_handler") | |
| available_languages | ( | $ | test = FALSE | ) |
Return an array of available languages codes by looking at the files in the i18n directory
| bool | $test | - (optional) Include test language (zz) in results |
| array | Language codes |
Definition at line 288 of file base.inc.php.
References elseif, and i18n_code_to_name().
Referenced by cfgVarInput().
{
$i18nfiles = list_dir('.'.DIRECTORY_SEPARATOR.'i18n');
$i18nfiles = array_filter($i18nfiles, 'filter_i18n_filenames');
array_walk($i18nfiles, 'i18n_filename_to_code');
asort($i18nfiles);
foreach ($i18nfiles AS $code)
{
if ($code != 'zz')
{
$available[$code] = i18n_code_to_name($code);
}
elseif ($code == 'zz' AND $test === TRUE)
{
$available[$code] = 'Test Language (zz)';
}
}
return $available;
}
| clean_dbstring | ( | $ | string | ) |
Make an external variable safe for use in a database query
| mixed | $string | variable to make safe |
Definition at line 234 of file base.inc.php.
Referenced by Contact::add(), cmi_create_table(), process_new_contact(), and sla_target_content().
{
$string = strip_tags($string);
if (get_magic_quotes_gpc() == 1)
{
stripslashes($string);
}
$string = mysql_real_escape_string($string);
return $string;
}
| clean_fixed_list | ( | $ | string, |
| $ | list, | ||
| $ | strict = FALSE |
||
| ) |
Make an external variable safe by ensuring the value is one of a list of predetermined values
| mixed | $string | variable to make safe |
| array | $list | list of safe values |
| bool | $strict,also | check the types of the values in the list |
Definition at line 259 of file base.inc.php.
References E_USER_ERROR, and E_USER_WARNING.
{
if (is_array($list))
{
if (!in_array($string, $list, $strict))
{
if ($string != NULL AND $string != '')
{
trigger_error("Unexpected input", E_USER_WARNING);
}
$string = $list[0];
}
}
else
{
trigger_error("Could not understand list of predetermined values for fixed_list()", E_USER_ERROR);
return false;
}
return $string;
}
| clean_float | ( | $ | vars | ) |
Make an external variable safe. Force it to be a float.
| mixed | $string | variable to make safe |
Definition at line 205 of file base.inc.php.
References E_USER_WARNING, and elseif.
{
if (is_array($vars))
{
foreach ($vars as $key => $singlevar)
{
$var[$key] = clean_float($singlevar);
}
}
elseif (!is_null($vars) AND $vars != '' AND !is_numeric($vars))
{
trigger_error("Input was expected to be numeric but received string instead", E_USER_WARNING);
}
else
{
$var = floatval($vars);
}
return $var;
}
| clean_int | ( | $ | vars | ) |
Make an external variable safe. Force it to be an integer.
| mixed | $string | variable to make safe |
Definition at line 177 of file base.inc.php.
References E_USER_WARNING, and elseif.
Referenced by Contact::add(), dashboard_watch_incidents_edit(), process_new_contact(), sla_target_content(), and transactions_report().
{
if (is_array($vars))
{
foreach ($vars as $key => $singlevar)
{
$var[$key] = clean_int($singlevar);
}
}
elseif (!is_null($vars) AND $vars != '' AND !is_numeric($vars))
{
trigger_error("Input was expected to be numeric but received string instead", E_USER_WARNING);
}
else
{
$var = intval($vars);
}
return $var;
}
| cleanvar | ( | $ | vars, |
| $ | striphtml = TRUE, |
||
| $ | transentities = FALSE, |
||
| $ | mysqlescape = TRUE, |
||
| $ | disallowedchars = array(), |
||
| $ | replacechars = array(), |
||
| $ | intval = FALSE |
||
| ) |
Make an external variable safe for database and HTML display
| mixed | $var | variable to replace |
| bool | $striphtml | whether to strip html |
| bool | $transentities | whether to translate all aplicable chars (true) or just special chars (false) into html entites |
| bool | $mysqlescape | whether to mysql_escape() |
| array | $disallowedchars | array of chars to remove |
| array | $replacechars | array of chars to replace as $orig => $replace |
| bool | $intval | whether to get the integer value of the variable |
Definition at line 113 of file base.inc.php.
Referenced by Trigger::__construct(), User::add(), dashboard_rss_edit(), display_update_page(), draw_file_row(), is_kb_article(), new_update(), process_new_contact(), Form::run(), show_new_contact(), template_description(), TriggerEvent::TriggerEvent(), triggers_to_html(), and valid_username().
{
if (is_array($vars))
{
foreach ($vars as $key => $singlevar)
{
$var[$key] = cleanvar($singlevar, $striphtml, $transentities, $mysqlescape,
$disallowedchars, $replacechars);
}
}
else
{
$var = $vars;
if ($striphtml === TRUE)
{
$var = strip_tags($var);
}
if (!empty($disallowedchars))
{
$var = str_replace($disallowedchars, '', $var);
}
if (!empty($replacechars))
{
foreach ($replacechars as $orig => $replace)
{
$var = str_replace($orig, $replace, $var);
}
}
if ($transentities)
{
$var = htmlentities($var, ENT_COMPAT, $GLOBALS['i18ncharset']);
}
else
{
$var = htmlspecialchars($var, ENT_COMPAT, $GLOBALS['i18ncharset']);
}
if ($mysqlescape)
{
$var = mysql_real_escape_string($var);
}
if ($intval)
{
$var = intval($val);
}
$var = trim($var);
}
return $var;
}
| stripslashes_array | ( | $ | data | ) |
Strip slashes from an array
| $data | an array |
Definition at line 83 of file base.inc.php.
References $data.
| $_SERVER['PHP_SELF'] |
mb_substr($_SERVER['PHP_SELF'], 0, (mb_strlen($_SERVER['PHP_SELF']) - @mb_strlen($_SERVER['PATH_INFO'])))
End global variable definitions
Definition at line 53 of file base.inc.php.
Referenced by Form::__construct(), application_url(), nusoap_server::configureWSDL(), debug_log(), display_update_page(), gravatar(), nusoap_server::nusoap_server(), nusoap_server::parse_http_headers(), nusoap_server::register(), nusoap_server::service(), setup_configure(), show_tag_cloud(), and wsdl::webDescription().
| $application_revision = 'git' |
Definition at line 26 of file base.inc.php.
| if (realpath(__FILE__)==realpath($_SERVER['SCRIPT_FILENAME'])) $application_version = '3.90' |
Begin global variable definitions
Definition at line 23 of file base.inc.php.
Referenced by setup_exec_sql(), trigger_replace_specials(), and upgrade_schema().
| $application_version_string = trim("v{$application_version} {$application_revision}") |
Definition at line 44 of file base.inc.php.
Referenced by application_version_string(), Feed::generate_feed_xml(), send_email(), send_email_template(), and trigger_replace_specials().
| $CONFIG['upload_max_filesize'] = return_bytes($CONFIG['upload_max_filesize']) |
Definition at line 39 of file base.inc.php.
| $iconset = $CONFIG['default_iconset'] |
Definition at line 41 of file base.inc.php.
Referenced by contract_details(), dashboard_clock(), dashboard_holidays(), dashboard_incoming(), dashboard_incoming_display(), dashboard_random_tip(), dashboard_rss(), dashboard_rss_display(), dashboard_statistics_display(), dashboard_tags(), dashboard_tasks(), dashboard_user_incidents_display(), dashboard_watch_incidents(), date_picker(), display_drafts(), display_update_page(), DatePicker::generateHTML(), getattachmenticon(), gravatar(), icon(), kb_article(), list_tag_icons(), list_tags(), new_note_form(), priority_drop_down(), show_notes(), show_tag_cloud(), user_online(), and user_online_icon().
| $lastweek = $now - (7 * 86400) |
Definition at line 35 of file base.inc.php.
| $ldap_conn = "" |
Definition at line 46 of file base.inc.php.
Referenced by authenticateLDAP(), ldap_getDetails(), ldap_storeDetails(), ldapCheckObjectExists(), ldapGroupBrowse(), ldapNamingContexts(), ldapOpen(), and saction_ldapSync().
| $now = time() |
Definition at line 32 of file base.inc.php.
| $oldeh = set_error_handler("sit_error_handler") |
Definition at line 59 of file base.inc.php.
| $siterrors = 0 |
Definition at line 29 of file base.inc.php.
Referenced by html_redirect(), and sit_error_handler().
| $startofsession = $now - ini_get("session.gc_maxlifetime") |
Definition at line 37 of file base.inc.php.
Referenced by draw_chart(), suggest_reassign_userid(), user_online(), and user_online_icon().
| $today = $now + (16 * 3600) |
Definition at line 34 of file base.inc.php.
| $todayrecent = $now - (16 * 3600) |
Definition at line 36 of file base.inc.php.
Referenced by dashboard_statistics_display(), and give_overview().