File/plugins/ldapquery/functions.php

Description

Functions used by ldapquery plugin.

  • version: $Id: functions.php 981 2007-11-03 11:44:01Z tokul $
  • copyright: 2005-2006 The SquirrelMail Project Team
  • copyright: 2007 The NaSMail Project
  • license: GNU Public License
Includes
 include_once (SM_PATH.'functions/display_messages.php') (line 26)
 include_once (SM_PATH.'functions/forms.php') (line 24)
 include_once (SM_PATH.'config/ldapquery_config.php') (line 44)

Including site config

 include_once (SM_PATH.'plugins/ldapquery/config.php') (line 46)
Functions
ldapquery_abook_form (line 485)

Creates address book form.

All data is in hidden fields. Only button is visible.

  • return: html formated address book form.
string ldapquery_abook_form (array $entry, [boolean $smallsize = true])
  • array $entry: single record from ldap search results.
  • boolean $smallsize: use short string in button name
ldapquery_compattrs (line 180)

compare attributes for sorting results

mixed ldapquery_compattrs (mixed $left, mixed $right)
  • mixed $left
  • mixed $right
ldapquery_compcns (line 210)

compare cn attributes for sorting results by lastname This is a bit of a hack for those of us who don't have surname attributes in our LDAP records (so we can't just select it in "sort by".

mixed ldapquery_compcns (mixed $left, mixed $right)
  • mixed $left
  • mixed $right
ldapquery_dispresultsMulti (line 228)

ldapquery_dispresultsMulti - display HTML results from an LDAP query

takes the list of attributes that were searched for and the returned results as parameters

mixed ldapquery_dispresultsMulti (mixed $attributes, mixed $entry, mixed $sortby, [string $charset = 'utf-8'])
  • mixed $attributes
  • mixed $entry
  • mixed $sortby
  • string $charset: charset used in entry data (since v.2.0)
ldapquery_dispresultsSingle (line 283)

display HTML results from an LDAP query

with each record being one row in a single table takes the list of attributes that were searched for and the returned results as parameters

void ldapquery_dispresultsSingle ( $attributes,  $entry,  $sortby, [ $charset = 'utf-8'])
  • $attributes
  • $entry
  • $sortby
  • $charset
ldapquery_format_results (line 357)

Formats and sanitizes ldap results.

Provides different handling for labeleduri and mail values.

  • return: html formated and sanitized string
string ldapquery_format_results (string $attr, string $attr_value, [string $charset = 'utf-8'])
  • string $attr: attribute name
  • string $attr_value: attribute value
  • string $charset: charset used by ldap server
ldapquery_ldapspecialchars (line 468)

Sanitizes ldap query strings.

See rfc2254

string ldapquery_ldapspecialchars (string $string)
  • string $string
ldapquery_lnf (line 190)

Convert a string with a name in it in firstname first

format to a lastname first formatted string

mixed ldapquery_lnf (mixed $fnf)
  • mixed $fnf
ldapquery_menuline_function (line 84)

Adds entry to menu line

(internal function)

void ldapquery_menuline_function ()
ldapquery_options_function (line 100)

Add options block

(internal function)

void ldapquery_options_function ()
ldapquery_prefs_function (line 160)

Load plugin preferences

(internal function)

void ldapquery_prefs_function ()
ldapquery_save_function (line 120)

Save options

(internal function)

void ldapquery_save_function ()
ldapquery_set_loadinfo_function (line 146)

Set optpage_name displayed when settings are saved

(internal function)

void ldapquery_set_loadinfo_function ()
ldapquery_ShowCheckboxes (line 418)

Create checkboxes

void ldapquery_ShowCheckboxes (array $attributes)
  • array $attributes
ldapquery_ShowOption (line 401)

Create html option tags

void ldapquery_ShowOption (string $Var, string $value, string $Desc)
  • string $Var
  • string $value
  • string $Desc
ldq_arraytolower (line 62)

lowercase elements of array

callback function

void ldq_arraytolower ( &$value,  &$key, string $value, string $key)
  • string $value: array value
  • string $key: array key
  • &$value
  • &$key
ldq_arraytrim (line 74)

trim values of array

callback function

  • since: 2.1
void ldq_arraytrim ( &$value, string $key, string $value)
  • string $value: array value
  • string $key: array key
  • &$value
ldq_check_setup (line 567)

Checks if NaSMail configuration and PHP setup are correct.

  • return: error message or empty string.
  • since: 2.1
string ldq_check_setup ()
ldq_error_box (line 620)

Wrapper arround standard error_box function.

Function is used to create error boxes that are centered and does not take whole page width.

  • since: 2.1
void ldq_error_box ( $sError)
  • $sError
ldq_hidden_search_fields (line 583)

Creates hidden form fields from POST data

  • since: 2.1
string ldq_hidden_search_fields ()
ldq_load_schemas (line 434)

Reads data about supported ldap schemas and loads it into object.

object ldq_load_schemas ()

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