Changeset 10678

Show
Ignore:
Timestamp:
12/09/10 17:02:07 (2 years ago)
Author:
mbrevda
Message:

re #4566 - more migration and new bootstrap format

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/bootstrap/amp_conf/astetc/cdr_mysql.conf

    r10654 r10678  
    1414hostname = localhost 
    1515dbname=asteriskcdrdb  
    16 password = AMPDBPASS 
    17 user = AMPDBUSER 
     16password = passw0rd 
     17user = root 
    1818userfield=1 
    1919;port=3306  
  • freepbx/branches/bootstrap/amp_conf/astetc/manager.conf

    r10653 r10678  
    1616displayconnects=no ;only effects 1.6+ 
    1717 
    18 [AMPMGRUSER
    19 secret = AMPMGRPASS 
     18[admin
     19secret = amp111 
    2020deny=0.0.0.0/0.0.0.0 
    2121permit=127.0.0.1/255.255.255.0 
  • freepbx/branches/bootstrap/amp_conf/bin/archive_recordings

    r10617 r10678  
    11#!/usr/bin/php -q 
    22<?php 
    3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
     3//include bootstrap 
     4if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     5  include_once('/etc/asterisk/freepbx.conf'); 
     6
    47 
    58define("MONITOR_DIR", "/var/spool/asterisk/monitor"); 
  • freepbx/branches/bootstrap/amp_conf/bin/freepbx-cron-scheduler.php

    r10617 r10678  
    11#!/usr/bin/php -q 
    22<?php 
    3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
    4  
     3//include bootstrap 
     4if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     5  include_once('/etc/asterisk/freepbx.conf'); 
     6
    57// Define the notification class for logging to the dashboard 
    68// 
  • freepbx/branches/bootstrap/amp_conf/bin/freepbx_engine

    r10646 r10678  
    1313# define freepbx config file if not alreaddy set 
    1414if [ ! -n "$FREEPBX_CONF" ]; then 
    15   FREEPBX_CONF="/etc/freepbx.php
     15  FREEPBX_CONF="/etc/freepbx.conf
    1616fi 
    1717 
     
    3737FPBXDBUGFILE=/tmp/freepbx_debug.log 
    3838 
    39 write_freepbxphp() { 
    40   if [ ! -e /etc/freepbx.php  ]; then 
    41     cat > /etc/freepbx.php <<-EOF 
     39write_freepbxconf() { 
     40  if [ ! -e $FREEPBX_CONF  ]; then 
     41    cat > $FREEPBX_CONF <<-EOF 
    4242    <?php 
    4343    \$amp_conf['AMPDBUSER'] = '$AMPDBUSER'; 
     
    4545    \$amp_conf['AMPDBHOST'] = '$AMPDBHOST'; 
    4646    \$amp_conf['AMPDBNAME'] = '$AMPENGINE'; 
    47     \$amp_conf['AMPDBENGINE']  = '$AMPDBENGINE'; 
     47    \$amp_conf['AMPDBENGINE'] = '$AMPDBENGINE'; 
    4848    \$amp_conf['datasource']  = ''; //for sqlite3 
    4949 
    50     \$amp_conf['bootstrap'] = '${AMPWEBROOT}/admin/bootstrap.php'; 
    51  
    52     require_once(\$amp_conf['bootstrap']); 
    53    
    54     ?> 
     50    require_once('${AMPWEBROOT}/admin/bootstrap.php'); 
     51 
    5552    EOF 
    5653  fi 
    57    
     54  if [ -e /etc/asterisk/freepbx.conf ]; then 
     55    rm /etc/asterisk/freepbx.conf 
     56  fi 
    5857} 
    5958 
     
    6261    `php -r ' 
    6362  $skip_astman = true;//no need for astman here 
    64   require_once("/etc/freepbx.php"); 
     63  require_once("/etc/freepbx.conf"); 
    6564  foreach($amp_conf as $key => $val) { 
    6665    echo "export " . trim($key) . "=" . escapeshellcmd(trim($val)) ."\n"; 
    6766  } 
    6867  '` 
    69 elif [ -e "/etc/amportal.conf" ]; then # Check if file exists, if it dose read it and then write out /etc/freepbx.php 
     68elif [ -e "/etc/amportal.conf" ]; then # Check if file exists, if it dose read it and then write out /etc/freepbx.conf 
    7069  . /etc/amportal.conf 
    71   write_freepbxphp 
     70  write_freepbxconf 
    7271else  
    7372  echo; 
     
    111110   
    112111  chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP /etc/amportal.conf 
    113   chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP /etc/freepbx.php 
     112  chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $FREEPBX_CONF 
    114113  chmod g+w /etc/amportal.conf 
    115   chmod g+w /etc/freepbx.php 
     114  chmod g+w $FREEPBX_CONF 
    116115  chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $ASTRUNDIR 
    117116  chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $ASTETCDIR 
     
    285284    stop_fop 
    286285    sleep 1 
    287     write_freepbxphp 
     286    write_freepbxconf 
    288287    chown_asterisk 
    289288    run_asterisk 
  • freepbx/branches/bootstrap/amp_conf/bin/generate_hints.php

    r10649 r10678  
    11#!/usr/bin/php -q 
    22<?php 
    3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
    4  
     3//include bootstrap 
     4if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     5  include_once('/etc/asterisk/freepbx.conf'); 
     6
    57$debug = -1; 
    68 
  • freepbx/branches/bootstrap/amp_conf/bin/module_admin

    r10617 r10678  
    1616 */ 
    1717 
    18 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
    19  
     18if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     19  include_once('/etc/asterisk/freepbx.conf'); 
     20
    2021function out($text) { 
    2122  echo $text."\n"; 
  • freepbx/branches/bootstrap/amp_conf/bin/retrieve_conf

    r10671 r10678  
    22<?php 
    33 
    4 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
     4//include bootstrapper 
     5if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     6  include_once('/etc/asterisk/freepbx.conf'); 
     7
    58 
    69class connectdirs { 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/bootstrap.php

    r10671 r10678  
    1212 
    1313//include database conifguration 
    14 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 
     14if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 
     15  include_once('/etc/asterisk/freepbx.conf'); 
     16
    1517 
    1618 
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/config.functions.php

    r10636 r10678  
    8686    $sql = 'SELECT `key`, value FROM freepbx_settings'; 
    8787    $conf = $db->getAssoc($sql); 
    88     $conf['amportal_canwrite'] = true; 
     88    if(DB::IsError($conf)) {      
     89      die_freepbx($conf->getMessage());  
     90    } else { 
     91      $conf['amportal_canwrite'] = true; 
     92    } 
     93     
    8994  } 
    9095   
  • freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/xml2Array.class.php

    r10652 r10678  
    7979    $array = array(); 
    8080    foreach (array_keys($items) as $idx) { 
    81       if (isset($items[$idx]['name'])) { 
    82         @$items[$idx]['name'] = strtolower($items[$idx]['name']); 
    83       } else { 
    84         @$items[$idx]['name'] = ''; 
    85       } 
    86        
     81      @$items[$idx]['name'] = strtolower($items[$idx]['name']); 
    8782       
    8883      $multi = false; 
     
    139134  } 
    140135} 
    141  
    142136 
    143137/* 
     
    208202  } 
    209203} 
    210  
    211 ?> 
  • freepbx/branches/bootstrap/amp_conf/sbin/amportal

    r10636 r10678  
    55# define freepbx config file if not alreaddy set 
    66if [ ! -n "$FREEPBX_CONF" ]; then 
    7   FREEPBX_CONF="/etc/freepbx.php
     7  FREEPBX_CONF="/etc/freepbx.conf
    88fi 
    99 
     
    2121    `php -r ' 
    2222  $skip_astman = true;//no need for astman here 
    23   require_once("/etc/freepbx.php"); 
     23  require_once("/etc/freepbx.conf"); 
    2424  foreach($amp_conf as $key => $val) { 
    2525    echo "export " . trim($key) . "=" . escapeshellcmd(trim($val)) ."\n"; 
  • freepbx/branches/bootstrap/upgrades/2.9.0alpha1/migrate_ampconf.php

    r10617 r10678  
    117117} 
    118118//TODO: set crucial options to readonly 
     119//build freepbx.conf if it doesnt already exists 
     120 
     121if (!file_exists('/etc/freepbx.conf')) { 
     122  $filename = is_writable('/etc') ? '/etc/freepbx.conf' : '/etc/asterisk/freepbx.conf'; 
     123   
     124  $txt = ''; 
     125  $txt .= '<?php' . "\n"; 
     126  $txt .= '$amp_conf[\'AMPDBUSER\'] = "' . $amp_conf['AMPDBUSER'] . '";' . "\n"; 
     127  $txt .= '$amp_conf[\'AMPDBPASS\'] = "' . $amp_conf['AMPDBPASS'] . '";' . "\n"; 
     128  $txt .= '$amp_conf[\'AMPDBHOST\'] = "' . $amp_conf['AMPDBHOST'] . '";' . "\n"; 
     129  $txt .= '$amp_conf[\'AMPDBNAME\'] = "' . $amp_conf['AMPDBNAME'] . '";' . "\n"; 
     130  $txt .= '$amp_conf[\'AMPDBENGINE\'] = "' . $amp_conf['AMPDBENGINE'] . '";' . "\n"; 
     131  $txt .= '$amp_conf[\'datasource\']  = "' . $amp_conf['datasource'] . '";' . "\n"; 
     132  $txt .= 'require_once(\'' . $amp_conf['AMPWEBROOT'] . '/admin/bootstrap.php\');' . "\n"; 
     133  file_put_contents($filename, $txt 
     134     
     135    ); 
     136} 
     137 
     138 
    119139?>