Changeset 14149
- Timestamp:
- 06/18/12 11:48:21 (1 year ago)
- Files:
-
- freepbx/branches/2.10/amp_conf/astetc/manager.conf (modified) (1 diff)
- freepbx/branches/2.10/amp_conf/htdocs/admin/bootstrap.php (modified) (4 diffs)
- freepbx/branches/2.10/amp_conf/htdocs/admin/functions.inc.php (modified) (1 diff)
- freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/utility.functions.php (modified) (3 diffs)
- freepbx/branches/2.10/amp_conf/htdocs/recordings/includes/callme.php (modified) (1 diff)
- freepbx/branches/2.10/libfreepbx.install.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.10/amp_conf/astetc/manager.conf
r10122 r14149 22 22 read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate 23 23 write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate 24 writetimeout = 5000 24 25 25 26 #include manager_additional.conf freepbx/branches/2.10/amp_conf/htdocs/admin/bootstrap.php
r13801 r14149 157 157 } 158 158 if (!isset($no_auth) && !defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }//we should never need this, just another line of defence 159 bootstrap_include_hooks('pre_module_load', 'all_mods'); 159 160 160 161 $restrict_mods_local = $restrict_mods; … … 171 172 //include module functions if there not dissabled 172 173 if ((!$restrict_mods_local || (is_array($restrict_mods_local) && isset($restrict_mods_local[$key]))) && is_file($amp_conf['AMPWEBROOT']."/admin/modules/{$key}/functions.inc.php")) { 174 bootstrap_include_hooks('pre_module_load', $key); 173 175 require_once($amp_conf['AMPWEBROOT']."/admin/modules/{$key}/functions.inc.php"); 174 176 … … 180 182 $force_autoload = true; 181 183 } 184 bootstrap_include_hooks('post_module_load', $key); 182 185 } 183 186 //create an array of module sections to display … … 197 200 } 198 201 } 202 bootstrap_include_hooks('post_module_load', 'all_mods'); 199 203 $bootstrap_settings['function_modules_included'] = true; 200 204 } freepbx/branches/2.10/amp_conf/htdocs/admin/functions.inc.php
r13913 r14149 111 111 } 112 112 113 foreach ($class as $this_class) switch($this_class){ 114 case 'ampuser': 115 require_once($dirname . '/libraries/ampuser.class.php'); 116 break; 117 case 'CI_Email': 118 //make upstream scripts happy - for $CI_Email->_set_error_message() 119 if (!function_exists('log_message')) { 120 function log_message(){}; 121 } 122 if (!function_exists('get_instance')) { 123 function get_instance(){return new ci_def();} 124 } 125 if (!class_exists('ci_def')) { 126 class ci_def {function __construct(){$this->lang = new ci_lan_def();}} 127 } 128 if (!class_exists('ci_lan_def')) { 129 class ci_lan_def {function load(){return false;} function line(){return false;}} 130 } 131 if (!defined('BASEPATH')){ 132 define('BASEPATH', ''); 133 } 134 if (!defined('FOPEN_READ')) { 135 define('FOPEN_READ', 'rb'); 136 } 137 require_once($dirname . '/helpers/Email.php'); 138 break; 139 case 'CI_Table': 140 //make upstream scripts happy 141 if (!function_exists('log_message')) { 142 function log_message(){}; 143 } 144 if (!defined('BASEPATH')){define('BASEPATH', '');} 145 require_once($dirname . '/helpers/Table.php'); 146 break; 147 case 'CssMin': 148 require_once($dirname . '/libraries/cssmin.class.php'); 149 break; 150 case 'component': 151 require_once($dirname . '/libraries/components.class.php'); 152 break; 153 case 'featurecode': 154 require_once($dirname . '/libraries/featurecodes.class.php'); 155 break; 156 case 'cronmanager': 157 require_once($dirname . '/libraries/cronmanager.class.php'); 158 break; 159 case 'moduleHook': 160 require_once($dirname . '/libraries/moduleHook.class.php'); 161 break; 162 case 'modulelist': 163 require_once($dirname . '/libraries/modulelist.class.php'); 164 break; 165 case 'modgettext': 166 require_once($dirname . '/libraries/modgettext.class.php'); 167 break; 168 case 'notifications': 169 require_once($dirname . '/libraries/notifications.class.php'); 170 break; 171 case 'xml2Array': 172 require_once($dirname . '/libraries/xml2Array.class.php'); 173 break; 174 default: 175 //TODO: enable some logging here 176 break; 113 foreach ($class as $this_class) { 114 if (class_exists($this_class)) { 115 continue; 116 } 117 switch($this_class){ 118 case 'ampuser': 119 require_once($dirname . '/libraries/ampuser.class.php'); 120 break; 121 case 'CI_Email': 122 //make upstream scripts happy - for $CI_Email->_set_error_message() 123 if (!function_exists('log_message')) { 124 function log_message(){}; 125 } 126 if (!function_exists('get_instance')) { 127 function get_instance(){return new ci_def();} 128 } 129 if (!class_exists('ci_def')) { 130 class ci_def {function __construct(){$this->lang = new ci_lan_def();}} 131 } 132 if (!class_exists('ci_lan_def')) { 133 class ci_lan_def {function load(){return false;} function line(){return false;}} 134 } 135 if (!defined('BASEPATH')){ 136 define('BASEPATH', ''); 137 } 138 if (!defined('FOPEN_READ')) { 139 define('FOPEN_READ', 'rb'); 140 } 141 require_once($dirname . '/helpers/Email.php'); 142 break; 143 case 'CI_Table': 144 //make upstream scripts happy 145 if (!function_exists('log_message')) { 146 function log_message(){}; 147 } 148 if (!defined('BASEPATH')){define('BASEPATH', '');} 149 require_once($dirname . '/helpers/Table.php'); 150 break; 151 case 'CssMin': 152 require_once($dirname . '/libraries/cssmin.class.php'); 153 break; 154 case 'component': 155 require_once($dirname . '/libraries/components.class.php'); 156 break; 157 case 'featurecode': 158 require_once($dirname . '/libraries/featurecodes.class.php'); 159 break; 160 case 'cronmanager': 161 require_once($dirname . '/libraries/cronmanager.class.php'); 162 break; 163 case 'moduleHook': 164 require_once($dirname . '/libraries/moduleHook.class.php'); 165 break; 166 case 'modulelist': 167 require_once($dirname . '/libraries/modulelist.class.php'); 168 break; 169 case 'modgettext': 170 require_once($dirname . '/libraries/modgettext.class.php'); 171 break; 172 case 'notifications': 173 require_once($dirname . '/libraries/notifications.class.php'); 174 break; 175 case 'xml2Array': 176 require_once($dirname . '/libraries/xml2Array.class.php'); 177 break; 178 default: 179 //TODO: enable some logging here 180 break; 181 } 177 182 } 178 183 } freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/utility.functions.php
r14119 r14149 1224 1224 * allows FreePBX to update the manager credentials primarily used by Advanced Settings and Backup and Restore. 1225 1225 */ 1226 function fpbx_ami_update($user=false, $pass=false) { 1227 global $amp_conf; 1228 global $astman; 1229 1226 function fpbx_ami_update($user=false, $pass=false, $writetimeout = false) { 1227 global $amp_conf, $astman; 1228 $conf_file = $amp_conf['ASTETCDIR'] . '/manager.conf'; 1230 1229 $ret = $ret2 = 0; 1231 1230 $output = array(); 1232 1231 1233 1232 if ($user !== false && $user != '') { 1234 exec('sed -i.bak "s/\s*\[general\].*$/TEMPCONTEXT/;s/\[.*\]/\[' . $amp_conf['AMPMGRUSER'] . '\]/;s/^TEMPCONTEXT$/\[general\]/" '. $ amp_conf['ASTETCDIR'] . '/manager.conf', $output, $ret);1233 exec('sed -i.bak "s/\s*\[general\].*$/TEMPCONTEXT/;s/\[.*\]/\[' . $amp_conf['AMPMGRUSER'] . '\]/;s/^TEMPCONTEXT$/\[general\]/" '. $conf_file, $output, $ret); 1235 1234 if ($ret) { 1236 1235 dbug($output); … … 1245 1244 if ($pass !== false && $pass != '') { 1246 1245 unset($output); 1247 exec('sed -i.bak "s/secret\s*=.*$/secret = ' . $amp_conf['AMPMGRPASS'] . '/" ' . $ amp_conf['ASTETCDIR'] . '/manager.conf', $output, $ret2);1246 exec('sed -i.bak "s/secret\s*=.*$/secret = ' . $amp_conf['AMPMGRPASS'] . '/" ' . $conf_file, $output, $ret2); 1248 1247 if ($ret2) { 1249 1248 dbug($output); … … 1255 1254 } 1256 1255 } 1257 1258 if ($ret || $ret2) { 1256 1257 //attempt to set writetimeout 1258 unset($output);i 1259 if ($writetimeout) { 1260 exec('sed -i.bak "s/writetimeout\s*=.*$/writetimeout = ' 1261 . $amp_conf['ASTMGRWRITETIMEOUT'] . '/" ' . $conf_file, $output, $ret3); 1262 if ($ret3) { 1263 dbug($output); 1264 dbug($ret3); 1265 freepbx_log(FPBX_LOG_ERROR,sprintf(_("Failed changing AMI writetimout to [%s], internal failure details follow:"),$amp_conf['ASTMGRWRITETIMEOUT'])); 1266 foreach ($output as $line) { 1267 freepbx_log(FPBX_LOG_ERROR,sprintf(_("AMI failure details:"),$line)); 1268 } 1269 } 1270 } 1271 if ($ret || $ret2 || $ret3) { 1259 1272 dbug("aborting early because previous errors"); 1260 1273 return false; freepbx/branches/2.10/amp_conf/htdocs/recordings/includes/callme.php
r13922 r14149 53 53 function callme_getnum($exten) 54 54 { 55 global $astman;56 $cmd = "database get AMPUSER $exten/callmenum";55 global $astman; 56 $cmd = "database get AMPUSER $exten/callmenum"; 57 57 $callme_num = ''; 58 $results = $astman->Command($cmd);58 $results = $astman->Command($cmd); 59 59 60 60 if (is_array($results)) freepbx/branches/2.10/libfreepbx.install.php
r14135 r14149 1315 1315 $set['level'] = 0; 1316 1316 1317 // ASTMGRWRITETIMEOUT 1318 $set['value'] = '5000'; 1319 $set['name'] = 'Asterisk Manager Write Timeout'; 1320 $set['description'] = 1321 'Timeout, im ms, for write timeouts for cases where Asterisk disconnects frequently'; 1322 $set['readonly'] = 1; 1323 $set['type'] = CONF_TYPE_INT; 1324 $set['emptyok'] = 1; 1325 $set['options'] = array(100,100000); 1326 $set['level'] = 2; 1327 $freepbx_conf->define_conf_setting('ASTMGRWRITETIMEOUT',$set); 1328 $set['level'] = 0; 1317 1329 1318 1330 //
