File/plugins/vadmin/includes/vadmin_functions.inc

Description

vadmin_functions.inc --------------------- All Vadmin-wide functions are in this file.

Licensed under GNU GPL v2. Please see COPYING for full terms.

$Id: vadmin_functions.inc,v 1.54 2003/07/09 22:05:37 graf25 Exp $

  • author: Konstantin Riabitsev ($Author: graf25 $)
  • version: $Date: 2003/07/09 22:05:37 $
Functions
spew (line 22)

This is a debugging function.

void spew ($message $message)
  • $message $message: The message to put into the debug log.
vadmin_auth (line 216)

This function is the authentication core of vadmin. Read the docs/SECURITY for the in-depth explanation on how the security is handled in vadmin.

  • return: which is a string with the authentication information.
$VADMIN_AUTHCODE, vadmin_auth ()
vadmin_crypto (line 446)

This function does the encryption and decryption of sensitive data stored on the HDD. It uses the CRYPTO_HASH_LINE as key.

See docs for more info and/or explanation of the security structure of VADMIN.

  • return: results of encryption/decryption.
the vadmin_crypto ($input $input, $mode $mode)
  • $input $input: the contents to encrypt/decrypt.
  • $mode $mode: a string that can be either "decrypt" or "encrypt" depending on which action needs to be performed.
vadmin_domain_passwd_validate (line 280)

Tries to validate the supplied domain/password pair by connecting to the vmailmgr daemon and getting a listing for the domain in question.

  • return: if successful, or false if not.
true vadmin_domain_passwd_validate ($domain $domain, $passwd $passwd)
  • $domain $domain: vadmin domain.
  • $passwd $passwd: the password for this domain.
vadmin_getdomain (line 542)
void vadmin_getdomain ()
vadmin_gethost (line 554)
void vadmin_gethost ()
vadmin_getvar (line 45)

This function retrieves various php-provided variables in a sane and safe way, offering a path of migration from php 4.0.x to 4.1 and beyond, as well as allowing us to work with register_globals=off.

  • return: value of the variable.
The vadmin_getvar ($vartype $vartype, $varname $varname)
  • $vartype $vartype: The type of the variable to retireve.
  • $varname $varname: The name of the variable to retrieve.
vadmin_get_storparams (line 534)
void vadmin_get_storparams ()
vadmin_get_user_number (line 621)
void vadmin_get_user_number ( $domain)
  • $domain
vadmin_get_user_unamedomain (line 249)

Looks at the user's login name, which should be either user@domain.com or user:domain.com, and separates the userid from the domain name, returning them in an array.

  • return: array with the username and the domainname, or array with two empty fields if unsuccessful.
an vadmin_get_user_unamedomain ($unamedomain $unamedomain)
  • $unamedomain $unamedomain: A string in the format username{sep}domainname
vadmin_list_virtual_domains (line 579)
void vadmin_list_virtual_domains ()
vadmin_make_page (line 314)

This is a GUI wrap-around for every generated page, since I'm too lazy to write one for each generated page, nor should I. ;) $scriptsrc is not currently used in vadmin, but I preserved it from SquirrelSpell in case I will add this functionality later.

void. vadmin_make_page ($title $title, $scriptsrc $scriptsrc, $body $body, $returntomain $returntomain, $logoutlink $logoutlink)
  • $title $title: the title of the page.
  • $scriptsrc $scriptsrc: the name of a javascript file to load before loading the page itself.
  • $body $body: the contents of the page.
  • $returntomain $returntomain: show "return to main menu" link? true/false
  • $logoutlink $logoutlink: show logout link? true/false
vadmin_mkform_action (line 512)
void vadmin_mkform_action ( $tolvl,  $tomod,  $toact)
  • $tolvl
  • $tomod
  • $toact
vadmin_putvar (line 125)

This function sets certain variables that should be handled safely.

void vadmin_putvar ($vartype $vartype, $varname $varname, $varvalue $varvalue)
  • $vartype $vartype: The type of the variable to set.
  • $varname $varname: The name of the variable.
  • $varvalue $varvalue: The value of the variable.
vadmin_rc4_crypt (line 395)

This function stolen nearly verbatim from hastymail.

http://hastymail.sf.net/

void vadmin_rc4_crypt ( $input,  $key)
  • $input
  • $key
vadmin_redirect (line 522)
void vadmin_redirect ( $lvl,  $mod,  $act,  $stor_params)
  • $lvl
  • $mod
  • $act
  • $stor_params
vadmin_security_breach (line 155)

This utility function notifies the user that they have attempted an action that was deemed as violating security by the system.

It used to carry an "INTRUDER ALERT ON DECK 5", but I changed it to be more non-geek friendly. ;)

  • return: returns.
Never vadmin_security_breach ()
vadmin_smart_limit (line 609)
void vadmin_smart_limit ( $domain,  $level,  $def)
  • $domain
  • $level
  • $def
vadmin_system_error (line 169)

This function displays an error message if the error was due to system malfunction and not user input.

  • return: returns.
Never vadmin_system_error ($message $message)
  • $message $message: A text message to display to the user.
vadmin_trim_array (line 637)
void vadmin_trim_array ( &$member)
  • &$member
vadmin_user_error (line 192)

This function displays an error message if the error was due to the user input.

  • return: returns.
Never vadmin_user_error ($message $message)
  • $message $message: A text message to display to the user.

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