[ PHPXref.com ] [ Generated: Sun Jul 20 19:05:01 2008 ] [ OneOrZero 1.6.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/common/ -> init_ooz.php (source)

   1  <?php
   2  
   3  
   4  /*

   5   * Date: Dec 22, 2004 

   6   * Filename: init_ooz.php 

   7   * Author: Adam Hall 

   8   * Description: This file sets all variables and conditions One Or

   9   * Zero requires

  10  /***************************************************************************

  11  *  This program is free software; you can redistribute it and/or

  12  *  modify it under the terms of the GNU General Public

  13  *  License as published by the Free Software Foundation; either

  14  *  version 2.1 of the License, or (at your option) any later version.

  15  *

  16  *  This program is distributed in the hope that it will be useful,

  17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of

  18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

  19  *  General Public License for more details.

  20  *

  21  *  You should have received a copy of the GNU General Public

  22  *  License along with This program; if not, write to:

  23  *    Free Software Foundation, Inc.

  24  *    59 Temple Place

  25  *    Suite 330

  26  *    Boston, MA  02111-1307  USA

  27  *

  28  * Copyright 2005 One or Zero

  29  * info@oneorzero.com

  30  * http://www.oneorzero.com

  31  * Developers: OneOrZero Team / Contributors: OneOrZero Community

  32  ****************************************************************************/
  33  
  34  // Set the level of error reporting

  35  error_reporting(E_ALL & ~E_NOTICE);
  36  // Check for minimum PHP version

  37   (phpversion() >= "4.1.0") or exit ('ERROR: You must have PHP Verson 4.1.0 or higher installed!');
  38  // creat database object and set class variables

  39  $db = new $database ();
  40  if ($database == "mysql")
  41  {
  42      $db->set($db_host, $db_user, $db_pwd, $db_name);
  43  }
  44  elseif ($database == "sqlite")
  45  {
  46      $db->set($sqlite_dbfile);
  47  }
  48  //Remove magic quotes handling if enabled on the server and add slashes for 

  49  //escape character handling using customAddSlashes, which escapes

  50  //characters based on database configured

  51  if (get_magic_quotes_gpc())
  52  {
  53      // Apply stripMagicQuotes() to all data

  54      $_GET = stripMagicQuotes($_GET);
  55      $_POST = stripMagicQuotes($_POST);
  56      $_COOKIE = stripMagicQuotes($_COOKIE);
  57      $_REQUEST = stripMagicQuotes($_REQUEST);
  58  }
  59  // Apply addslashesRecursive() to all data

  60  $_GET = addslashesRecursive($_GET);
  61  $_POST = addslashesRecursive($_POST);
  62  $_COOKIE = addslashesRecursive($_COOKIE);
  63  $_REQUEST = addslashesRecursive($_REQUEST);
  64  
  65  // Set the website variables from the website_settings.php file and determine path to settings file based

  66  // file location.

  67  if (stristr($_SERVER[PHP_SELF], 'logout') || stristr($_SERVER[PHP_SELF], "supporter") || stristr($_SERVER[PHP_SELF], 'admin') || stristr($_SERVER[PHP_SELF], 'utilities') || stristr($_SERVER[PHP_SELF], 'sla'))
  68  {
  69      //check for files existence

  70      if (file_exists($website_settings_path))
  71      {
  72          $ooz_website_settings = parse_ini_file($website_settings_path);
  73      }
  74      else
  75      {
  76          printError("The website_settings.php file was not found !");
  77          exit;
  78      }
  79  }
  80  else
  81  {
  82      if (file_exists($root_website_settings_path))
  83      {
  84          $ooz_website_settings = parse_ini_file($root_website_settings_path);
  85      }
  86      else
  87      {
  88          printError("The website_settings.php file was not found !");
  89          exit;
  90      }
  91  }
  92  $announcements_limit = $ooz_website_settings[announcements_per]; //number of announcements to display on the main page.

  93  $users_limit = $ooz_website_settings[users_per]; //number of users to list in a user/supporter list 

  94  $enable_ratings = $ooz_website_settings[ratings]; //use the ticket rating system?

  95  $helpdesk_name = $ooz_website_settings[helpdesk_name]; //name of the helpdesk

  96  $admin_email = $ooz_website_settings[admin_email]; //email address of the helpdesk administrator

  97  $enable_stats = $ooz_website_settings[stats]; //processed time statistics on or off

  98  $enable_ssl = $ooz_website_settings[socket]; //ssl on or off variable

  99  $enable_forum = $ooz_website_settings[forum]; //forum on or off variable

 100  $forum_site_url = $ooz_website_settings[forum_site]; //url for the forum if it exists

 101  $enable_smtp = $ooz_website_settings[smtp]; //smtp server on or off variable

 102  $sendmail_path = $ooz_website_settings[sendmail_path]; //path to sendmail on a *nix machine

 103  $enable_helpdesk = $ooz_website_settings[on_off]; //helpdesk on or off variable

 104  $on_off_reason = $ooz_website_settings[reason]; //reason for helpdesk being off

 105  $enable_pager = $ooz_website_settings[pager]; //enable pager gateway

 106  $pager_rank_low = $ooz_website_settings[pager_rank_low]; //lowest rank of priority that receives pages

 107  $enable_whosonline = $ooz_website_settings[whosonline]; //enable whos online display

 108  //$closed_ticket_count = $ooz_website_settings[ticket_count]; //number of tickets that have been closed since last 

 109  // ticket rating.

 110  $enable_time_tracking = $ooz_website_settings[time_tracking]; //enable time tracking per ticket/supporter

 111  $enable_kbase = $ooz_website_settings[kbase]; //enable knowledge base

 112  $default_theme = $ooz_website_settings[default_theme]; //the name of the default theme that is set by the admin

 113  $default_language = $ooz_website_settings[default_language]; //the default language

 114  $pubpriv = $ooz_website_settings[pubpriv]; //public/private setting

 115  $enable_tattachments = $ooz_website_settings[tattachments]; //enable ticket attachments

 116  $enable_kattachments = $ooz_website_settings[kattachments]; //enable knowledge base attachments

 117  $enable_uattachments = $ooz_website_settings[uattachments]; //enable user ticket attachments

 118  $kpurge = $ooz_website_settings[kpurge_level]; //purge policy for knowledge base attachments

 119  $enable_ulist = $ooz_website_settings[ulist]; //enable drop down user list when creating tickets 

 120  $enable_loggeddateoverride = $ooz_website_settings[loggeddateoverride]; //enable overriding of logged date

 121  $enable_task_feedback = $ooz_website_settings[enable_task_feedback]; //enable task feedback

 122  $user_account_registration = $ooz_website_settings[user_account_registration]; //set user account registration option 

 123  $immediate_activation_access = $ooz_website_settings[immediate_activation_access]; //set immediate user account activation access

 124  $last_update_enable = $ooz_website_settings[last_update_enable]; //enable last task update

 125  $last_update_limit = $ooz_website_settings[last_update_limit]; //limit the characters shown in last task update

 126  $password_retrieval = $ooz_website_settings[password_retrieval]; //enable password retrieval

 127  $profile_editing = $ooz_website_settings[profile_editing]; //enable user and viewer profile editing

 128  $show_all_log_to_client = $ooz_website_settings[show_all_log_to_client]; //if enable the entire update log is exposed to client

 129  $show_update_log_in_task = $ooz_website_settings[show_update_log_in_task]; //if enabled update log will appear in supporter task update

 130  $allow_supporterannouncementedit = $ooz_website_settings[allow_supporterannouncementedit]; //if enabled allows supporter to edit announcements

 131  $enable_sla_monitoring = $ooz_website_settings[sla_monitoring]; //if enabled allow SLA monitoring

 132  $username_fullname = $ooz_website_settings[username_fullname]; //show username of full name in dropdown list

 133  //This is the string that is inserted after the user name and again after the message in the update log.

 134  //This can't be the same as anything that a user would type.  Do not change.

 135  $delimiter = "--//--";
 136  
 137  //adjust prefix if the alias is nothing (eg a root server install)

 138  if ($oneorzero_web_alias == "")
 139  {
 140      $oneorzero_http_prefix = "http://".$server_name."/";
 141  }
 142  else
 143  {
 144      $oneorzero_http_prefix = "http://".$server_name."/".$oneorzero_web_alias."/";
 145  }
 146  
 147  if ($enable_ssl == 'On')
 148  {
 149      $oneorzero_http_prefix = eregi_replace("http", "https", $oneorzero_http_prefix);
 150  }
 151  $supporter_site_url = $oneorzero_http_prefix."supporter"; //url for supporters

 152  $admin_site_url = $oneorzero_http_prefix."admin"; //url for admins

 153  $site_url = eregi_replace("/supporter.*", "", $supporter_site_url);
 154  
 155  $time_format = "h:i A";
 156  $current_time = gmdate("$time_format");
 157  //Conditionally set this variable for legacy setups (eg updgraders)

 158  if ($ooz_website_settings[auth_method] == "")
 159  {
 160      $auth_method = "DB";
 161  }
 162  else
 163  {
 164      $auth_method = $ooz_website_settings[auth_method];
 165  }
 166  //$auth_method = $ooz_website_settings[auth_method];

 167  $ldap_host = $ooz_website_settings[ldap_host];
 168  $ldap_binddn = $ooz_website_settings[ldap_binddn];
 169  $ldap_bindpwd = $ooz_website_settings[ldap_bindpwd];
 170  $ldap_rootdn = $ooz_website_settings[ldap_rootdn];
 171  $ldap_searchattr = $ooz_website_settings[ldap_searchattr];
 172  
 173  $ldap_fname = $ooz_website_settings[ldap_fname];
 174  $ldap_lname = $ooz_website_settings[ldap_lname];
 175  $ldap_uname = $ooz_website_settings[ldap_uname];
 176  $ldap_email_add = $ooz_website_settings[ldap_email_add];
 177  $ldap_office = $ooz_website_settings[ldap_office];
 178  $ldap_phone = $ooz_website_settings[ldap_phone];
 179  $ldap_context = $ooz_website_settings[ldap_context];
 180  $ldap_domain = $ooz_website_settings[ldap_domain];
 181  $ldap_default_level = $ooz_website_settings[ldap_default_level];
 182  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]