Chapter 26. Configuration Variables

Table of Contents
Introduction
User information
Group information
Server information
Database information
Mail information
NNTP information
Application information

Introduction

phpGroupWare attempt to provide developers with as much information about the user, group, server, and application configuration as possible. To do this we provide a multi-dimensional array called $phpgw_info[], which includes all the information about your environment.Due to the multi-dimensional array approach. getting these values is easy.

Here are some examples:
<?php
  // To do a hello username
  echo "Hello " . $phpgw_info["user"]["fullname"];
  //If username first name is John and last name is Doe, prints: 'Hello John Doe'
  ?>
<?php
  // To find out the location of the imap server
  echo "IMAP Server is named: " . $phpgw_info["server"]["imap_server"];
  //If imap is running on localhost, prints: 'IMAP Server is named: localhost'
?>

User information

$phpgw_info["user"]["userid"] = The user ID
$phpgw_info["user"]["sessionid"] = The session ID
$phpgw_info["user"]["theme"] = Selected theme
$phpgw_info["user"]["private_dir"] = Users private dir. Use phpGroupWare core functions for access to the files.
$phpgw_info["user"]["firstname"] = Users first name
$phpgw_info["user"]["lastname"] = Users last name
$phpgw_info["user"]["fullname"] = Users Full Name
$phpgw_info["user"]["groups"] = Groups the user is a member of
$phpgw_info["user"]["app_perms"] = If the user has access to the current application
$phpgw_info["user"]["lastlogin"] = Last time the user logged in.
$phpgw_info["user"]["lastloginfrom"] = Where they logged in from the last time.
$phpgw_info["user"]["lastpasswd_change"] = Last time they changed their password.
$phpgw_info["user"]["passwd"] = Hashed password.
$phpgw_info["user"]["status"] = If the user is enabled.
$phpgw_info["user"]["logintime"] = Time they logged into their current session.
$phpgw_info["user"]["session_dla"] = Last time they did anything in their current session
$phpgw_info["user"]["session_ip"] = Current IP address

Group information

$phpgw_info["group"]["group_names"] = List of groups.

Server information

$phpgw_info["server"]["server_root"] = Main installation directory
$phpgw_info["server"]["include_root"] = Location of the 'inc' directory.
$phpgw_info["server"]["temp_dir"] = Directory that can be used for temporarily storing files
$phpgw_info["server"]["files_dir"] = Directory er and group files are stored
$phpgw_info["server"]["common_include_dir"] = Location of the core/shared include files.
$phpgw_info["server"]["template_dir"] = Active template files directory. This is defaulted by the server, and changeable by the user.
$phpgw_info["server"]["dir_separator"] = Allows compatibility with WindowsNT directory format,
$phpgw_info["server"]["encrpytkey"] = Key used for encryption functions
$phpgw_info["server"]["site_title"] = Site Title will show in the title bar of each webpage.
$phpgw_info["server"]["webserver_url"] = URL to phpGroupWare installation.
$phpgw_info["server"]["hostname"] = Name of the server phpGroupWare is installed upon.
$phpgw_info["server"]["charset"] = default charset, default:iso-8859-1
$phpgw_info["server"]["version"] = phpGroupWare version.

Database information

It is unlikely you will need these, because $phpgw_info_db will already be loaded as a database for you to use.

$phpgw_info["server"]["db_host"] = Address of the database server. Usually this is set to localhost.
$phpgw_info["server"]["db_name"] = Database name.
$phpgw_info["server"]["db_user"] = User name.
$phpgw_info["server"]["db_pass"] = Password
$phpgw_info["server"]["db_type"] = Type of database. Currently MySQL and PostgreSQL are supported.

Mail information

It is unlikely you will need these, because most email needs are services thru core phpGroupWare functions.

$phpgw_info["server"]["mail_server"] = Address of the IMAP server. Usually this is set to localhost.
$phpgw_info["server"]["mail_server_type"] = IMAP or POP3
$phpgw_info["server"]["imap_server_type"] = Cyrus or Uwash
$phpgw_info["server"]["imap_port"] = This is usually 143, and should only be changed if there is a good reason.
$phpgw_info["server"]["mail_suffix] = This is the domain name, used to add to email address
$phpgw_info["server"]["mail_login_type"] = This adds support for VMailMgr. Generally this should be set to 'standard'.
$phpgw_info["server"]["smtp_server"] = Address of the SMTP server. Usually this is set to localhost.
$phpgw_info["server"]["smtp_port"] = This is usually 25, and should only be changed if there is a good reason.

NNTP information

$phpgw_info["server"]["nntp_server"] = Address of the NNTP server.
$phpgw_info["server"]["nntp_port"] = This is usually XX, and should only be changed if there is a good reason.
$phpgw_info["server"]["nntp_sender"] = Unknown
$phpgw_info["server"]["nntp_organization"] = Unknown
$phpgw_info["server"]["nntp_admin"] = Unknown

Application information

Each application has the following information available.

$phpgw_info["apps"]["appname"]["title"] = The title of the application.
$phpgw_info["apps"]["appname"]["enabled"] = If the application is enabled. True or False.
$phpgw_info["server"]["app_include_dir"] = Location of the current application include files.
$phpgw_info["server"]["app_template_dir"] = Location of the current application tpl files.
$phpgw_info["server"]["app_lang_dir"] = Location of the current lang directory.
$phpgw_info["server"]["app_auth"] = If the server and current user have access to current application
$phpgw_info["server"]["app_current"] = name of the current application.