File/nasmail/functions/global.php

Description

global.php - Main initialization script

Script cleans PHP environment, loads session function wrappers and some generic functions. Includes load string functions and configuration. Script must be loaded before other code is executed. It is loaded by include/validate.php automatically.

  • version: $Id: global.php 1410 2008-09-25 09:35:27Z tokul $
  • copyright: (c) 1999-2006 The SquirrelMail Project Team
  • copyright: (c) 2006-2008 The NaSMail Project
  • license: GNU Public License
Includes
 require_once (SM_PATH.'config/config_default.php') (line 95)
 require_once (SM_PATH.'functions/strings.php') (line 88)

Bring in the config file We need $session_name config.php $version depends on strings.php.

strings.php sets $PHP_SELF.

 require_once (SM_PATH.'config/config.php') (line 93)

load default config if config does not exist

Constants
SQ_COOKIE = 4 (line 24)
SQ_FORM = 6 (line 26)
SQ_GET = 1 (line 21)
SQ_INORDER = 0 (line 20)

Set constants

SQ_POST = 2 (line 22)
SQ_SERVER = 5 (line 25)
SQ_SESSION = 3 (line 23)
Functions
check_nsm_version (line 262)

Returns true if the current internal NaSMail version is at minimum a.b.c

Called: check_nsm_version(1,0,0)

bool check_nsm_version ([int $a = 0], [int $b = 0], [int $c = 0])
  • int $a: a major version number
  • int $b: b minor version number
  • int $c: c release number
check_php_version (line 219)

returns true if current php version is at mimimum a.b.c

Called: check_php_version(4,1)

bool check_php_version ([int $a = '0'], [int $b = '0'], [int $c = '0'])
  • int $a: a major version number
  • int $b: b minor version number
  • int $c: c release number
check_sm_version (line 239)

returns true if the current internal SM version is at minimum a.b.c

Function always assumes that it is SquirrelMail 1.4.9 version. Function is provided for backwards compatibility with SquirrelMail plugins.

  • deprecated:
bool check_sm_version ([int $a = 0], [int $b = 0], [int $c = 0])
  • int $a: a major version number
  • int $b: b minor version number
  • int $c: c release number
sqgetGlobalVar (line 356)

Search for the var $name in $_SESSION, $_POST, $_GET, $_COOKIE, or $_SERVER and set it in provided var.

If $search is not provided, or == SQ_INORDER, it will search $_SESSION, then $_POST, then $_GET. Otherwise, use one of the defined constants to look for a var in one place specifically.

Note: $search is an int value equal to one of the constants defined above.

example: sqgetGlobalVar('username',$username,SQ_SESSION); -- no quotes around last param!

  • return: whether variable is found.
bool sqgetGlobalVar (string $name, mixed &$value, [int $search = SQ_INORDER])
  • string $name: name the name of the var to search
  • mixed &$value: value the variable to return
  • int $search: search constant defining where to look
sqsession_destroy (line 410)

Deletes an existing session, more advanced than the standard PHP session_destroy(), it explicitly deletes the cookies and global vars.

void sqsession_destroy ()
sqsession_is_active (line 443)

Function to verify a session has been started. If it hasn't

start a session up. php.net doesn't tell you that $_SESSION (even though autoglobal), is not created unless a session is started, unlike $_POST, $_GET and such

void sqsession_is_active ()
sqsession_is_registered (line 324)

Checks to see if a variable has already been registered in the session.

  • return: whether the var has been registered
bool sqsession_is_registered (string $name)
  • string $name: the name of the var to check
sqsession_register (line 301)

Add a variable to the session.

void sqsession_register (mixed $var, string $name)
  • mixed $var: the variable to register
  • string $name: the name to refer to this variable
sqsession_unregister (line 312)

Delete a variable from the session.

void sqsession_unregister (string $name)
  • string $name: the name of the var to delete
sqstripslashes (line 282)

Recursively strip slashes from the values of an array.

void sqstripslashes (array &$array)
  • array &$array: array the array to strip, passed by reference

Documentation generated on Sun, 22 Nov 2009 17:36:35 +0200 by phpDocumentor 1.4.3