Changeset 10727

Show
Ignore:
Timestamp:
12/24/10 07:40:21 (2 years ago)
Author:
mbrevda
Message:

re #4566 - more fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/bootstrap/amp_conf/bin/generate_hints.php

    r10678 r10727  
    22<?php 
    33//include bootstrap 
     4$restrict_mods = true; 
     5$skip_db = true; 
    46if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
    57  include_once('/etc/asterisk/freepbx.conf'); 
  • freepbx/branches/bootstrap/amp_conf/bin/retrieve_conf

    r10678 r10727  
    284284 
    285285 
    286 // **** Connect to database 
    287 /* 
    288 outn(_("Connecting to database..")); 
    289  
    290 # the engine to be used for the SQL queries, 
    291 # if none supplied, backfall to mysql 
    292 $db_engine = "mysql"; 
    293 if (isset($amp_conf["AMPDBENGINE"])){ 
    294   $db_engine = $amp_conf["AMPDBENGINE"]; 
    295 
    296  
    297 switch ($db_engine) 
    298 
    299   case "pgsql": 
    300   case "mysql": 
    301     // datasource in in this style: 
    302     //dbengine://username:password@host/database  
    303    
    304     $db_user = $amp_conf["AMPDBUSER"]; 
    305     $db_pass = $amp_conf["AMPDBPASS"]; 
    306     $db_host = $amp_conf["AMPDBHOST"]; 
    307     $db_name = $amp_conf["AMPDBNAME"]; 
    308    
    309     $datasource = $db_engine.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name; 
    310     $db = DB::connect($datasource); // attempt connection 
    311     break; 
    312    
    313   case "sqlite": 
    314     die_freepbx("SQLite2 support is deprecated. Please use sqlite3 only."); 
    315     break; 
    316    
    317   case "sqlite3": 
    318     if (!isset($amp_conf["AMPDBFILE"])) 
    319       fatal("You must setup properly AMPDBFILE in $amportalconf"); 
    320        
    321     if (isset($amp_conf["AMPDBFILE"]) == "") 
    322       fatal("AMPDBFILE in $amportalconf cannot be blank"); 
    323  
    324     // on centos this extension is not loaded by default  
    325     if (! extension_loaded('sqlite3.so')  && ! extension_loaded('SQLITE3')) 
    326       dl('sqlite3.so'); 
    327  
    328     if (! @require_once('DB/sqlite3.php') ) 
    329     { 
    330       die_freepbx("Your PHP installation has no PEAR/SQLite3 support. Please install php-sqlite3 and php-pear."); 
    331     } 
    332  
    333     require_once('DB/sqlite3.php'); 
    334     $datasource = "sqlite3:///" . $amp_conf["AMPDBFILE"] . "?mode=0666"; 
    335     $db = DB::connect($datasource); 
    336     break; 
    337  
    338   default: 
    339     fatal( "Unknown SQL engine: [$db_engine]"); 
    340 
    341  
    342 if(DB::isError($db)) { 
    343   out(_("FAILED")); 
    344   debug($db->userinfo); 
    345   fatal(_("database connection failure"),("failed trying to connect to the configured database")); 
    346    
    347 
    348 out(_("OK")); 
    349 */ 
     286 
    350287// Define the notification class for logging to the dashboard 
    351288// 
     
    369306} 
    370307 
    371 /* 
    372 //TODO : make this engine-neutral 
    373 outn(_("Connecting to Asterisk manager interface..")); 
    374 // connect to asterisk manager 
    375 require_once($amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php'); 
    376 $astman = new AGI_AsteriskManager(null, array('cachemode' => true)); 
    377 if (! $res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"],'off')) { 
    378   out(_("FAILED")); 
    379   fatal(_("Asterisk Manager Connection Failure"),sprintf(_("Failed to connect to the Asterisk manager through port: %s"), $amp_conf['ASTMANAGERPORT'])); 
    380 } 
    381 out(_("OK")); 
    382  
    383 //include common functions 
    384 require_once($amp_conf['AMPWEBROOT']."/admin/libraries/extensions.class.php"); 
    385 freepbx_log("retrieve_conf", "devel-debug", "Started retrieve_conf, DB Connection OK"); 
    386 */ 
    387308// query for our modules 
    388309// var_dump( $db ); 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/defines.php

    r10726 r10727  
    11<?php /* $Id$ */ 
     2$restrict_mods = true; 
     3$skip_db = true; 
     4$skip_astman = true; 
    25if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
    36  include_once('/etc/asterisk/freepbx.conf'); 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/config.php

    r10704 r10727  
    4040); 
    4141 
     42@header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 
     43@header('Expires: Sat, 01 Jan 2000 00:00:00 GMT'); 
     44@header('Cache-Control: post-check=0, pre-check=0',false); 
     45@header('Pragma: no-cache'); 
     46//session_cache_limiter('public, no-store'); 
    4247require('bootstrap.php'); 
    4348 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/functions.inc.php

    r10671 r10727  
    1515$dirname = dirname(__FILE__); 
    1616 
     17function __autoload($class) { 
     18  global $dirname; 
     19   
     20  //include gui elements classes 
     21  if  (substr($class,0,4) == 'gui_') { 
     22    require_once($dirname . '/libraries/components.class.php'); 
     23    return; 
     24  } 
     25   
     26  switch($class){ 
     27    case 'xml2Array': 
     28    case 'xml2ModuleArray': 
     29      require_once($dirname . '/libraries/xml2Array.class.php'); 
     30      break; 
     31    case 'cronmanager': 
     32      require_once($dirname . '/libraries/cronmanager.class.php'); 
     33      break; 
     34    case 'moduleHook': 
     35      require_once($dirname . '/libraries/moduleHook.class.php'); 
     36      break; 
     37    case 'notifications': 
     38      require_once($dirname . '/libraries/notifications.class.php'); 
     39      break; 
     40    case 'component': 
     41    case 'guielement': 
     42    case 'guiinput': 
     43    case 'guitext': 
     44      require_once($dirname . '/libraries/components.class.php'); 
     45      break; 
     46    case 'ampuser': 
     47      require_once($dirname . '/libraries/ampuser.class.php'); 
     48      break; 
     49    case 'modulelist': 
     50       
     51      break; 
     52    } 
     53} 
     54require_once($dirname . '/libraries/modulelist.class.php'); //doesnt play nicley in the __autolaoder, need to find out why -MB 
    1755require_once($dirname . '/libraries/config.functions.php'); 
    1856require_once($dirname . '/libraries/featurecodes.class.php'); 
    19 require_once($dirname . '/libraries/components.class.php'); 
    20 require_once($dirname . '/libraries/notifications.class.php'); 
    21 require_once($dirname . '/libraries/moduleHook.class.php'); 
    22 require_once($dirname . '/libraries/modulelist.class.php'); 
    23 require_once($dirname . '/libraries/cronmanager.class.php'); 
    24 require_once($dirname . '/libraries/ampuser.class.php'); 
    25 require_once($dirname . '/libraries/xml2Array.class.php'); 
    2657 
    2758//include other files 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/framework_view.functions.php

    r10717 r10727  
    229229            // file exists, and is allowed extension 
    230230 
    231             // image, css, js types - set Expires to an hour in advance so the client does 
     231            // image, css, js types - set Expires to a year in advance so the client does 
    232232            // not keep checking for them. Replace from header.php 
    233233            if (!$amp_conf['DEVEL']) { 
    234               @header('Expires: '.gmdate('D, d M Y H:i:s', time()+3600).' GMT', true); 
    235               @header('Cache-Control: ',true);  
     234              @header('Expires: '.gmdate('D, d M Y H:i:s', time() + 315360000).' GMT', true); 
     235              @header('Cache-Control: max-age=315360000, public, must-revalidate',true);  
    236236              @header('Pragma: ', true);  
    237237            }