Changeset 10678
- Timestamp:
- 12/09/10 17:02:07 (2 years ago)
- Files:
-
- freepbx/branches/bootstrap/amp_conf/astetc/cdr_mysql.conf (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/astetc/manager.conf (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/bin/archive_recordings (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/bin/freepbx-cron-scheduler.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/bin/freepbx_engine (modified) (6 diffs)
- freepbx/branches/bootstrap/amp_conf/bin/generate_hints.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/bin/module_admin (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/bin/retrieve_conf (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/bootstrap.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/config.functions.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/xml2Array.class.php (modified) (3 diffs)
- freepbx/branches/bootstrap/amp_conf/sbin/amportal (modified) (2 diffs)
- freepbx/branches/bootstrap/upgrades/2.9.0alpha1/migrate_ampconf.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/bootstrap/amp_conf/astetc/cdr_mysql.conf
r10654 r10678 14 14 hostname = localhost 15 15 dbname=asteriskcdrdb 16 password = AMPDBPASS17 user = AMPDBUSER16 password = passw0rd 17 user = root 18 18 userfield=1 19 19 ;port=3306 freepbx/branches/bootstrap/amp_conf/astetc/manager.conf
r10653 r10678 16 16 displayconnects=no ;only effects 1.6+ 17 17 18 [ AMPMGRUSER]19 secret = AMPMGRPASS18 [admin] 19 secret = amp111 20 20 deny=0.0.0.0/0.0.0.0 21 21 permit=127.0.0.1/255.255.255.0 freepbx/branches/bootstrap/amp_conf/bin/archive_recordings
r10617 r10678 1 1 #!/usr/bin/php -q 2 2 <?php 3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 3 //include bootstrap 4 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 5 include_once('/etc/asterisk/freepbx.conf'); 6 } 4 7 5 8 define("MONITOR_DIR", "/var/spool/asterisk/monitor"); freepbx/branches/bootstrap/amp_conf/bin/freepbx-cron-scheduler.php
r10617 r10678 1 1 #!/usr/bin/php -q 2 2 <?php 3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 4 3 //include bootstrap 4 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 5 include_once('/etc/asterisk/freepbx.conf'); 6 } 5 7 // Define the notification class for logging to the dashboard 6 8 // freepbx/branches/bootstrap/amp_conf/bin/freepbx_engine
r10646 r10678 13 13 # define freepbx config file if not alreaddy set 14 14 if [ ! -n "$FREEPBX_CONF" ]; then 15 FREEPBX_CONF="/etc/freepbx. php"15 FREEPBX_CONF="/etc/freepbx.conf" 16 16 fi 17 17 … … 37 37 FPBXDBUGFILE=/tmp/freepbx_debug.log 38 38 39 write_freepbx php() {40 if [ ! -e /etc/freepbx.php]; then41 cat > /etc/freepbx.php<<-EOF39 write_freepbxconf() { 40 if [ ! -e $FREEPBX_CONF ]; then 41 cat > $FREEPBX_CONF <<-EOF 42 42 <?php 43 43 \$amp_conf['AMPDBUSER'] = '$AMPDBUSER'; … … 45 45 \$amp_conf['AMPDBHOST'] = '$AMPDBHOST'; 46 46 \$amp_conf['AMPDBNAME'] = '$AMPENGINE'; 47 \$amp_conf['AMPDBENGINE'] = '$AMPDBENGINE';47 \$amp_conf['AMPDBENGINE'] = '$AMPDBENGINE'; 48 48 \$amp_conf['datasource'] = ''; //for sqlite3 49 49 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 55 52 EOF 56 53 fi 57 54 if [ -e /etc/asterisk/freepbx.conf ]; then 55 rm /etc/asterisk/freepbx.conf 56 fi 58 57 } 59 58 … … 62 61 `php -r ' 63 62 $skip_astman = true;//no need for astman here 64 require_once("/etc/freepbx. php");63 require_once("/etc/freepbx.conf"); 65 64 foreach($amp_conf as $key => $val) { 66 65 echo "export " . trim($key) . "=" . escapeshellcmd(trim($val)) ."\n"; 67 66 } 68 67 '` 69 elif [ -e "/etc/amportal.conf" ]; then # Check if file exists, if it dose read it and then write out /etc/freepbx. php68 elif [ -e "/etc/amportal.conf" ]; then # Check if file exists, if it dose read it and then write out /etc/freepbx.conf 70 69 . /etc/amportal.conf 71 write_freepbx php70 write_freepbxconf 72 71 else 73 72 echo; … … 111 110 112 111 chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP /etc/amportal.conf 113 chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP /etc/freepbx.php112 chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $FREEPBX_CONF 114 113 chmod g+w /etc/amportal.conf 115 chmod g+w /etc/freepbx.php114 chmod g+w $FREEPBX_CONF 116 115 chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $ASTRUNDIR 117 116 chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $ASTETCDIR … … 285 284 stop_fop 286 285 sleep 1 287 write_freepbx php286 write_freepbxconf 288 287 chown_asterisk 289 288 run_asterisk freepbx/branches/bootstrap/amp_conf/bin/generate_hints.php
r10649 r10678 1 1 #!/usr/bin/php -q 2 2 <?php 3 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 4 3 //include bootstrap 4 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 5 include_once('/etc/asterisk/freepbx.conf'); 6 } 5 7 $debug = -1; 6 8 freepbx/branches/bootstrap/amp_conf/bin/module_admin
r10617 r10678 16 16 */ 17 17 18 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 19 18 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 19 include_once('/etc/asterisk/freepbx.conf'); 20 } 20 21 function out($text) { 21 22 echo $text."\n"; freepbx/branches/bootstrap/amp_conf/bin/retrieve_conf
r10671 r10678 2 2 <?php 3 3 4 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 4 //include bootstrapper 5 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 6 include_once('/etc/asterisk/freepbx.conf'); 7 } 5 8 6 9 class connectdirs { freepbx/branches/bootstrap/amp_conf/htdocs/admin/bootstrap.php
r10671 r10678 12 12 13 13 //include database conifguration 14 require_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.php'); 14 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 15 include_once('/etc/asterisk/freepbx.conf'); 16 } 15 17 16 18 freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/config.functions.php
r10636 r10678 86 86 $sql = 'SELECT `key`, value FROM freepbx_settings'; 87 87 $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 89 94 } 90 95 freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/xml2Array.class.php
r10652 r10678 79 79 $array = array(); 80 80 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']); 87 82 88 83 $multi = false; … … 139 134 } 140 135 } 141 142 136 143 137 /* … … 208 202 } 209 203 } 210 211 ?>freepbx/branches/bootstrap/amp_conf/sbin/amportal
r10636 r10678 5 5 # define freepbx config file if not alreaddy set 6 6 if [ ! -n "$FREEPBX_CONF" ]; then 7 FREEPBX_CONF="/etc/freepbx. php"7 FREEPBX_CONF="/etc/freepbx.conf" 8 8 fi 9 9 … … 21 21 `php -r ' 22 22 $skip_astman = true;//no need for astman here 23 require_once("/etc/freepbx. php");23 require_once("/etc/freepbx.conf"); 24 24 foreach($amp_conf as $key => $val) { 25 25 echo "export " . trim($key) . "=" . escapeshellcmd(trim($val)) ."\n"; freepbx/branches/bootstrap/upgrades/2.9.0alpha1/migrate_ampconf.php
r10617 r10678 117 117 } 118 118 //TODO: set crucial options to readonly 119 //build freepbx.conf if it doesnt already exists 120 121 if (!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 119 139 ?>
