Changeset 10315
- Timestamp:
- 09/24/10 04:34:14 (3 years ago)
- Files:
-
- contributed_modules/modules/endpointman/ENDPOINTMAN_LICENSE.txt (added)
- contributed_modules/modules/endpointman/Install/phonesettings.module (modified) (7 diffs)
- contributed_modules/modules/endpointman/ajax_select.html.php (modified) (1 diff)
- contributed_modules/modules/endpointman/export.html.php (modified) (1 diff)
- contributed_modules/modules/endpointman/functions.inc.php (modified) (1 diff)
- contributed_modules/modules/endpointman/includes/advanced.inc (modified) (13 diffs)
- contributed_modules/modules/endpointman/includes/brand_model_manager.inc (modified) (2 diffs)
- contributed_modules/modules/endpointman/includes/devices_manager.inc (modified) (5 diffs)
- contributed_modules/modules/endpointman/includes/functions.inc (modified) (19 diffs)
- contributed_modules/modules/endpointman/index.php (modified) (1 diff)
- contributed_modules/modules/endpointman/install.php (modified) (15 diffs)
- contributed_modules/modules/endpointman/installer.html.php (modified) (1 diff)
- contributed_modules/modules/endpointman/module.xml (modified) (2 diffs)
- contributed_modules/modules/endpointman/page.endpointman.php (modified) (1 diff)
- contributed_modules/modules/endpointman/page.epm_advanced.php (modified) (1 diff)
- contributed_modules/modules/endpointman/page.epm_config.php (modified) (1 diff)
- contributed_modules/modules/endpointman/page.epm_devices.php (modified) (1 diff)
- contributed_modules/modules/endpointman/page.epm_templates.php (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/advanced_settings_iedl.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/advanced_settings_poce.html (modified) (4 diffs)
- contributed_modules/modules/endpointman/templates/advanced_settings_settings.html (modified) (3 diffs)
- contributed_modules/modules/endpointman/templates/advanced_settings_sh_manager.html (modified) (2 diffs)
- contributed_modules/modules/endpointman/templates/advanced_subheader.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/template_editor.html (modified) (2 diffs)
- contributed_modules/modules/endpointman/uninstall.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/endpointman/Install/phonesettings.module
r10052 r10315 1 <?php 1 <?PHP 2 3 /** 4 * Endpoint Manager ARI File 5 * 6 * @author Andrew Nagy 7 * @license MPL / GPLv2 / LGPL 8 * @package Endpoint Manager 9 */ 2 10 3 11 … … 27 35 function init() { 28 36 } 29 37 30 38 /* 31 39 * Adds menu item to nav menu … … 58 66 * action 59 67 */ 60 function action($args) { 68 function action($args) { 69 error_reporting(E_ALL); 70 ini_set('display_errors', 1); 61 71 global $endpoint, $global_cfg; 62 72 63 73 $doc_root = $_SERVER["DOCUMENT_ROOT"] ."/admin/modules/endpointman/"; 64 74 require($doc_root . "includes/functions.inc"); 65 75 66 76 $endpoint = new endpointmanager(); 67 68 $sql = "SELECT id FROM endpointman_mac_list WHERE ext = '".$_SESSION['ari_user']['extension']."' ";69 $results = mysql_query($sql);70 $row = mysql_fetch_assoc($results);71 72 77 73 $id = $row['id']; 78 $sql = "SELECT mac_id, line FROM endpointman_line_list WHERE ext = '".$_SESSION['ari_user']['extension']."' "; 79 $mac_row =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 74 80 75 $row = $endpoint->get_phone_info($id); 76 77 $cfg_data = unserialize($row['cfg_data']); 78 79 80 if($row['custom_cfg_template'] > 0) { 81 $row['custom_cfg_data'] = $row['template_data']['custom_cfg_data']; 82 } 83 $custom_cfg_data2 = unserialize($row['custom_cfg_data']); 84 81 $mac_id = $mac_row['mac_id']; 82 $line = $mac_row['line']; 83 84 $row = $endpoint->get_phone_info($mac_id); 85 86 $cfg_data = unserialize($row['template_data']); 87 88 $custom_cfg_data2 = unserialize($row['global_custom_cfg_data']); 89 85 90 $count = count($cfg_data); 86 91 for($i=0;$i<=$count;$i++) { … … 90 95 } 91 96 } 92 97 93 98 $custom_cfg_data = serialize($custom_cfg_data); 94 95 $sql = "UPDATE endpointman_mac_list SET user_cfg_data = '".$custom_cfg_data."' WHERE id = ". $id;96 mysql_query($sql);97 98 require(PHONE_MODULES_PATH.$row['directory'].'/'.$row['cfg_dir'].'/functions.inc');99 99 100 $phone_config = new $row['cfg_dir'](); 101 $phone_config->generate_config($id); 102 100 $sql = "UPDATE endpointman_mac_list SET global_user_cfg_data = '".$custom_cfg_data."' WHERE id = ". $mac_id; 101 $endpoint->db->query($sql); 102 103 //refresh the data before we prepare so we get acurate data 104 $row['global_user_cfg_data'] = $custom_cfg_data; 105 $endpoint->prepare_configs($row); 106 103 107 $m = "phonesettings"; 104 108 105 109 $ret .= " 106 110 <head> … … 111 115 </script> 112 116 </head>"; 113 117 114 118 return $ret; 115 119 } … … 129 133 die('No Database?'); 130 134 } 131 135 132 136 $doc_root = $_SERVER["DOCUMENT_ROOT"] ."/admin/modules/endpointman/"; 133 137 require($doc_root . "includes/functions.inc"); 134 138 135 139 $endpoint = new endpointmanager(); 136 137 $sql = "SELECT id FROM endpointman_mac_list WHERE ext = '".$_SESSION['ari_user']['extension']."' ";138 $results = mysql_query($sql);139 $row = mysql_fetch_assoc($results);140 141 global $global_cfg;142 140 143 $ row = $endpoint->get_phone_info($row['id']);144 141 $sql = "SELECT mac_id, line FROM endpointman_line_list WHERE ext = '".$_SESSION['ari_user']['extension']."' "; 142 $mac_row =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 145 143 146 144 $mac_id = $mac_row['mac_id']; 145 $line = $mac_row['line']; 147 146 148 if(!$endpoint->sync_product($row['product_id'])) { 149 die("unable to sync local template files". $custom); 147 $row = $endpoint->get_phone_info($mac_id); 148 149 if(!$endpoint->sync_model($row['model_id'])) { 150 die("unable to sync local template files"); 150 151 } 151 152 //Get default template config data from the database for this product153 $sql = "SELECT cfg_data FROM endpointman_product_list WHERE id=". $row['product_id'];154 $result=mysql_query($sql);155 $product_row=mysql_fetch_array($result);156 157 //inset it into our usable row158 $row['cfg_data'] = $product_row['cfg_data'];159 152 160 153 $brand_name = $row['directory']; 161 154 $model_name = $row['cfg_dir']; 162 155 163 156 164 157 //Start the display of the html file in the product folder 165 166 $template .= '<h3>Hello '. $row['description'] . ', You are currently editing phone settings for extension '.$row['ext'].'</h3><br />';167 168 if($row['custom_cfg_template'] > 0) {169 $row['custom_cfg_data'] = $row['template_data']['custom_cfg_data'];170 }171 158 172 $out = $endpoint->generate_gui_html($row['cfg_data'],$row['custom_cfg_data'],FALSE,$row['user_cfg_data']); 173 174 $out[0]['data'] = array_values($out[0]['data']); 175 176 $out[0]['title'] = "Your Phone Settings"; 177 159 $template = '<h3>Hello '. $row['line'][$line]['description'] . ', You are currently editing phone settings for extension '.$row['line'][$line]['ext'].'</h3><br />'; 160 161 $out = $endpoint->generate_gui_html($row['template_data'],$row['global_custom_cfg_data'],FALSE,$row['global_user_cfg_data']); 162 163 if(!empty($out)) { 164 $out[0]['data'] = array_values($out[0]['data']); 165 $out[0]['title'] = "Your Phone Settings"; 166 $button = "<input name='submit' type='submit' value='Save & Reboot'>"; 167 168 } else { 169 $out[0]['title'] = "Your Phone Settings have not been enabled. Please talk to your administrator."; 170 $out[0]['data'] = NULL; 171 $button = ""; 172 } 173 178 174 $tpl = new RainTPL( LOCAL_PATH.'templates' ); 179 175 180 176 $tpl->assign("in_ari", 1); 181 177 $tpl->assign("template_editor", $out); 182 $tpl->assign("hidden_id", $row['id']); 183 $tpl->assign("hidden_custom", $custom); 178 $tpl->assign("hidden_id", $row['line'][$line]['luid']); 184 179 $template .= $tpl->draw( 'template_editor', TRUE ); 185 180 186 181 187 182 $m = "phonesettings"; 188 $ret .= "<form class='phonesettings' name='ari_settings' action='' method='GET'>183 $ret = "<form class='phonesettings' name='ari_settings' action='' method='GET'> 189 184 <input type=hidden name=m value=" . $m . "> 190 185 <input type=hidden name=f value='action'> … … 192 187 <br> 193 188 " . $template . " 194 <br> 195 <input name='submit' type='submit' value='Save & Reboot'> 196 </form>"; 189 <br>". $button ."</form>"; 197 190 return($ret); 198 191 } 199 192 } // class 200 201 ?>contributed_modules/modules/endpointman/ajax_select.html.php
r10218 r10315 1 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX AJAX Select File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 include('includes/ajax_select.php'); contributed_modules/modules/endpointman/export.html.php
r10220 r10315 1 1 <?php 2 /* 3 * To change this template, choose Tools | Templates 4 * and open the template in the editor. 2 /** 3 * Endpoint Manager FreePBX CSV Export 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 5 8 */ 6 9 include('includes/export.php'); contributed_modules/modules/endpointman/functions.inc.php
r10229 r10315 1 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX Hooks File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 3 10 function endpointman_get_config($engine) { contributed_modules/modules/endpointman/includes/advanced.inc
r10240 r10315 15 15 16 16 echo $tpl->draw( 'global_header' ); 17 echo $tpl->draw( 'advanced_subheader' );18 19 17 if(!isset($_REQUEST['subpage'])) { 20 18 $_REQUEST['subpage'] = ""; 19 $tpl->assign("subhead_area", 'settings'); 20 } else { 21 $tpl->assign("subhead_area", $_REQUEST['subpage']); 21 22 } 23 echo $tpl->draw( 'advanced_subheader' ); 24 25 22 26 23 27 switch($_REQUEST['subpage']) { … … 43 47 $sql = "SELECT id FROM endpointman_brand_list WHERE name LIKE '%".$device[1]."%' LIMIT 1"; 44 48 $res =& $db->query($sql); 45 if($res->numRows() ) {49 if($res->numRows() > 0) { 46 50 $brand_id = $endpoint->db->getOne($sql); 47 51 $brand_id = $brand_id[0]; 52 53 $sql_model = "SELECT id FROM endpointman_model_list WHERE brand = ".$brand_id." AND model LIKE '%".$device[2]."%' LIMIT 1"; 54 $sql_ext = "SELECT extension, name FROM users WHERE extension LIKE '%".$device[3]."%' LIMIT 1"; 55 56 $res_model =& $db->query($sql_model); 57 if($res_model->numRows()) { 58 $model_id =& $db->getRow($sql_model,array(), DB_FETCHMODE_ASSOC); 59 $model_id = $model_id['id']; 60 61 $res_ext =& $db->query($sql_ext); 62 if($res_ext->numRows()) { 63 $ext =& $db->getRow($sql_ext,array(), DB_FETCHMODE_ASSOC); 64 $description = $ext['name']; 65 $ext = $ext['extension']; 66 67 $sql = "INSERT INTO endpointman_mac_list (mac, model) VALUES ('".$mac."','".$model_id."')"; 68 $endpoint->db->query($sql); 69 70 $sql = 'SELECT last_insert_id()'; 71 $ext_id =& $endpoint->db->getOne($sql); 72 73 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '1','".$description."')"; 74 $endpoint->db->query($sql); 75 76 $message .= "Inserted Mac Address ".$mac."<br/>"; 77 } else { 78 $endpoint->error['csv_upload'] = 'Invalid Extension Specified'; 79 } 80 } else { 81 $endpoint->error['csv_upload'] = 'Invalid Model Specified'; 82 } 48 83 } else { 49 $ brand_id = 0;84 $endpoint->error['csv_upload'] = 'Invalid Brand Specified'; 50 85 } 51 $sql_model = "SELECT id FROM endpointman_model_list WHERE brand = ".$brand_id." AND model LIKE '%".$device[2]."%' LIMIT 1";52 $sql_ext = "SELECT extension, name FROM users WHERE extension LIKE '%".$device[3]."%' LIMIT 1";53 54 $res_model =& $db->query($sql_model);55 if($res_model->numRows()) {56 $model_id =& $db->getRow($sql_model,array(), DB_FETCHMODE_ASSOC);57 $model_id = $model_id['id'];58 } else {59 $model_id = 0;60 }61 $res_ext =& $db->query($sql_ext);62 if($res_ext->numRows()) {63 $ext =& $db->getRow($sql_ext,array(), DB_FETCHMODE_ASSOC);64 $description = $ext['name'];65 $ext = $ext['extension'];66 } else {67 $ext = '';68 $description = '';69 }70 $sql = "INSERT INTO endpointman_mac_list (mac, model) VALUES ('".$mac."','".$model_id."')";71 $endpoint->db->query($sql);72 73 $sql = 'SELECT last_insert_id()';74 $ext_id =& $endpoint->db->getOne($sql);75 76 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '1','".$description."')";77 $endpoint->db->query($sql);78 79 $message .= "Inserted Mac Address ".$mac."<br/>";80 86 } else { 81 $ message .= "Invalid Mac on line ". $i. "<br />";87 $endpoint->error['csv_upload'] = "Invalid Mac on line ". $i. "<br />"; 82 88 } 83 89 } … … 87 93 unlink(LOCAL_PATH.$_FILES['import_csv']['name']); 88 94 $message .= "Please reboot & rebuild all imported phones<br />"; 89 $tpl->assign("message", $message);90 95 } else { 91 $t pl->assign("message", "Possible file upload attack!");96 $this->error['file_upload'] = "Possible file upload attack!"; 92 97 93 98 } … … 95 100 } 96 101 } 102 } 103 $error_message = NULL; 104 foreach($endpoint->error as $key => $error) { 105 $error_message .= $error; 106 if($endpoint->global_cfg['debug']) { 107 $error_message .= " Function: [".$key."]"; 108 } 109 $error_message .= "<br />"; 110 } 111 if(isset($message)) { 112 $endpoint->display_message_box($message,$tpl,0); 113 } 114 if(isset($error_message)) { 115 $endpoint->display_message_box($error_message,$tpl,1); 97 116 } 98 117 echo $tpl->draw( 'advanced_settings_iedl' ); … … 272 291 $tpl->assign("oui_list_custom", $row_out_custom); 273 292 $tpl->assign("brand_ava", $endpoint->brandAvailable()); 293 294 $error_message = NULL; 295 foreach($endpoint->error as $key => $error) { 296 $error_message .= $error; 297 if($endpoint->global_cfg['debug']) { 298 $error_message .= " Function: [".$key."]"; 299 } 300 $error_message .= "<br />"; 301 } 302 if(isset($message)) { 303 $endpoint->display_message_box($message,$tpl,0); 304 } 305 if(isset($error_message)) { 306 $endpoint->display_message_box($error_message,$tpl,1); 307 } 308 274 309 echo $tpl->draw( 'advanced_settings_oui' ); 275 310 break; … … 289 324 $sql = "DELETE FROM endpointman_custom_configs WHERE id =". $_REQUEST['sql']; 290 325 $endpoint->db->query($sql); 326 $message = "Deleted!"; 291 327 } 292 328 if(1 == 0) { … … 327 363 $contents = fread($handle, filesize($file)); 328 364 fclose($handle); 365 $tpl->assign("location", $file); 329 366 $tpl->assign("config_data", $contents); 330 367 } … … 340 377 fwrite($wfh,$_REQUEST['config_text']); 341 378 fclose($wfh); 379 $message = "Saved to Hard Drive!"; 342 380 }elseif(isset($_REQUEST['button_save_as'])) { 343 381 $sql = 'INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ("'.addslashes($_REQUEST['save_as_name']).'","'.addslashes($config_files[$_REQUEST['file']]).'","'.$_REQUEST['product_select'].'","'.addslashes($_REQUEST['config_text']).'")'; 344 382 $endpoint->db->query($sql); 345 } 346 } 383 $message = "Saved to Database!"; 384 } 385 } 386 347 387 $handle = fopen($file, "rb"); 348 388 $contents = fread($handle, filesize($file)); 349 389 fclose($handle); 390 391 if(isset($_REQUEST['sendid'])) { 392 $endpoint->submit_config($row['directory'],$row['cfg_dir'],$config_files[$_REQUEST['file']],$contents); 393 $message = 'Sent! Thanks :-)'; 394 } 395 350 396 $tpl->assign("save_as_name_value", $config_files[$_REQUEST['file']]); 351 397 $tpl->assign("config_data", $contents); 398 $tpl->assign("filename", $config_files[$_REQUEST['file']]); 399 $tpl->assign('sendid', $_REQUEST['file']); 400 $tpl->assign("type", 'file'); 401 $tpl->assign("location", $file); 402 352 403 } elseif(isset($_REQUEST['sql'])) { 353 404 if(isset($_REQUEST['config_text'])) { … … 355 406 $sql = "UPDATE endpointman_custom_configs SET data = '".addslashes($_REQUEST['config_text'])."' WHERE id = ".$_REQUEST['sql']; 356 407 $endpoint->db->query($sql); 408 $message = "Saved to Database!"; 357 409 }elseif(isset($_REQUEST['button_save_as'])) { 358 410 $sql = 'SELECT original_name FROM endpointman_custom_configs WHERE id = '.$_REQUEST['sql']; … … 361 413 $sql = "INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ('".addslashes($_REQUEST['save_as_name'])."','".addslashes($file_name)."','".$_REQUEST['product_select']."','".addslashes($_REQUEST['config_text'])."')"; 362 414 $endpoint->db->query($sql); 363 } 415 $message = "Saved to Database!"; 416 } 417 } 418 if(isset($_REQUEST['sendid'])) { 419 $sql = "SELECT cfg_dir,directory,config_files FROM endpointman_product_list,endpointman_brand_list WHERE endpointman_product_list.brand = endpointman_brand_list.id AND endpointman_product_list.id = '". $_REQUEST['product_select'] ."'"; 420 $row22 =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 421 $endpoint->submit_config($row22['directory'],$row22['cfg_dir'],$config_files[$_REQUEST['file']],$contents); 422 $message = 'Sent! Thanks! :-)'; 364 423 } 365 424 $sql = 'SELECT * FROM endpointman_custom_configs WHERE id =' . $_REQUEST['sql']; 366 425 $row =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 367 426 $tpl->assign("save_as_name_value", $row['name']); 427 $tpl->assign("filename", $row['original_name']); 428 $tpl->assign('sendid', $_REQUEST['sql']); 429 $tpl->assign("type", 'sql'); 368 430 $tpl->assign("config_data", $row['data']); 369 431 } … … 433 495 } 434 496 $tpl->assign("product_list", $product_list); 497 498 $error_message = NULL; 499 foreach($endpoint->error as $key => $error) { 500 $error_message .= $error; 501 if($endpoint->global_cfg['debug']) { 502 $error_message .= " Function: [".$key."]"; 503 } 504 $error_message .= "<br />"; 505 } 506 if(isset($message)) { 507 $endpoint->display_message_box($message,$tpl,0); 508 } 509 if(isset($error_message)) { 510 $endpoint->display_message_box($error_message,$tpl,1); 511 } 512 435 513 echo $tpl->draw( 'advanced_settings_poce' ); 436 514 break; … … 549 627 $tpl->assign("debug_selected", $debug_selected); 550 628 629 $tpl->assign("ip", $_SERVER["SERVER_ADDR"]); 630 $tpl->assign("srvip", $endpoint->global_cfg['srvip']); 631 $tpl->assign("arp_location", $endpoint->global_cfg['arp_location']); 632 $tpl->assign("nmap_location", $endpoint->global_cfg['nmap_location']); 633 $tpl->assign("asterisk_location", $endpoint->global_cfg['asterisk_location']); 634 635 $tpl->assign("config_location", $endpoint->global_cfg['config_location']); 636 $tpl->assign("list_tz", $endpoint->listTZ($endpoint->global_cfg['tz'])); 637 $tpl->assign("brand_list", $endpoint->brandAvailable()); 638 551 639 $error_message = NULL; 552 640 foreach($endpoint->error as $key => $error) { … … 564 652 } 565 653 566 $tpl->assign("ip", $_SERVER["SERVER_ADDR"]);567 $tpl->assign("srvip", $endpoint->global_cfg['srvip']);568 $tpl->assign("arp_location", $endpoint->global_cfg['arp_location']);569 $tpl->assign("nmap_location", $endpoint->global_cfg['nmap_location']);570 $tpl->assign("asterisk_location", $endpoint->global_cfg['asterisk_location']);571 572 $tpl->assign("config_location", $endpoint->global_cfg['config_location']);573 $tpl->assign("list_tz", $endpoint->listTZ($endpoint->global_cfg['tz']));574 $tpl->assign("brand_list", $endpoint->brandAvailable());575 654 echo $tpl->draw( 'advanced_settings_settings' ); 576 655 break; contributed_modules/modules/endpointman/includes/brand_model_manager.inc
r10233 r10315 18 18 $installer = array("type" => 'brand', "id" => $_REQUEST['brand']); 19 19 } 20 } elseif((isset($_REQUEST['button_install_firmware'])) OR (isset($_REQUEST['button_update_firmware'])) AND (isset($_REQUEST['product']))) { 20 } elseif(isset($_REQUEST['product'])) { 21 if(isset($_REQUEST['button_install_firmware'])) { 22 $installer = array("type" => 'firmware', "id" => $_REQUEST['product']); 23 } elseif(isset($_REQUEST['button_update_firmware'])) { 24 $endpoint->remove_firmware($_REQUEST['product']); 21 25 $installer = array("type" => 'firmware', "id" => $_REQUEST['product']); 26 } 22 27 } elseif((isset($_REQUEST['button_remove_firmware'])) AND (isset($_REQUEST['product']))) { 23 28 $endpoint->remove_firmware($_REQUEST['product']); … … 82 87 $row_out[$i]['products'][$j] = $row2; 83 88 if($check_for_updates) { 84 if(($temp = $endpoint->firmware_update_check($row2['id'])) AND (array_key_exists('firmware_vers', $row )) AND ($row['firmware_vers'] > 0)) {89 if(($temp = $endpoint->firmware_update_check($row2['id'])) AND (array_key_exists('firmware_vers', $row2)) AND ($row2['firmware_vers'] > 0)) { 85 90 $row_out[$i]['products'][$j]['update_fw'] = 1; 86 91 $row_out[$i]['products'][$j]['update_vers_fw'] = $temp['data']['version']; contributed_modules/modules/endpointman/includes/devices_manager.inc
r10259 r10315 129 129 $sql = "DELETE FROM endpointman_line_list WHERE mac_id=".$_REQUEST['id']; 130 130 $endpoint->db->query($sql); 131 $message = _("Deleted")."!"; 131 132 } elseif((isset($_REQUEST['button_add_selected_phones'])) AND (isset($_REQUEST['add']))) { 132 133 $list_num = count($_REQUEST['add']); … … 233 234 $phone_info = $endpoint->get_phone_info($data['id']); 234 235 $endpoint->prepare_configs($phone_info); 236 foreach($phone_info['line'] as $line) { 237 $sql = "UPDATE endpointman_line_list SET description = '".$line['description']."' WHERE luid = ".$line['luid']; 238 $endpoint->db->query($sql); 239 } 235 240 } 236 241 } elseif(isset($_REQUEST['button_rebuild_reboot'])) { … … 247 252 $phone_info = $endpoint->get_phone_info($row['id']); 248 253 $endpoint->prepare_configs($phone_info); 254 foreach($phone_info['line'] as $line) { 255 $sql = "UPDATE endpointman_line_list SET description = '".$line['description']."' WHERE luid = ".$line['luid']; 256 $endpoint->db->query($sql); 257 } 249 258 } 250 259 } … … 404 413 $tpl->assign("brand_id", $edit_row['brand_id']); 405 414 $tpl->assign("models_ava", $ma); 406 $tpl->assign("display_ext", $endpoint->displayExtension($edit_row[' ext']));415 $tpl->assign("display_ext", $endpoint->displayExtension($edit_row['line'][1]['luid'])); 407 416 $tpl->assign("display_templates", $endpoint->display_templates($edit_row['product_id'],$edit_row['template_id'])); 408 417 $tpl->assign("edit_id", $edit_row['id']); … … 420 429 $error_message .= "<br />"; 421 430 } 431 432 if(isset($message)) { 433 $endpoint->display_message_box($message,$tpl,0); 434 } 435 422 436 if(isset($error_message)) { 423 437 $endpoint->display_message_box($error_message,$tpl,1); 424 438 } 425 if(isset($message)) {426 $endpoint->display_message_box($message,$tpl,0);427 }428 439 429 440 //draw the template contributed_modules/modules/endpointman/includes/functions.inc
r10261 r10315 25 25 date_default_timezone_set('America/Los_Angeles'); 26 26 27 $this->db = $db; 27 if(isset($_SESSION['dbh_asterisk'])) { 28 $this->db = $_SESSION['dbh_asterisk']; 29 $_SERVER["SCRIPT_FILENAME"] = str_replace("recordings/", "admin/", $_SERVER["SCRIPT_FILENAME"]); 30 } else { 31 $this->db = $db; 32 } 28 33 $this->amp_conf = $amp_conf; 29 34 $this->error = array(); 30 35 31 36 $this->global_cfg =& $this->db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); 37 38 define("UPDATE_PATH", $this->global_cfg['update_server']); 39 define("VER", $this->global_cfg['version']); 32 40 //Define the location of phone modules, keeping it outside of the module directory so that when the user updates endpointmanager they don't lose all of their phones 33 41 define("PHONE_MODULES_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/_ep_phone_modules/"); … … 36 44 define("WEB_PATH", dirname($_SERVER['SCRIPT_NAME'])."/modules/endpointman/"); 37 45 define("LOCAL_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/endpointman/"); 38 39 40 $this->global_cfg =& $this->db->getAssoc("SELECT var_name, value FROM endpointman_global_vars");41 42 define("UPDATE_PATH", $this->global_cfg['update_server']);43 define("VER", $this->global_cfg['version']);44 46 45 47 //Define error reporting … … 49 51 } else { 50 52 ini_set('display_errors', 0); 51 } 53 } 54 55 //Check writable 56 if(isset($this->global_cfg['config_location'])) { 57 if(is_dir($this->global_cfg['config_location'])) { 58 if(!is_writeable($this->global_cfg['config_location'])) { 59 $user = exec('whoami'); 60 $this->error['config_location'] = "Configuration Directory is not writable!". 61 "<br />Please change the location: <a href='config.php?type=tool&display=epm_advanced'>Here</a>". 62 "<br />Or run this command on SSH: 'chown -R ".$user.":".$user." ".$this->global_cfg['config_location']."' then 'chmod -R 777 ".$this->global_cfg['config_location']."'"; 63 } 64 } else { 65 $this->error['config_location'] = "Configuration Directory is not a directory or does not exist! Please change the location here: <a href='config.php?type=tool&display=epm_advanced'>Here</a>"; 66 } 67 } 52 68 53 69 //include the local template class 54 70 include LOCAL_PATH."includes/rain.tpl.class.php"; 71 } 72 73 function submit_config($brand,$product,$orig_name,$data) { 74 $posturl = 'http://www.provisioner.net/submit_config.php'; 75 $postvars = 'brand=&product=&origname='.htmlentities(addslashes($orig_name)).'&config_data='.base64_encode($data); 76 77 $ch = curl_init($posturl); 78 curl_setopt($ch, CURLOPT_POST, 1); 79 curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars); 80 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 81 curl_setopt($ch, CURLOPT_HEADER, 0); // DO NOT RETURN HTTP HEADERS 82 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // RETURN THE CONTENTS OF THE CALL 83 $Rec_Data = curl_exec($ch); 84 85 ob_start(); 86 header("Content-Type: text/html"); 87 $Final_Out=ob_get_clean(); 88 curl_close($ch); 89 55 90 } 56 91 … … 193 228 return(FALSE); 194 229 } 195 $sql = "SELECT id ,mac,model FROMendpointman_mac_list WHERE model > 0 AND id =".$mac_id;230 $sql = "SELECT id FROM endpointman_mac_list WHERE model > 0 AND id =".$mac_id; 196 231 197 232 $res =& $this->db->query($sql); 198 233 if($res->numRows()) { 199 234 //Returns Brand Name, Brand Directory, Model Name, Mac Address, Extension (FreePBX), Custom Configuration Template, Custom Configuration Data, Product Name, Product ID, Product Configuration Directory, Product Configuration Version, Product XML name, 200 $sql = "SELECT endpointman_mac_list.config_files_override, endpointman_mac_list.global_user_cfg_data, endpointman_model_list.id as model_id, endpointman_brand_list.id as brand_id, endpointman_brand_list.name, endpointman_brand_list.directory, endpointman_model_list.model, endpointman_mac_list.mac, endpointman_ line_list.ext, endpointman_mac_list.template_id, endpointman_mac_list.global_custom_cfg_data, endpointman_product_list.long_name, endpointman_product_list.id as product_id, endpointman_product_list.cfg_dir, endpointman_product_list.cfg_ver, endpointman_model_list.template_data, endpointman_model_list.enabled, devices.description, sip.data as secret FROM endpointman_line_list, endpointman_mac_list, endpointman_model_list, endpointman_brand_list, endpointman_product_list, sip, devices WHERE endpointman_mac_list.model = endpointman_model_list.id AND endpointman_brand_list.id = endpointman_model_list.brand AND endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_line_list.ext = sip.id AND sip.keyword = 'secret' AND endpointman_line_list.ext = devices.id AND endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_mac_list.id = ". $mac_id;235 $sql = "SELECT endpointman_mac_list.config_files_override, endpointman_mac_list.global_user_cfg_data, endpointman_model_list.id as model_id, endpointman_brand_list.id as brand_id, endpointman_brand_list.name, endpointman_brand_list.directory, endpointman_model_list.model, endpointman_mac_list.mac, endpointman_mac_list.template_id, endpointman_mac_list.global_custom_cfg_data, endpointman_product_list.long_name, endpointman_product_list.id as product_id, endpointman_product_list.cfg_dir, endpointman_product_list.cfg_ver, endpointman_model_list.template_data, endpointman_model_list.enabled FROM endpointman_line_list, endpointman_mac_list, endpointman_model_list, endpointman_brand_list, endpointman_product_list WHERE endpointman_mac_list.model = endpointman_model_list.id AND endpointman_brand_list.id = endpointman_model_list.brand AND endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_mac_list.id = ". $mac_id; 201 236 202 237 $phone_info =& $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); … … 213 248 214 249 } 250 251 $sql = "SELECT endpointman_line_list.*, sip.data as secret, devices.* FROM endpointman_line_list, sip, devices WHERE endpointman_line_list.ext = devices.id AND endpointman_line_list.ext = sip.id AND sip.keyword = 'secret' AND mac_id = ".$mac_id; 252 $lines_info =& $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 253 foreach($lines_info as $line) { 254 $phone_info['line'][$line['line']] = $line; 255 } 256 257 215 258 } else { 216 259 $sql = "SELECT id, mac, ext FROM endpointman_mac_list WHERE id =".$mac_id; … … 439 482 } 440 483 $items[$i] = $items; 441 $template_variables_array[$group_count]['data'][$variables_count] = $this->generate_form_data($i,$items,$key,$custom_cfg_data );484 $template_variables_array[$group_count]['data'][$variables_count] = $this->generate_form_data($i,$items,$key,$custom_cfg_data,$admin,$user_cfg_data); 442 485 $template_variables_array[$group_count]['data'][$variables_count]['looping'] = TRUE; 443 486 $variables_count++; … … 445 488 } 446 489 } else { 447 $template_variables_array[$group_count]['data'][$variables_count] = $this->generate_form_data($i,$cfg_data,$key,$custom_cfg_data); 490 if(!isset($variables_count)) { 491 $variables_count = 0; 492 } 493 $template_variables_array[$group_count]['data'][$variables_count] = $this->generate_form_data($i,$cfg_data,$key,$custom_cfg_data,$admin,$user_cfg_data); 448 494 $variables_count++; 449 495 } … … 461 507 * @return array 462 508 */ 463 function generate_form_data ($i,$cfg_data,$key,$custom_cfg_data) { 464 $admin = TRUE; 509 function generate_form_data ($i,$cfg_data,$key,$custom_cfg_data,$admin=FALSE,$user_cfg_data) { 465 510 if ($cfg_data[$i]['type'] == "input") { 466 511 if((!$admin) && (isset($user_cfg_data[$key]['value']))) { … … 510 555 } 511 556 if(($this->global_cfg['enable_ari']) AND ($admin) AND ($cfg_data[$i]['type'] != "break") AND ($cfg_data[$i]['type'] != "group")) { 557 512 558 $template_variables_array['aried'] = 1; 513 559 $template_variables_array['ari']['key'] = $key; … … 673 719 } 674 720 675 //Pretend we have three lines, we could just have one line or 20...whatever the phone supports 676 $provisioner_lib->lines[1] = array('ext' => $phone_info['ext'], 'secret' => $phone_info['secret'], 'displayname' => $phone_info['description']); 721 //Loop through Lines! 722 foreach($phone_info['line'] as $line) { 723 $provisioner_lib->lines[$line['line']] = array('ext' => $line['ext'], 'secret' => $line['secret'], 'displayname' => $line['description']); 724 } 725 726 $global_user_cfg_data = unserialize($phone_info['global_user_cfg_data']); 677 727 678 728 if(is_array($phone_info['template_data'])) { … … 681 731 $template_data = unserialize($phone_info['global_custom_cfg_data']); 682 732 } 733 683 734 $new_template_data = array(); 684 735 if(is_array($template_data)) { 685 736 foreach($template_data as $key => $data) { 686 737 if(array_key_exists('value', $data)) { 687 $new_template_data[$key] = $data['value']; 738 if((isset($template_data[$key]['ari'])) && (isset($global_user_cfg_data[$key]['value']))) { 739 $new_template_data[$key] = $global_user_cfg_data[$key]['value']; 740 } else { 741 $new_template_data[$key] = $data['value']; 742 } 688 743 } else { 689 744 $key = explode('_',$key); … … 697 752 //line 'global' will set variables that aren't line dependant 698 753 $provisioner_lib->options = $new_template_data; 754 699 755 //Setting a line variable here...these aren't defined in the template_data.xml file yet. however they will still be parsed 700 756 //and if they have defaults assigned in a future template_data.xml or in the config file using pipes (|) those will be used, pipes take precedence 757 $provisioner_lib->processor_info = "EndPoint Manager Version ".$this->global_cfg['version']; 701 758 702 759 // Because every brand is an extension (eventually) of endpoint, you know this function will exist regardless of who it is 760 //Start timer 761 $time_start = microtime(true); 703 762 $returned_data = $provisioner_lib->generate_config(); 704 763 //End timer 764 $time_end = microtime(true); 765 $time = $time_end - $time_start; 766 if($time > 360) { 767 $this->error['generate_time'] = "It's taking a awfully long time to generate configs...(".round($time,2)." seconds)"; 768 } 705 769 //Create Directory Structure (If needed) 706 770 if(isset($provisioner_lib->directory_structure)) { … … 744 808 } 745 809 746 $provisioner_lib->processor_info = "EndPoint Manager Version ".$this->global_cfg['version'];747 748 810 //Generate Files 749 811 foreach($returned_data as $key => $data) { … … 828 890 /** 829 891 * Remove firmware from the Hard Drive 830 * @param int $id Pro cut ID892 * @param int $id Product ID 831 893 */ 832 894 function remove_firmware($id=NULL) { … … 836 898 $file_list = explode(",",$files); 837 899 $i = 0; 838 while($i < count($file_list)) { 839 unlink($this->global_cfg['config_location'].$file_list[$i]); 840 $i++; 900 foreach($file_list as $file) { 901 if(file_exists($this->global_cfg['config_location'].$file)) { 902 unlink($this->global_cfg['config_location'].$file); 903 } 841 904 } 842 905 $sql = 'UPDATE endpointman_product_list SET firmware_files = "", firmware_vers = "" WHERE id = '.$id; … … 846 909 /** 847 910 * Install Firmware for the specified Product Line 848 * @param <type> $product_id 911 * @param <type> $product_id Product ID 849 912 */ 850 913 function install_firmware($product_id) { … … 1023 1086 } 1024 1087 } else { 1025 $this->error['brand_update_check_local_file'] = "<br/>Error: No Local File for ".$data['name']."! ";1088 $this->error['brand_update_check_local_file'] = "<br/>Error: No Local File for ".$data['name']."!<br /><br />Learn how to manually upload packages here (it's easy!): <a href='http://projects.colsolgrp.net/documents/28' target='_blank'>Click Here!</a>"; 1026 1089 } 1027 1090 } … … 1045 1108 } 1046 1109 } else { 1047 $this->error['brand_update_check_master_file'] = "<br/>Aborting Brand Downloads. Can't Get Master File, Assuming Timeout Issues! ";1110 $this->error['brand_update_check_master_file'] = "<br/>Aborting Brand Downloads. Can't Get Master File, Assuming Timeout Issues!<br /><br />Learn how to manually upload packages here (it's easy!): <a href='http://projects.colsolgrp.net/documents/28' target='_blank'>Click Here!</a>"; 1048 1111 } 1049 1112 … … 1842 1905 } 1843 1906 1844 function displayExtension($ext = NULL) { 1845 if(!isset($ext)) { 1907 function displayExtension($line_id = NULL) { 1908 if(!isset($line_id)) { 1909 $ext = NULL; 1846 1910 $not_added="SELECT devices.id, devices.description FROM devices WHERE tech='sip' AND devices.id not in (SELECT devices.id FROM devices, endpointman_line_list WHERE tech='sip' AND devices.id = endpointman_line_list.ext ) ORDER BY devices.id"; 1847 1911 } else { 1912 $sql = 'SELECT ext FROM endpointman_line_list WHERE luid = '.$line_id; 1913 $ext = $this->db->getOne($sql); 1848 1914 $not_added="SELECT devices.id, devices.description FROM devices WHERE tech='sip' AND devices.id not in (SELECT devices.id FROM devices, endpointman_line_list WHERE tech='sip' AND devices.id = endpointman_line_list.ext AND endpointman_line_list.ext !=".$ext." ) ORDER BY devices.id"; 1849 1915 } contributed_modules/modules/endpointman/index.php
r9907 r10315 1 1 <?PHP 2 /* 3 Endpoint Manager V2 4 Copyright (C) 2009-2010 Ed Macri, John Mullinix and Andrew Nagy 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License 8 as published by the Free Software Foundation; either version 2 9 of the License, or (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 20 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 */ 2 /** 3 * Endpoint Manager Index File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 22 9 include('page.endpointman.php'); 23 ?>contributed_modules/modules/endpointman/install.php
r10259 r10315 1 1 <?PHP 2 //ini_set('display_errors', 1); 3 //error_reporting(E_ALL); 4 /* 5 Endpoint Manager V2 6 Copyright (C) 2009-2010 Ed Macri, John Mullinix and Andrew Nagy 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 22 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 23 */ 24 2 /** 3 * Endpoint Manager Installer 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 25 9 if (! function_exists("out")) { 26 10 function out($text) { … … 70 54 71 55 if(!file_exists(PHONE_MODULES_PATH."setup.php")) { 72 copy(LOCAL_PATH." Install/setup.php",PHONE_MODULES_PATH."setup.php");56 copy(LOCAL_PATH."install/setup.php",PHONE_MODULES_PATH."setup.php"); 73 57 out("Moving Auto Provisioner Class"); 74 58 } … … 93 77 } 94 78 95 $version = "2.2. 8";79 $version = "2.2.9"; 96 80 97 81 if(ep_table_exists("endpointman_global_vars")) { … … 142 126 $ver = "2.2.7"; 143 127 } elseif($global_cfg['version'] == '2.2.8') { 144 $ver = "2.2.8"; 128 $ver = "2.2.8"; 129 } elseif($global_cfg['version'] == '2.2.9') { 130 $ver = "2.2.9"; 131 } elseif($global_cfg['version'] == '2.3.0') { 132 $ver = "2.3.0"; 133 } elseif($global_cfg['version'] == '2.3.1') { 134 $ver = "2.3.1"; 145 135 } else { 146 136 $ver = "1000"; … … 153 143 out('Version Identified as '. $ver); 154 144 } 155 156 if(($ver < "1.9.0") AND ($ver > 0)) { 145 if(!$new_install) { 146 147 if(($ver < "1.9.0") AND ($ver > 0)) { 157 148 out("Please Wait While we upgrade your old setup"); 158 149 //Expand the value option … … 326 317 327 318 out("DONE! You can now use endpoint manager!"); 328 }329 330 if ($ver <= "1.9.0") {319 } 320 321 if ($ver <= "1.9.0") { 331 322 out("Locating NMAP + ARP + ASTERISK Executables"); 332 323 … … 397 388 $sql = "ALTER TABLE endpointman_mac_list CHANGE custom_cfg_data custom_cfg_data TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL"; 398 389 $db->query($sql); 399 }400 if ($ver <= "1.9.1") {390 } 391 if ($ver <= "1.9.1") { 401 392 out("Create Custom Configs Table"); 402 393 $sql = "CREATE TABLE IF NOT EXISTS `endpointman_custom_configs` ( … … 452 443 $sql = "ALTER TABLE endpointman_mac_list CHANGE custom_cfg_data custom_cfg_data TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL"; 453 444 $db->query($sql); 454 }455 if ($ver <= "1.9.2") {445 } 446 if ($ver <= "1.9.2") { 456 447 out('Updating Global Variables'); 457 }458 459 if ($ver <= "1.9.9") {448 } 449 450 if ($ver <= "1.9.9") { 460 451 out("Adding Custom Field to OUI List"); 461 452 $sql = 'ALTER TABLE `endpointman_oui_list` ADD `custom` INT(1) NOT NULL DEFAULT \'0\''; … … 500 491 $sql = "INSERT INTO cronmanager (module, id, time, freq, lasttime, command) VALUES ('endpointman', 'UPDATES', '23', '24', '0', 'php ".LOCAL_PATH. "includes/update_check.php')"; 501 492 $db->query($sql); 502 } 503 if($ver <= "2.0.0") { 504 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 505 out("Installing ARI Module"); 506 copy(LOCAL_PATH. "Install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 507 508 copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 509 510 copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 511 512 copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 513 514 515 out("Fixing permissions on ARI module"); 516 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 517 } 518 493 } 494 if($ver <= "2.0.0") { 519 495 out("Locating NMAP + ARP + ASTERISK Executables"); 520 496 $nmap = find_exec("nmap"); … … 586 562 587 563 $new_model_list = array( 588 "2" => "1-2-11",589 "3" => "1-2-10",590 "4" => "1-2-9",591 "6" => "4-2-3",592 "7" => "4-3-7",593 "8" => "6-1-1",594 "9" => "6-1-2",595 "10" => "6-1-3",596 "11" => "6-1-4",597 "12" => "6-1-5",598 "13" => "6-1-6",599 "15" => "2-1-3",600 "22" => "4-2-4",601 "23" => "2-1-2",602 "24" => "2-1-1",603 "25" => "2-1-4",604 "26" => "2-1-5",605 "27" => "2-2-1",606 "28" => "2-2-2",607 "29" => "4-2-1",608 "30" => "4-2-5",609 "31" => "4-2-6",610 "32" => "4-2-7",611 "33" => "4-2-2",612 "34" => "4-3-1",613 "35" => "4-3-2",614 "36" => "4-3-3",615 "37" => "4-3-4",616 "38" => "4-3-5",617 "39" => "4-3-6",618 "40" => "4-3-8",619 "41" => "4-3-9",620 "42" => "4-3-10",621 "43" => "4-3-11",622 "44" => "4-3-12",623 "45" => "4-1-1",624 "46" => "4-1-2",625 "47" => "1-2-1",626 "48" => "1-2-2",627 "49" => "1-1-1",628 "50" => "1-1-2",629 "51" => "1-2-3",630 "52" => "1-2-4",631 "53" => "1-2-5",632 "54" => "1-2-6",633 "55" => "1-2-7",634 "56" => "1-2-8",635 "57" => "",636 "58" => "",637 "59" => "",638 "60" => "7-1-1",639 "61" => "7-1-2",640 "62" => "8-1-1",641 "63" => "8-1-2",642 "64" => "8-1-3",643 "65" => "8-1-4",644 "67" => "7-2-1",645 "68" => "7-2-2",646 "69" => "7-2-3",647 "70" => "7-2-4",648 "71" => "7-2-5",649 "72" => "7-2-6"564 "2" => "1-2-11", 565 "3" => "1-2-10", 566 "4" => "1-2-9", 567 "6" => "4-2-3", 568 "7" => "4-3-7", 569 "8" => "6-1-1", 570 "9" => "6-1-2", 571 "10" => "6-1-3", 572 "11" => "6-1-4", 573 "12" => "6-1-5", 574 "13" => "6-1-6", 575 "15" => "2-1-3", 576 "22" => "4-2-4", 577 "23" => "2-1-2", 578 "24" => "2-1-1", 579 "25" => "2-1-4", 580 "26" => "2-1-5", 581 "27" => "2-2-1", 582 "28" => "2-2-2", 583 "29" => "4-2-1", 584 "30" => "4-2-5", 585 "31" => "4-2-6", 586 "32" => "4-2-7", 587 "33" => "4-2-2", 588 "34" => "4-3-1", 589 "35" => "4-3-2", 590 "36" => "4-3-3", 591 "37" => "4-3-4", 592 "38" => "4-3-5", 593 "39" => "4-3-6", 594 "40" => "4-3-8", 595 "41" => "4-3-9", 596 "42" => "4-3-10", 597 "43" => "4-3-11", 598 "44" => "4-3-12", 599 "45" => "4-1-1", 600 "46" => "4-1-2", 601 "47" => "1-2-1", 602 "48" => "1-2-2", 603 "49" => "1-1-1", 604 "50" => "1-1-2", 605 "51" => "1-2-3", 606 "52" => "1-2-4", 607 "53" => "1-2-5", 608 "54" => "1-2-6", 609 "55" => "1-2-7", 610 "56" => "1-2-8", 611 "57" => "", 612 "58" => "", 613 "59" => "", 614 "60" => "7-1-1", 615 "61" => "7-1-2", 616 "62" => "8-1-1", 617 "63" => "8-1-2", 618 "64" => "8-1-3", 619 "65" => "8-1-4", 620 "67" => "7-2-1", 621 "68" => "7-2-2", 622 "69" => "7-2-3", 623 "70" => "7-2-4", 624 "71" => "7-2-5", 625 "72" => "7-2-6" 650 626 ); 651 627 … … 658 634 659 635 $new_product_list = array( 660 "6" => array("product_id" => "1-1", "model_id" => "1-1-1"),661 "7" => array("product_id" => "1-2", "model_id" => "1-2-1"),662 "1" => array("product_id" => "2-1", "model_id" => "2-1-1"),663 "2" => array("product_id" => "2-2", "model_id" => "2-2-1"),664 "3" => array("product_id" => "4-2", "model_id" => "4-2-1"),665 "5" => array("product_id" => "4-1", "model_id" => "4-1-1"),666 "4" => array("product_id" => "4-3", "model_id" => "4-3-1"),667 "8" => array("product_id" => "6-1", "model_id" => "6-1-1"),668 "9" => array("product_id" => "7-1", "model_id" => "7-1-1"),669 "11" => array("product_id" => "7-2", "model_id" => "7-2-1"),670 "10" => array("product_id" => "8-1", "model_id" => "8-1-1")636 "6" => array("product_id" => "1-1", "model_id" => "1-1-1"), 637 "7" => array("product_id" => "1-2", "model_id" => "1-2-1"), 638 "1" => array("product_id" => "2-1", "model_id" => "2-1-1"), 639 "2" => array("product_id" => "2-2", "model_id" => "2-2-1"), 640 "3" => array("product_id" => "4-2", "model_id" => "4-2-1"), 641 "5" => array("product_id" => "4-1", "model_id" => "4-1-1"), 642 "4" => array("product_id" => "4-3", "model_id" => "4-3-1"), 643 "8" => array("product_id" => "6-1", "model_id" => "6-1-1"), 644 "9" => array("product_id" => "7-1", "model_id" => "7-1-1"), 645 "11" => array("product_id" => "7-2", "model_id" => "7-2-1"), 646 "10" => array("product_id" => "8-1", "model_id" => "8-1-1") 671 647 ); 672 648 … … 685 661 } 686 662 663 out('WARNING: Config Files have changed MUCH. We have to remove all of your old custom config files. Sorry :-('); 664 $db->query('TRUNCATE TABLE `endpointman_custom_configs`'); 665 666 667 exec("rm -Rf ".PHONE_MODULES_PATH); 668 669 if(!file_exists(PHONE_MODULES_PATH)) { 670 mkdir(PHONE_MODULES_PATH, 0764); 671 out("Creating Phone Modules Directory"); 672 } 673 674 if(!file_exists(PHONE_MODULES_PATH."setup.php")) { 675 copy(LOCAL_PATH."install/setup.php",PHONE_MODULES_PATH."setup.php"); 676 out("Moving Auto Provisioner Class"); 677 } 678 679 if(!file_exists(PHONE_MODULES_PATH."temp/")) { 680 mkdir(PHONE_MODULES_PATH."temp/", 0764); 681 out("Creating temp folder"); 682 } 683 } 684 if ($ver <= "2.2.1") { 685 } 686 687 if ($ver <= "2.2.2") { 688 689 out("Remove all Dashes in IDs"); 687 690 $data = array(); 688 $data =& $db->getAll("SELECT * FROM endpointman_custom_configs",array(), DB_FETCHMODE_ASSOC); 689 $variable_change = array( 690 "{\$srvip}" => "{\$server.ip.1}", 691 "{\$ext}" => "{\$ext.line.1}", 692 "{\$pass}" => "{\$pass.line.1}", 693 "{\$secret}" => "{\$pass.line.1}", 694 "{\$displayname}" => "{\$displayname.line.1}" 695 ); 696 691 $data =& $db->getAll("SELECT * FROM `endpointman_model_list",array(), DB_FETCHMODE_ASSOC); 697 692 foreach($data as $list) { 698 foreach($variable_change as $key => $value) { 699 $list['data'] = str_replace($key, $value, $list['data']); 700 } 701 $sql = "UPDATE endpointman_custom_configs SET data = '".addslashes($list['data'])."' WHERE id = ". $list['id']; 693 $new_model_id = str_replace("-", "", $list['id']); 694 $sql = "UPDATE endpointman_model_list SET id = '".$new_model_id."' WHERE id = ". $list['id']; 702 695 $db->query($sql); 703 696 } 704 697 705 exec("rm -Rf ".PHONE_MODULES_PATH); 706 707 if(!file_exists(PHONE_MODULES_PATH)) { 708 mkdir(PHONE_MODULES_PATH, 0764); 709 out("Creating Phone Modules Directory"); 710 } 711 712 if(!file_exists(PHONE_MODULES_PATH."setup.php")) { 713 copy(LOCAL_PATH."Install/setup.php",PHONE_MODULES_PATH."setup.php"); 714 out("Moving Auto Provisioner Class"); 715 } 716 717 if(!file_exists(PHONE_MODULES_PATH."temp/")) { 718 mkdir(PHONE_MODULES_PATH."temp/", 0764); 719 out("Creating temp folder"); 720 } 721 } 722 if ($ver <= "2.2.1") { 723 } 724 725 if ($ver <= "2.2.2") { 726 727 out("Remove all Dashes in IDs"); 728 $data = array(); 729 $data =& $db->getAll("SELECT * FROM `endpointman_model_list",array(), DB_FETCHMODE_ASSOC); 730 foreach($data as $list) { 731 $new_model_id = str_replace("-", "", $list['id']); 732 $sql = "UPDATE endpointman_model_list SET id = '".$new_model_id."' WHERE id = ". $list['id']; 733 $db->query($sql); 734 } 735 736 $data = array(); 737 $data =& $db->getAll("SELECT * FROM `endpointman_product_list",array(), DB_FETCHMODE_ASSOC); 738 foreach($data as $list) { 739 $new_product_id = str_replace("-", "", $list['id']); 740 $sql = "UPDATE endpointman_product_list SET id = '".$new_product_id."' WHERE id = ". $list['id']; 741 $db->query($sql); 742 } 743 744 $data = array(); 745 $data =& $db->getAll("SELECT * FROM `endpointman_mac_list",array(), DB_FETCHMODE_ASSOC); 746 foreach($data as $list) { 747 $new_model_id = str_replace("-", "", $list['model']); 748 $sql = "UPDATE endpointman_mac_list SET model = '".$new_model_id."' WHERE id = ". $list['id']; 749 $db->query($sql); 750 } 751 752 $data = array(); 753 $data =& $db->getAll("SELECT * FROM endpointman_template_list",array(), DB_FETCHMODE_ASSOC); 754 foreach($data as $list) { 755 $new_model_id = str_replace("-", "", $list['model_id']); 756 $new_product_id = str_replace("-", "", $list['product_id']); 757 $sql = "UPDATE endpointman_template_list SET model_id = '".$new_model_id."', product_id = '".$new_product_id."' WHERE id = ". $list['id']; 758 $db->query($sql); 759 } 760 761 $data = array(); 762 $data =& $db->getAll("SELECT * FROM endpointman_custom_configs",array(), DB_FETCHMODE_ASSOC); 763 foreach($data as $list) { 764 $new_product_id = str_replace("-", "", $list['product_id']); 765 $sql = "UPDATE endpointman_custom_configs SET product_id = '".$new_product_id."' WHERE id = ". $list['id']; 766 $db->query($sql); 767 } 768 } if ($ver <= "2.2.3") { 769 $sql = 'UPDATE `asterisk`.`endpointman_global_vars` SET `value` = \'http://www.provisioner.net/release/\' WHERE `endpointman_global_vars`.`idnum` = 6 LIMIT 1;'; 770 $db->query($sql); 771 } 772 773 if ($ver <= "2.2.4") { 774 out("Fix Debug Left on Error, this turns off debug."); 775 $sql = 'UPDATE `asterisk`.`endpointman_global_vars` SET `value` = \'1\' WHERE `endpointman_global_vars`.`idnum` = 9 LIMIT 1;'; 776 $db->query($sql); 777 } 778 779 if ($ver <= "2.2.5") { 780 out("Fixing Permissions of Phone Modules Directory"); 781 $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PHONE_MODULES_PATH), RecursiveIteratorIterator::SELF_FIRST); 782 foreach($iterator as $item) { 783 chmod($item, 0764); 784 } 785 786 out("Creating Endpoint Version Row"); 787 $sql = 'INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, \'endpoint_vers\', \'\');'; 788 $db->query($sql); 789 } 790 791 if ($ver <= "2.2.6") { 792 $sql = "CREATE TABLE IF NOT EXISTS `endpointman_line_list` ( 698 $data = array(); 699 $data =& $db->getAll("SELECT * FROM `endpointman_product_list",array(), DB_FETCHMODE_ASSOC); 700 foreach($data as $list) { 701 $new_product_id = str_replace("-", "", $list['id']); 702 $sql = "UPDATE endpointman_product_list SET id = '".$new_product_id."' WHERE id = ". $list['id']; 703 $db->query($sql); 704 } 705 706 $data = array(); 707 $data =& $db->getAll("SELECT * FROM `endpointman_mac_list",array(), DB_FETCHMODE_ASSOC); 708 foreach($data as $list) { 709 $new_model_id = str_replace("-", "", $list['model']); 710 $sql = "UPDATE endpointman_mac_list SET model = '".$new_model_id."' WHERE id = ". $list['id']; 711 $db->query($sql); 712 } 713 714 $data = array(); 715 $data =& $db->getAll("SELECT * FROM endpointman_template_list",array(), DB_FETCHMODE_ASSOC); 716 foreach($data as $list) { 717 $new_model_id = str_replace("-", "", $list['model_id']); 718 $new_product_id = str_replace("-", "", $list['product_id']); 719 $sql = "UPDATE endpointman_template_list SET model_id = '".$new_model_id."', product_id = '".$new_product_id."' WHERE id = ". $list['id']; 720 $db->query($sql); 721 } 722 723 $data = array(); 724 $data =& $db->getAll("SELECT * FROM endpointman_custom_configs",array(), DB_FETCHMODE_ASSOC); 725 foreach($data as $list) { 726 $new_product_id = str_replace("-", "", $list['product_id']); 727 $sql = "UPDATE endpointman_custom_configs SET product_id = '".$new_product_id."' WHERE id = ". $list['id']; 728 $db->query($sql); 729 } 730 } if 731 ($ver <= "2.2.3") { 732 $sql = "UPDATE endpointman_global_vars SET value = 'http://www.provisioner.net/release/' WHERE var_name = 'update_server'"; 733 $db->query($sql); 734 } 735 736 if ($ver <= "2.2.4") { 737 738 } 739 740 if ($ver <= "2.2.5") { 741 out("Fixing Permissions of Phone Modules Directory"); 742 $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PHONE_MODULES_PATH), RecursiveIteratorIterator::SELF_FIRST); 743 foreach($iterator as $item) { 744 chmod($item, 0764); 745 } 746 747 out("Creating Endpoint Version Row"); 748 $sql = 'INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, \'endpoint_vers\', \'\');'; 749 $db->query($sql); 750 } 751 752 if ($ver <= "2.2.6") { 753 $sql = "CREATE TABLE IF NOT EXISTS `endpointman_line_list` ( 793 754 `luid` int(11) NOT NULL AUTO_INCREMENT, 794 755 `mac_id` int(11) NOT NULL, … … 800 761 PRIMARY KEY (`luid`) 801 762 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;"; 802 $db->query($sql); 803 804 $data = array(); 805 $data =& $db->getAll("SELECT * FROM endpointman_mac_list",array(), DB_FETCHMODE_ASSOC); 806 foreach($data as $list) { 807 $sql = "INSERT INTO endpointman_line_list (mac_id, line, ext, description) VALUES ('".$list['id']."', '1', '".$list['ext']."', '".$list['description']."')"; 808 $db->query($sql); 809 } 810 811 $sql = 'ALTER TABLE `endpointman_custom_configs` CHANGE `data` `data` LONGBLOB NOT NULL'; 812 $db->query($sql); 813 814 $sql = 'ALTER TABLE `endpointman_mac_list` DROP `description`'; 815 $db->query($sql); 816 817 $sql = 'ALTER TABLE `endpointman_mac_list` DROP `ext`'; 818 $db->query($sql); 819 820 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `custom_cfg_template` `template_id` INT(11) NOT NULL'; 821 $db->query($sql); 822 823 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `cfg_template_data` `global_template_id` LONGBLOB NOT NULL'; 824 $db->query($sql); 825 826 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `user_cfg_data` `global_user_cfg_data` LONGBLOB NOT NULL'; 827 $db->query($sql); 828 829 $sql = 'ALTER TABLE `endpointman_model_list` ADD `max_lines` SMALLINT(2) NOT NULL AFTER `model`;'; 830 $db->query($sql); 831 832 $sql = 'ALTER TABLE `endpointman_model_list` CHANGE `template_data` `template_data` LONGBLOB NOT NULL'; 833 $db->query($sql); 834 835 $sql = 'ALTER TABLE `endpointman_template_list` CHANGE `custom_cfg_data` `global_custom_cfg_data` LONGBLOB NULL DEFAULT NULL'; 836 $db->query($sql); 837 838 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `custom_cfg_data` `global_custom_cfg_data` LONGBLOB NOT NULL'; 839 $db->query($sql); 840 763 $db->query($sql); 764 765 $data = array(); 766 $data =& $db->getAll("SELECT * FROM endpointman_mac_list",array(), DB_FETCHMODE_ASSOC); 767 foreach($data as $list) { 768 $sql = "INSERT INTO endpointman_line_list (mac_id, line, ext, description) VALUES ('".$list['id']."', '1', '".$list['ext']."', '".$list['description']."')"; 769 $db->query($sql); 770 } 771 772 $sql = 'ALTER TABLE `endpointman_custom_configs` CHANGE `data` `data` LONGBLOB NOT NULL'; 773 $db->query($sql); 774 775 $sql = 'ALTER TABLE `endpointman_mac_list` DROP `description`'; 776 $db->query($sql); 777 778 $sql = 'ALTER TABLE `endpointman_mac_list` DROP `ext`'; 779 $db->query($sql); 780 781 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `custom_cfg_template` `template_id` INT(11) NOT NULL'; 782 $db->query($sql); 783 784 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `cfg_template_data` `global_template_id` LONGBLOB NOT NULL'; 785 $db->query($sql); 786 787 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `user_cfg_data` `global_user_cfg_data` LONGBLOB NOT NULL'; 788 $db->query($sql); 789 790 $sql = 'ALTER TABLE `endpointman_model_list` ADD `max_lines` SMALLINT(2) NOT NULL AFTER `model`;'; 791 $db->query($sql); 792 793 $sql = 'ALTER TABLE `endpointman_model_list` CHANGE `template_data` `template_data` LONGBLOB NOT NULL'; 794 $db->query($sql); 795 796 $sql = 'ALTER TABLE `endpointman_template_list` CHANGE `custom_cfg_data` `global_custom_cfg_data` LONGBLOB NULL DEFAULT NULL'; 797 $db->query($sql); 798 799 $sql = 'ALTER TABLE `endpointman_mac_list` CHANGE `custom_cfg_data` `global_custom_cfg_data` LONGBLOB NOT NULL'; 800 $db->query($sql); 801 802 } 803 804 if ($ver <= "2.2.7") { 805 806 } 807 808 if ($ver <= "2.2.8") { 809 out("Fix Debug Left on Error, this turns off debug."); 810 $sql = "UPDATE endpointman_global_vars SET value = '0' WHERE var_name = 'debug'"; 811 $db->query($sql); 812 813 $sql = 'ALTER TABLE endpointman_mac_list CHANGE global_user_cfg_data global_user_cfg_data LONGBLOB NOT NULL'; 814 $db->query($sql); 815 } 816 817 if ($ver <= '2.2.9') { 818 819 } 841 820 } 842 843 if ($ver <= "2.2.7") {844 845 }846 847 if ($ver <= "2.2.8") {848 849 }850 851 821 852 822 … … 920 890 `template_id` int(11) NOT NULL, 921 891 `global_custom_cfg_data` longblob NOT NULL, 922 `global_user_cfg_data` blob NOT NULL,892 `global_user_cfg_data` longblob NOT NULL, 923 893 `config_files_override` text NOT NULL, 924 894 PRIMARY KEY (`id`), … … 1122 1092 $db->query($sql); 1123 1093 1124 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 1125 out("Installing ARI Module"); 1126 copy(LOCAL_PATH. "Install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 1127 1128 copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 1129 1130 copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 1131 1132 copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 1133 1134 1135 out("Fixing permissions on ARI module"); 1136 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 1137 } 1094 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 1095 out("Installing ARI Module"); 1096 copy(LOCAL_PATH. "install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 1097 1098 mkdir($amp_conf['AMPWEBROOT']."/recordings/theme/js/"); 1099 1100 copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 1101 1102 copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 1103 1104 copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 1105 1106 1107 out("Fixing permissions on ARI module"); 1108 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 1109 } 1110 1138 1111 } else { 1139 1112 out("Update Version Number"); 1140 1113 $sql = "UPDATE endpointman_global_vars SET value = '".$version."' WHERE var_name = 'version'"; 1141 1114 $db->query($sql); 1115 1116 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 1117 out("Installing ARI Module"); 1118 copy(LOCAL_PATH. "install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 1119 1120 mkdir($amp_conf['AMPWEBROOT']."/recordings/theme/js/"); 1121 1122 copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 1123 1124 copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 1125 1126 copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 1127 1128 1129 out("Fixing permissions on ARI module"); 1130 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 1131 } 1142 1132 } contributed_modules/modules/endpointman/installer.html.php
r10219 r10315 1 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX Sub-Module Installer 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 include('includes/installer.php'); contributed_modules/modules/endpointman/module.xml
r10262 r10315 2 2 <rawname>endpointman</rawname> 3 3 <name>PBX End Point Manager</name> 4 <version>2.2. 8</version>4 <version>2.2.9</version> 5 5 <type>tool</type> 6 6 <category>End Point Manager</category> … … 22 22 <location>contributed_modules/release/endpointman-2.2.8.tgz</location> 23 23 24 <md5sum> 8427f7636c2982fad2e5bb52f7c88289</md5sum>24 <md5sum>b1341a35ef60d0fad17348803a0a7833</md5sum> 25 25 </module> contributed_modules/modules/endpointman/page.endpointman.php
r10218 r10315 1 <?php 1 <?PHP 2 /** 3 * Endpoint Manager Master Page File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 require_once $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/config.php'; 3 10 contributed_modules/modules/endpointman/page.epm_advanced.php
r10218 r10315 1 <?php 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 require_once $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/config.php'; 3 10 contributed_modules/modules/endpointman/page.epm_config.php
r10218 r10315 1 <?php 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 require_once $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/config.php'; 3 10 contributed_modules/modules/endpointman/page.epm_devices.php
r10218 r10315 1 <?php 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 3 10 require_once $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/config.php'; contributed_modules/modules/endpointman/page.epm_templates.php
r10218 r10315 1 <?php 1 <?PHP 2 /** 3 * Endpoint Manager FreePBX File 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 2 9 3 10 require_once $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/config.php'; contributed_modules/modules/endpointman/templates/advanced_settings_iedl.html
r10219 r10315 1 <center><h3>{$message}</h3></center> 1 {if condition="isset($show_error_box)"} 2 {include="message_box"} 3 {/if} 2 4 <p><?=_('Export CSV file of devices')?>: 3 5 <br> contributed_modules/modules/endpointman/templates/advanced_settings_poce.html
r10227 r10315 1 {if condition="isset($show_error_box)"} 2 {include="message_box"} 3 {/if} 1 4 <center><form method="post" action="config.php{$web_vars}&display=epm_advanced&subpage=poce"> 2 5 <?=_("Select Product")?> … … 20 23 <center><h4><?=_("File Configuration Editor")?></h4> 21 24 <table width="70%" border="0" cellspacing="4" cellpadding="4"> 25 <tr><td></td><td><div style="font-size: 14px" align="left">{if condition="isset($location)"}File Location: <i>{$location}</i>{/if}</div></td></tr> 22 26 <tr> 23 27 <td valign="top"> … … 46 50 <textarea name="config_text" id="textarea" cols="100" rows="30" wrap="off">{if condition="isset($config_data)"}{$config_data}{/if}</textarea> 47 51 </label> 48 <br> 52 <br><div style="font-size: 15px"> 49 53 <label> 50 54 <input type="submit" name="button_save" value="<?=_('Save')?>"> … … 55 59 <label> 56 60 <input type="text" name="save_as_name" id="save_as_name" value="{if condition="isset($save_as_name_value)"}{$save_as_name_value}{/if}"> 57 </label>{/if} 58 </form></td> 61 </label>{/if}{if condition="isset($type)"}|| <a href="config.php{$web_vars}&display=epm_advanced&subpage=poce&sendid={$sendid}&filename={$filename}&product_select={$product_selected}&{if condition="$type == 'sql'"}sql={$sendid}{else}file={$sendid}{/if}">Click here to send this configuration file to the Provisioner.net Team</a>{/if}</div> 62 </form><div style="font-size: 13px">(Note: 'Save' Saves to the local hard drive, if the phone module is ever updated this file will be over-written, 'Save As' Saves to the database and is not over-written on updates)</div></td> 63 59 64 </tr> 60 65 </table> contributed_modules/modules/endpointman/templates/advanced_settings_settings.html
r10233 r10315 53 53 </tr> 54 54 <tr> 55 <td align='right'><?=_("Enable FreePBX ARI Module")?> </td>55 <td align='right'><?=_("Enable FreePBX ARI Module")?> (<a href="http://projects.colsolgrp.net/documents/29" target="_blank">What?</a>)</td> 56 56 <td align='left'><label> 57 57 <input type=checkbox name="enable_ari" {$ari_selected}> … … 64 64 </label></td> 65 65 </tr> 66 <!-- 66 67 <tr> 67 68 <td align='right'><?=_("Enable Nightly Phone Module Updates Check")?></td> … … 70 71 </label></td> 71 72 </tr> 73 --> 72 74 <tr> 73 75 <td colspan='2' align='center'><input type='Submit' name='button_update_globals' value='<?=_('Update Globals')?>'></td> contributed_modules/modules/endpointman/templates/advanced_settings_sh_manager.html
r10052 r10315 18 18 --> 19 19 </style> 20 <?=_('Note: This will show or hide Brands/Products/Models on the Brand Configurations/Setup page ONLY!')?>21 <br />22 <br />23 20 {loop name="brand2_list"} 24 21 <table width="100%" class="brand" border="0" cellspacing="0" cellpadding="0"> 25 22 <tr> 26 <td colspan="2">{$value.name} (<?=_('Version')?> [{$value.cfg_ver}])<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td>23 <td colspan="2">{$value.name}<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td> 27 24 </tr> 28 25 <tr> … … 31 28 <table width="100%" class="product" border="0" cellspacing="0" cellpadding="0"> 32 29 <tr> 33 <td colspan="2">{$value.long_name} {if condition="$value.cfg_ver != ''"}(<?=_('Version')?> [{$value.cfg_ver}]){/if}<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="product" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td>30 <td colspan="2">{$value.long_name}<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="product" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td> 34 31 </tr> 35 32 <tr> contributed_modules/modules/endpointman/templates/advanced_subheader.html
r10218 r10315 1 1 <table align='center' width='90%'> 2 2 <tr> 3 <td align='center'><h4><a href='{$web_vars}&display=epm_advanced&subpage=settings'><?=_('Settings')?></a></h4></td>4 <td align='center'><h4><a href='{$web_vars}&display=epm_advanced&subpage=oui_manager'><?=_('OUI Manager')?></a></h4></td>5 <td align='center'><h4><a href='{$web_vars}&display=epm_advanced&subpage=poce'><?=_('Product Options/Configuration Editor')?></a></h4></td>3 <td align='center'>{if condition="$subhead_area == 'settings'"}<h4 style="color:#ff9933;"><?=_('Settings')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=settings'><?=_('Settings')?></a></h4>{/if}</td> 4 <td align='center'>{if condition="$subhead_area == 'oui_manager'"}<h4 style="color:#ff9933;"><?=_('OUI Manager')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=oui_manager'><?=_('OUI Manager')?></a></h4>{/if}</td> 5 <td align='center'>{if condition="$subhead_area == 'poce'"}<h4 style="color:#ff9933;"><?=_('Product Options/Configuration Editor')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=poce'><?=_('Product Options/Configuration Editor')?></a></h4>{/if}</td> 6 6 </tr> 7 7 <tr> 8 <td align='center'> <h4><a href='{$web_vars}&display=epm_advanced&subpage=iedl'><?=_('Import/Export Devices My Devices List')?></a></h4></td>9 <td align='center'> <h4><a href='{$web_vars}&display=epm_advanced&subpage=manual_upload'><?=_('Manual Endpoint Modules Upload')?></a></h4></td>10 <td align='center'> <h4><a href='{$web_vars}&display=epm_advanced&subpage=sh_manager'><?=_('Show/Hide Brands/Models')?></a></h4></td>8 <td align='center'>{if condition="$subhead_area == 'iedl'"}<h4 style="color:#ff9933;"><?=_('Import/Export Devices My Devices List')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=iedl'><?=_('Import/Export Devices My Devices List')?></a></h4>{/if}</td> 9 <td align='center'>{if condition="$subhead_area == 'manual_upload'"}<h4 style="color:#ff9933;"><?=_('Manual Endpoint Modules Upload')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=manual_upload'><?=_('Manual Endpoint Modules Upload')?></a></h4>{/if}</td> 10 <td align='center'>{if condition="$subhead_area == 'sh_manager'"}<h4 style="color:#ff9933;"><?=_('Show/Hide Brands/Models')?></h4>{else}<h4><a href='{$web_vars}&display=epm_advanced&subpage=sh_manager'><?=_('Show/Hide Brands/Models')?></a></h4>{/if}</td> 11 11 </tr> 12 12 </table> contributed_modules/modules/endpointman/templates/template_editor.html
r10240 r10315 91 91 </td><td width="90%"> 92 92 {if condition="isset($value.aried)"} 93 <label><input type='checkbox' name='ari_{$value.ari.key}' {if condition="isset($value.ari.checked)"}{$value.ari.checked}{/if}> <?=_('End User Editable (Through ARI Module)')?></label>93 <label><input type='checkbox' name='ari_{$value.ari.key}' {if condition="isset($value.ari.checked)"}{$value.ari.checked}{/if}>End User Editable (<a href="http://projects.colsolgrp.net/documents/29" target="_blank">Through ARI Module</a>)</label> 94 94 {/if} 95 95 </td> … … 113 113 <input type="submit" name="button_save_template" value="<?=_('Save Template');?>"> 114 114 </form> 115 {include="global_footer"} 115 116 {/if} 116 {include="global_footer"}contributed_modules/modules/endpointman/uninstall.php
r10240 r10315 1 1 <?PHP 2 /* 3 Endpoint Manager V2 4 Copyright (C) 2009-2010 Ed Macri, John Mullinix and Andrew Nagy 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License 8 as published by the Free Software Foundation; either version 2 9 of the License, or (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 20 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 */ 2 /** 3 * Endpoint Manager Uninstaller 4 * 5 * @author Andrew Nagy 6 * @license MPL / GPLv2 / LGPL 7 * @package Endpoint Manager 8 */ 22 9 require dirname($_SERVER["SCRIPT_FILENAME"]). "/modules/endpointman/includes/functions.inc"; 23 10 … … 78 65 unlink($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 79 66 80 ?> 67 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 68 69 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 70 71 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css");
