Changeset 10233
- Timestamp:
- 08/29/10 02:59:02 (1 year ago)
- Files:
-
- contributed_modules/modules/endpointman/config.php (modified) (3 diffs)
- contributed_modules/modules/endpointman/includes/advanced.inc (modified) (9 diffs)
- contributed_modules/modules/endpointman/includes/brand_model_manager.inc (modified) (2 diffs)
- contributed_modules/modules/endpointman/includes/devices_manager.inc (modified) (4 diffs)
- contributed_modules/modules/endpointman/includes/functions.inc (modified) (21 diffs)
- contributed_modules/modules/endpointman/includes/installer.php (modified) (2 diffs)
- contributed_modules/modules/endpointman/includes/template_manager.inc (modified) (2 diffs)
- contributed_modules/modules/endpointman/install.php (modified) (3 diffs)
- contributed_modules/modules/endpointman/module.xml (modified) (2 diffs)
- contributed_modules/modules/endpointman/templates/advanced_settings_manual_upload.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/advanced_settings_settings.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/brand_model_manager.html (modified) (2 diffs)
- contributed_modules/modules/endpointman/templates/devices_manager.html (modified) (3 diffs)
- contributed_modules/modules/endpointman/templates/global_footer.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/template_editor.html (modified) (2 diffs)
- contributed_modules/modules/endpointman/templates/template_manager.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/endpointman/config.php
r10220 r10233 21 21 } 22 22 23 if(phpversion < '5.0.0') { 24 die(_('PHP Version MUST be greater than 5!')); 25 } 26 23 27 include 'includes/functions.inc'; 24 28 … … 27 31 $endpoint = new endpointmanager(); 28 32 29 if(!file_exists(PHONE_MODULES_PATH)) {30 mkdir(PHONE_MODULES_PATH, 0764);31 }32 33 if(!file_exists(PHONE_MODULES_PATH."temp/")) { 33 mkdir(PHONE_MODULES_PATH."temp/", 0764 );34 mkdir(PHONE_MODULES_PATH."temp/", 0764, TRUE); 34 35 } 35 36 … … 39 40 40 41 if(!is_writeable(PHONE_MODULES_PATH)) { 41 chmod(PHONE_MODULES_PATH, 0764); 42 chmod(PHONE_MODULES_PATH, 0764); 43 $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PHONE_MODULES_PATH), RecursiveIteratorIterator::SELF_FIRST); 44 foreach($iterator as $item) { 45 chmod($item, 0764); 46 } 42 47 } 43 48 contributed_modules/modules/endpointman/includes/advanced.inc
r10227 r10233 10 10 $tpl = new RainTPL( LOCAL_PATH.'templates' ); 11 11 //Set the message variable to nothing, however we can set it later and it will show up on the page 12 $message = "";12 $message = NULL; 13 13 $tpl->assign("message", $message); 14 14 $tpl->assign("web_vars", "?type=$type"); … … 121 121 $tpl->assign("xml", 0); 122 122 } else { 123 $ message= $endpoint->file_upload_error_message($_FILES['package']['error']);124 } 125 } else { 126 $ message = "InvalidExtension";123 $endpoint->error['manual_upload'] = $endpoint->file_upload_error_message($_FILES['package']['error']); 124 } 125 } else { 126 $endpoint->error['manual_upload'] = "Invalid File Extension"; 127 127 } 128 128 … … 140 140 $tpl->assign("xml", $name); 141 141 } else { 142 $ message= $endpoint->file_upload_error_message($_FILES['xml']['error']);143 } 144 } else { 145 $ message = "InvalidExtension";142 $endpoint->error['manual_upload'] = $endpoint->file_upload_error_message($_FILES['xml']['error']); 143 } 144 } else { 145 $endpoint->error['manual_upload'] = "Invalid File Extension"; 146 146 } 147 147 } elseif(isset($_REQUEST['upload_brand'])) { … … 159 159 $i++; 160 160 } else { 161 $e rror_message= $endpoint->file_upload_error_message($files['error']);161 $endpoint->error['manual_upload'] = $endpoint->file_upload_error_message($files['error']); 162 162 $error = TRUE; 163 163 } 164 164 } else { 165 $e rror_message = "InvalidExtension";165 $endpoint->error['manual_upload'] = "Invalid File Extension"; 166 166 $error = TRUE; 167 167 } … … 177 177 178 178 } 179 $tpl->assign("message", $message); 179 $error_message = NULL; 180 foreach($endpoint->error as $key => $error) { 181 $error_message .= $error; 182 if($endpoint->global_cfg['debug']) { 183 $error_message .= " Function: [".$key."]"; 184 } 185 $error_message .= "<br />"; 186 } 187 if(isset($message)) { 188 $endpoint->display_message_box($message,$tpl,0); 189 } 190 if(isset($error_message)) { 191 $endpoint->display_message_box($error_message,$tpl,1); 192 } 180 193 181 194 echo $tpl->draw( 'advanced_settings_manual_upload' ); … … 422 435 case "settings": 423 436 default: 424 $message = "";425 437 if(isset($_REQUEST['button_update_globals'])) { 426 438 $_POST['srvip'] = trim($_POST['srvip']); #trim whitespace from IP address … … 444 456 $endpoint->db->query($sql); 445 457 } else { 446 $ message = "<h3><center><font color='red'>Directory Not Writable!</font></center></h3>";458 $endpoint->error['config_dir'] = "Directory Not Writable!"; 447 459 } 448 460 } else { 449 $ message = "<h3><center><font color='red'>Not a Vaild Directory</font></center></h3>";450 } 451 } else { 452 $ message = "<h3><center><font color='red'>No Configuration Location Defined!</font></center></h3>";461 $endpoint->error['config_dir'] = "Not a Vaild Directory"; 462 } 463 } else { 464 $endpoint->error['config_dir'] = "No Configuration Location Defined!"; 453 465 } 454 466 … … 499 511 $endpoint->db->query($sql); 500 512 501 $message .= " <h3><center>Updated!</center></h3>";513 $message .= "Updated!"; 502 514 } 503 515 //Because we are working with global variables we probably updated them, so lets refresh those variables … … 534 546 $tpl->assign("updates_selected", $updates_selected); 535 547 $tpl->assign("debug_selected", $debug_selected); 536 $tpl->assign("message", $message); 548 549 $error_message = NULL; 550 foreach($endpoint->error as $key => $error) { 551 $error_message .= $error; 552 if($endpoint->global_cfg['debug']) { 553 $error_message .= " Function: [".$key."]"; 554 } 555 $error_message .= "<br />"; 556 } 557 if(isset($message)) { 558 $endpoint->display_message_box($message,$tpl,0); 559 } 560 if(isset($error_message)) { 561 $endpoint->display_message_box($error_message,$tpl,1); 562 } 563 537 564 $tpl->assign("ip", $_SERVER["SERVER_ADDR"]); 538 565 $tpl->assign("srvip", $endpoint->global_cfg['srvip']); contributed_modules/modules/endpointman/includes/brand_model_manager.inc
r10227 r10233 13 13 //initialize a Rain TPL object 14 14 $tpl = new RainTPL( LOCAL_PATH.'templates' ); 15 $endpoint->error['brand_update_check'] = ""; 15 16 16 if((isset($_REQUEST['button_install'])) OR (isset($_REQUEST['button_update']))) { 17 17 if(isset($_REQUEST['brand'])) { … … 126 126 } 127 127 128 $tpl->assign("error", $error);129 128 $tpl->assign("web_var", "?type=$type"); 130 129 $tpl->assign("brand2_list", $row_out); 131 $tpl->assign("error", $endpoint->error['brand_update_check']); 130 131 $error_message = NULL; 132 foreach($endpoint->error as $key => $error) { 133 $error_message .= $error; 134 if($endpoint->global_cfg['debug']) { 135 $error_message .= " Function: [".$key."]"; 136 } 137 $error_message .= "<br />"; 138 } 139 if(isset($error_message)) { 140 $endpoint->display_message_box($error_message,$tpl,1); 141 } 132 142 133 143 //draw the template contributed_modules/modules/endpointman/includes/devices_manager.inc
r10227 r10233 10 10 //Set opened variables 11 11 $message = NULL; 12 $error_message = NULL; 13 14 12 15 $no_add = FALSE; 13 16 $final = NULL; … … 151 154 } elseif((isset($_REQUEST['button_update_phones'])) AND (isset($_REQUEST['selected']))) { 152 155 if(($_REQUEST['brand_list_selected'] > 0) AND ($_REQUEST['model_list_selected'] > 0)) { 153 154 156 foreach($_REQUEST['selected'] as $key => $data) { 155 157 $sql = "UPDATE endpointman_mac_list SET custom_cfg_data = '', custom_cfg_template = '', user_cfg_data = '', config_files_override = '', model = '".$_REQUEST['model_list_selected']."' WHERE id = ". $_REQUEST['selected'][$key]; … … 160 162 161 163 $message = _("Saved")."!"; 162 163 164 } 164 165 } else { … … 382 383 } 383 384 384 385 $tpl->assign("message", $message); 386 $tpl->assign("debug", $debug); 385 foreach($endpoint->error as $key => $error) { 386 $error_message .= $error; 387 if($endpoint->global_cfg['debug']) { 388 $error_message .= " Function: [".$key."]"; 389 } 390 $error_message .= "<br />"; 391 } 392 if(isset($error_message)) { 393 $endpoint->display_message_box($error_message,$tpl,1); 394 } 395 if(isset($message)) { 396 $endpoint->display_message_box($message,$tpl,0); 397 } 387 398 388 399 //draw the template contributed_modules/modules/endpointman/includes/functions.inc
r10231 r10233 51 51 //include the local template class 52 52 include LOCAL_PATH."includes/rain.tpl.class.php"; 53 } 54 55 function display_message_box($message, $tpl, $fatal_error=0) { 56 $tpl->assign("show_error_box", 1); 57 $tpl->assign("advanced_debug", $this->global_cfg['debug']); 58 $tpl->assign("fatal_error", $fatal_error); 59 $tpl->assign("error_message", $message); 53 60 } 54 61 … … 142 149 //You could screw up a phone if the mac_id is blank 143 150 if (!isset($mac_id)) { 144 die("Can't get phone info!"); 151 $this->error['get_phone_info'] = "Mac ID is not set"; 152 return(FALSE); 145 153 } 146 154 $sql = "SELECT id,mac,model FROM endpointman_mac_list WHERE model > 0 AND id =".$mac_id; … … 689 697 $temp = $this->xml2array(PHONE_MODULES_PATH."endpoint/".$row['directory']."/".$row['cfg_dir']."/family_data.xml"); 690 698 if($temp['data']['firmware_ver'] > $row['firmware_vers']) { 691 echo " Downloading firmware..";699 echo "<div style='float: left'>Downloading firmware...</div><div style='float: left' id=\"DivExample\">.</div>"; 692 700 $this->download_file_with_progress_bar(UPDATE_PATH.$row['directory']."/". $temp['data']['firmware_pkg'], PHONE_MODULES_PATH."temp/".$temp['data']['firmware_pkg']); 693 echo " Done!<br />";701 echo "<script type='text/javascript'>document.getElementById('DivExample').innerHTML='Done!';</script><br />"; 694 702 if(!file_exists(PHONE_MODULES_PATH."endpoint/".$row['directory']."/".$row['cfg_dir']."/firmware")) { 695 703 mkdir(PHONE_MODULES_PATH."endpoint/".$row['directory']."/".$row['cfg_dir']."/firmware"); … … 733 741 } else { 734 742 if(!file_exists(PHONE_MODULES_PATH.'/'.$directory)) { 735 mkdir(PHONE_MODULES_PATH.'/'.$directory );743 mkdir(PHONE_MODULES_PATH.'/'.$directory,0764); 736 744 } 737 745 $destination_file = PHONE_MODULES_PATH.'/'.$directory.'/brand_data.xml'; … … 749 757 } else { 750 758 rename($temp_file, $destination_file); 759 chmod($destination_file,0764); 751 760 return(TRUE); 752 761 } … … 760 769 $master_result = $this->download_xml(UPDATE_PATH . "master.xml"); 761 770 762 $message = "";763 771 764 772 if(!$master_result) { 765 $ message .= "Not able to connect to repository. Using local master file instead.";773 $this->error['brand_update_check_master'] = "Not able to connect to repository. Using local master file instead."; 766 774 } 767 775 … … 776 784 if(($data == "") OR ($data <= $endpoint_last_mod)) { 777 785 if((!$master_result) OR (!$this->download_file_no_progress_bar(UPDATE_PATH.'/'.$endpoint_package, PHONE_MODULES_PATH."temp/".$endpoint_package))) { 778 $ message .= "<br/>Not able to connect to repository. Using local Provisioner.net Package";786 $this->error['brand_update_check_xml'] = "<br/>Not able to connect to repository. Using local Provisioner.net Package"; 779 787 } else { 780 788 exec("tar -xvf ".PHONE_MODULES_PATH.'temp/'. $endpoint_package ." -C ".PHONE_MODULES_PATH."temp/"); … … 803 811 $result = $this->download_xml(UPDATE_PATH .$data['directory']."/".$data['directory'].".xml","endpoint/".$data['directory']); 804 812 if(!$result) { 805 $ message .= "<br/>Not able to connect to repository. Using local brand [".$data['name']."] file instead.";813 $this->error['brand_update_check'] = "<br/>Not able to connect to repository. Using local brand [".$data['name']."] file instead."; 806 814 } 807 815 … … 841 849 } 842 850 } else { 843 $ message .= "<br/>Error: No Local File for ".$data['name']."!";851 $this->error['brand_update_check_local_file'] = "<br/>Error: No Local File for ".$data['name']."!"; 844 852 } 845 853 } … … 863 871 } 864 872 } else { 865 $message .= "<br/>Aborting Brand Downloads. Can't Get Master File, Assuming Timeout Issues!"; 866 } 867 $this->error['brand_update_check'] = $message; 873 $this->error['brand_update_check_master_file'] = "<br/>Aborting Brand Downloads. Can't Get Master File, Assuming Timeout Issues!"; 874 } 868 875 869 876 return $out; … … 888 895 $package = $temp['data']['brands']['package']; 889 896 890 echo " Downloading Tarball.......";897 echo "<div style='float: left'>Downloading Brand Package...</div><div style='float: left' id=\"DivExample\">.</div>"; 891 898 $this->download_file_with_progress_bar(UPDATE_PATH.$row[0]['directory'].'/'.$package, PHONE_MODULES_PATH."temp/".$package); 892 echo " Done!<br />";893 899 echo "<script type='text/javascript'>document.getElementById('DivExample').innerHTML='Done!';</script><br />"; 900 894 901 echo "Extracting Tarball........"; 895 902 exec("tar -xvf ".PHONE_MODULES_PATH.'temp/'. $package ." -C ".PHONE_MODULES_PATH."temp/"); … … 905 912 $dir = str_replace(PHONE_MODULES_PATH."temp/".$row[0]['directory']."/", "", $file); 906 913 if(!file_exists(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir)) { 907 mkdir(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir );914 mkdir(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir,0764); 908 915 } 909 916 } else { … … 911 918 $dir = str_replace(PHONE_MODULES_PATH."temp/".$row[0]['directory']."/", "", $file); 912 919 rename($file, PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir); 920 chmod(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir,0764); 913 921 } 914 922 } … … 1008 1016 1009 1017 if($key === FALSE) { 1018 $this->error['sync_model'] = "Can't locate model in family XML file"; 1010 1019 return(FALSE); 1011 1020 } else { … … 1056 1065 1057 1066 if(empty($template_data_array)) { 1067 $this->error['sync_model'] = "No Template Data Found"; 1058 1068 return(FALSE); 1059 1069 } … … 1402 1412 //If the user just wishes to use the local arp cache they can tell the function to not use nmap 1403 1413 //This results in a speed increase from 60 seconds to less than one second. 1404 if (($use_nmap) AND ( $this->validate_netmask($netmask))) {1414 if (($use_nmap) AND (file_exists($this->global_cfg['nmap_location'])) AND ($this->validate_netmask($netmask))) { 1405 1415 shell_exec($this->global_cfg['nmap_location'].' -v -sP '. $netmask); 1406 1416 } elseif(!$this->validate_netmask($netmask)) { 1417 $this->error['discover_new'] = "Invalid Netmask"; 1407 1418 return(FALSE); 1419 } elseif(!file_exists($this->global_cfg['nmap_location'])) { 1420 $this->error['discover_new'] = "Could Not Find NMAP, Using ARP Only"; 1421 //return(FALSE); 1408 1422 } 1409 1423 //Get arp list … … 1426 1440 1427 1441 //Pull out the IP address from row. It's always the first entry in the row and it can only be a max of 15 characters with the delimiters 1428 $ip = trim(substr($value, 0, 15)); 1442 preg_match_all("/\((.*?)\)/",$value,$matches); 1443 $ip = $matches[1]; 1444 $ip = $ip[0]; 1429 1445 1430 1446 //Pull out the mac address by looking for the delimiter … … 1512 1528 1513 1529 if(!isset($temp)) { 1514 $this->error['modelsAvailable'] = " SQL Statement came out empty!";1530 $this->error['modelsAvailable'] = "You need to enable at least ONE model"; 1515 1531 return(FALSE); 1516 1532 } else { … … 1616 1632 } 1617 1633 1634 function endpointman_flush_buffers(){ 1635 ob_end_flush(); 1636 //ob_flush(); 1637 flush(); 1638 ob_start(); 1639 } 1640 1618 1641 function endpointman_update_progress_bar($out) { 1619 echo ".";1642 echo '<script type="text/javascript">document.getElementById(\'DivExample\').innerHTML="%'.$out.'";</script>'; 1620 1643 } 1621 1644 … … 1628 1651 $file_size = intval($regs[2]); 1629 1652 } 1630 ob_flush(); 1653 //ob_flush(); 1654 endpointman_flush_buffers(); 1631 1655 return $length; 1632 1656 } … … 1646 1670 if($fout) 1647 1671 fwrite($fout, $string); 1648 ob_flush(); 1672 //ob_flush(); 1673 endpointman_flush_buffers(); 1649 1674 return $length; 1650 1675 } 1651 ?>contributed_modules/modules/endpointman/includes/installer.php
r10227 r10233 10 10 11 11 $endpoint = new endpointmanager(); 12 13 echo "<html><head><title>Installer</title></head><body>"; 12 14 13 15 function out($text){ … … 193 195 } 194 196 195 echo "<hr>\n\t<a href=\"#\" onclick=\"parent.close_module_actions(true);\" style=\"text-decoration:none\" />"._("Return")."</a> ";197 echo "<hr>\n\t<a href=\"#\" onclick=\"parent.close_module_actions(true);\" style=\"text-decoration:none\" />"._("Return")."</a></body></html>"; contributed_modules/modules/endpointman/includes/template_manager.inc
r10227 r10233 8 8 */ 9 9 $message = NULL; 10 $error_message = NULL; 11 10 12 $no_add = FALSE; 11 13 $default_display = FALSE; … … 18 20 19 21 if((!$product_list) && (!$mac_list)) { 20 $message = _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some");21 $no_add = TRUE;22 $message = _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some"); 23 $no_add = TRUE; 22 24 } elseif(!$product_list) { 23 $message = "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations";24 $no_add = TRUE;25 $message = "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations"; 26 $no_add = TRUE; 25 27 } 26 28 27 29 if(isset($_REQUEST['edit_template'])) { 28 $endpoint->edit_template_display($_REQUEST['id'],$_REQUEST['custom']);30 $endpoint->edit_template_display($_REQUEST['id'],$_REQUEST['custom']); 29 31 } elseif(isset($_REQUEST['button_save'])) { 30 if(($_REQUEST['model_class'] == 0) OR (empty($_REQUEST['template_name'])) OR ($_REQUEST['model_clone'] == 0)) {31 $message = "No Valid Model/Template/Name Selected!";32 $default_display = TRUE;33 } else {34 $sql = "INSERT INTO endpointman_template_list (product_id, name, model_id) VALUES ('".$_REQUEST['model_class']."','".$_REQUEST['template_name']."','".$_REQUEST['model_clone']."')";35 $endpoint->db->query($sql);36 $sql = "SELECT id FROM endpointman_template_list WHERE product_id = '".$_REQUEST['model_class']."' AND name = '".$_REQUEST['template_name']."'";37 $id = $endpoint->db->getOne($sql);38 $endpoint->edit_template_display($id,0);39 }32 if(($_REQUEST['model_class'] == 0) OR (empty($_REQUEST['template_name'])) OR ($_REQUEST['model_clone'] == 0)) { 33 $message = "No Valid Model/Template/Name Selected!"; 34 $default_display = TRUE; 35 } else { 36 $sql = "INSERT INTO endpointman_template_list (product_id, name, model_id) VALUES ('".$_REQUEST['model_class']."','".$_REQUEST['template_name']."','".$_REQUEST['model_clone']."')"; 37 $endpoint->db->query($sql); 38 $sql = "SELECT id FROM endpointman_template_list WHERE product_id = '".$_REQUEST['model_class']."' AND name = '".$_REQUEST['template_name']."'"; 39 $id = $endpoint->db->getOne($sql); 40 $endpoint->edit_template_display($id,0); 41 } 40 42 } elseif(isset($_REQUEST['delete_template'])) { 41 $sql = "DELETE FROM endpointman_template_list WHERE id = ". $_REQUEST['id'];42 $endpoint->db->query($sql);43 $sql = "UPDATE endpointman_mac_list SET custom_cfg_template = 0 WHERE custom_cfg_template = ".$_REQUEST['id'];44 $endpoint->db->query($sql);45 $default_display = TRUE;46 $message = _('Deleted');43 $sql = "DELETE FROM endpointman_template_list WHERE id = ". $_REQUEST['id']; 44 $endpoint->db->query($sql); 45 $sql = "UPDATE endpointman_mac_list SET custom_cfg_template = 0 WHERE custom_cfg_template = ".$_REQUEST['id']; 46 $endpoint->db->query($sql); 47 $default_display = TRUE; 48 $message = _('Deleted'); 47 49 } elseif((isset($_REQUEST['button_save_template'])) AND (isset($_REQUEST['custom']))) { 48 $endpoint->save_template($_REQUEST['id'],$_REQUEST['custom'],$_REQUEST);49 $default_display = TRUE;50 $message = _('Saved');50 $endpoint->save_template($_REQUEST['id'],$_REQUEST['custom'],$_REQUEST); 51 $default_display = TRUE; 52 $message = _('Saved'); 51 53 } else { 52 $default_display = TRUE;54 $default_display = TRUE; 53 55 } 54 56 55 57 if($default_display) { 56 $sql = 'SELECT endpointman_template_list.*, endpointman_product_list.short_name as model_class, endpointman_model_list.model as model_clone, endpointman_model_list.enabled FROM endpointman_template_list, endpointman_model_list, endpointman_product_list WHERE endpointman_model_list.hidden = 0 AND endpointman_template_list.model_id = endpointman_model_list.id AND endpointman_template_list.product_id = endpointman_product_list.id';57 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC);58 $i = 0;59 $row_out = array();60 foreach($template_list as $row) {61 $row_out[$i] = $row;62 $row_out[$i]['custom'] = 0;63 if(!$row['enabled']) {64 $row_out[$i]['model_clone'] = $row_out[$i]['model_clone']."<i>(Disabled)</i>";65 }66 $i++;67 }58 $sql = 'SELECT endpointman_template_list.*, endpointman_product_list.short_name as model_class, endpointman_model_list.model as model_clone, endpointman_model_list.enabled FROM endpointman_template_list, endpointman_model_list, endpointman_product_list WHERE endpointman_model_list.hidden = 0 AND endpointman_template_list.model_id = endpointman_model_list.id AND endpointman_template_list.product_id = endpointman_product_list.id'; 59 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 60 $i = 0; 61 $row_out = array(); 62 foreach($template_list as $row) { 63 $row_out[$i] = $row; 64 $row_out[$i]['custom'] = 0; 65 if(!$row['enabled']) { 66 $row_out[$i]['model_clone'] = $row_out[$i]['model_clone']."<i>(Disabled)</i>"; 67 } 68 $i++; 69 } 68 70 69 $sql = 'SELECT endpointman_mac_list.id,endpointman_mac_list.mac,endpointman_mac_list.model,endpointman_mac_list.description, endpointman_model_list.model as model_clone, endpointman_product_list.short_name as model_class FROM endpointman_mac_list, endpointman_model_list, endpointman_product_list WHERE endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.custom_cfg_data IS NOT NULL AND endpointman_model_list.id = endpointman_mac_list.model AND endpointman_mac_list.custom_cfg_template = 0';70 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC);71 foreach($template_list as $row) {72 $row_out[$i] = $row;73 $row_out[$i]['custom'] = 1;74 $row_out[$i]['name'] = $row['mac'] . "-(" .$row['description'].")";75 $i++;76 }71 $sql = 'SELECT endpointman_mac_list.id,endpointman_mac_list.mac,endpointman_mac_list.model,endpointman_mac_list.description, endpointman_model_list.model as model_clone, endpointman_product_list.short_name as model_class FROM endpointman_mac_list, endpointman_model_list, endpointman_product_list WHERE endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.custom_cfg_data IS NOT NULL AND endpointman_model_list.id = endpointman_mac_list.model AND endpointman_mac_list.custom_cfg_template = 0'; 72 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 73 foreach($template_list as $row) { 74 $row_out[$i] = $row; 75 $row_out[$i]['custom'] = 1; 76 $row_out[$i]['name'] = $row['mac'] . "-(" .$row['description'].")"; 77 $i++; 78 } 77 79 78 $sql = "SELECT DISTINCT endpointman_product_list.* FROM endpointman_product_list, endpointman_model_list WHERE endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_model_list.hidden = 0 AND endpointman_model_list.enabled = 1 AND endpointman_product_list.hidden != 1 AND endpointman_product_list.cfg_dir != ''"; 79 80 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 81 $i = 1; 82 $class_row[0]['value'] = 0; 83 $class_row[0]['text'] = ""; 84 foreach($template_list as $row) { 85 $class_row[$i]['value'] = $row['id']; 86 $class_row[$i]['text'] = $row['short_name']; 87 $i++; 88 } 89 $tpl = new RainTPL( LOCAL_PATH.'templates' ); 90 $tpl->assign("amp_conf_serial", "1"); 91 $tpl->assign("templates_list", $row_out); 92 $tpl->assign("class_list", $class_row); 93 $tpl->assign("no_add", $no_add); 94 $tpl->assign("debug", $debug); 95 $tpl->assign("message", $message); 96 echo $tpl->draw( 'template_manager' ); 80 $sql = "SELECT DISTINCT endpointman_product_list.* FROM endpointman_product_list, endpointman_model_list WHERE endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_model_list.hidden = 0 AND endpointman_model_list.enabled = 1 AND endpointman_product_list.hidden != 1 AND endpointman_product_list.cfg_dir != ''"; 81 82 $template_list =& $db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 83 $i = 1; 84 $class_row[0]['value'] = 0; 85 $class_row[0]['text'] = ""; 86 foreach($template_list as $row) { 87 $class_row[$i]['value'] = $row['id']; 88 $class_row[$i]['text'] = $row['short_name']; 89 $i++; 90 } 91 $tpl = new RainTPL( LOCAL_PATH.'templates' ); 92 $tpl->assign("amp_conf_serial", "1"); 93 $tpl->assign("templates_list", $row_out); 94 $tpl->assign("class_list", $class_row); 95 $tpl->assign("no_add", $no_add); 96 $tpl->assign("debug", $debug); 97 98 foreach($endpoint->error as $key => $error) { 99 $error_message .= $error; 100 if($endpoint->global_cfg['debug']) { 101 $error_message .= " Function: [".$key."]"; 102 } 103 $error_message .= "<br />"; 104 } 105 if(isset($error_message)) { 106 $endpoint->display_message_box($error_message,$tpl,1); 107 } 108 if(isset($message)) { 109 $endpoint->display_message_box($message,$tpl,0); 110 } 111 112 echo $tpl->draw( 'template_manager' ); 97 113 } contributed_modules/modules/endpointman/install.php
r10229 r10233 93 93 } 94 94 95 $version = "2.2. 5";95 $version = "2.2.6"; 96 96 97 97 if(ep_table_exists("endpointman_global_vars")) { … … 135 135 } elseif($global_cfg['version'] == '2.2.4') { 136 136 $ver = "2.2.4"; 137 } elseif($global_cfg['version'] == '2.2.5') { 138 $ver = "2.2.5"; 139 } elseif($global_cfg['version'] == '2.2.6') { 140 $ver = "2.2.6"; 137 141 } else { 138 142 $ver = "1000"; … … 764 768 765 769 if ($ver <= "2.2.4") { 766 }767 768 if ($ver <= "2.2.5") {769 770 out("Fix Debug Left on Error, this turns off debug."); 770 771 $sql = 'UPDATE `asterisk`.`endpointman_global_vars` SET `value` = \'1\' WHERE `endpointman_global_vars`.`idnum` = 9 LIMIT 1;'; 771 772 $db->query($sql); 772 773 } 773 } 774 775 if ($ver <= "2.2.5") { 776 out("Fixing Permissions of Phone Modules Directory"); 777 $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PHONE_MODULES_PATH), RecursiveIteratorIterator::SELF_FIRST); 778 foreach($iterator as $item) { 779 chmod($item, 0764); 780 } 781 782 out("Creating Endpoint Version Row"); 783 $sql = 'INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, \'endpoint_vers\', \'\');'; 784 $db->query($sql); 785 } 786 787 774 788 775 789 if ($new_install) { contributed_modules/modules/endpointman/module.xml
r10232 r10233 2 2 <rawname>endpointman</rawname> 3 3 <name>PBX End Point Manager</name> 4 <version>2.2. 5</version>4 <version>2.2.6</version> 5 5 <type>tool</type> 6 6 <category>End Point Manager</category> … … 15 15 <description>PBX End Point Manager supports automated deployment of multiple manufacturers IP telephones.</description> 16 16 <changelog> 17 *2.2.6* Fixed download progress so that it displays. 17 18 *2.2.5* Fixed Debug Always on Error & File download errors & Fix float error on install 18 19 </changelog> 19 20 <info>http://projects.colsolgrp.net/projects/show/endpointman</info> 20 <location>contributed_modules/release/endpointman-2. 2.5.tgz</location>21 <location>contributed_modules/release/endpointman-2.0.0.tgz</location> 21 22 22 <md5sum> 4b5eb8e4a5fa023256d7b83f2d3e8408</md5sum>23 <md5sum>b1341a35ef60d0fad17348803a0a7833</md5sum> 23 24 </module> contributed_modules/modules/endpointman/templates/advanced_settings_manual_upload.html
r10220 r10233 1 <center><h3>{$message}</h3></center> 1 {if condition="isset($show_error_box)"} 2 {include="message_box"} 3 {/if} 2 4 {if condition="isset($show_installer)"} 3 5 <script> contributed_modules/modules/endpointman/templates/advanced_settings_settings.html
r10218 r10233 1 <h3>{$message}</h3> 1 {if condition="isset($show_error_box)"} 2 {include="message_box"} 3 {/if} 2 4 <form action='config.php{$web_vars}&display=epm_advanced&subpage=settings' method='POST'> 3 5 <table width='90%' align='center'> contributed_modules/modules/endpointman/templates/brand_model_manager.html
r10227 r10233 1 1 {include="global_header"} 2 {if condition="isset($show_error_box)"} 3 {include="message_box"} 4 {/if} 2 5 <style type="text/css"> 3 6 <!-- … … 19 22 --> 20 23 </style> 21 <h3 align='center'><font color='red'>{$error}</font></h3>22 24 <center> 23 25 <form action='config.php{$web_var}&display=epm_config' method='POST'> contributed_modules/modules/endpointman/templates/devices_manager.html
r10227 r10233 1 1 {include="global_header"} 2 {if condition="isset($show_error_box)"} 3 {include="message_box"} 4 {/if} 2 5 <h2 align='center'>{$error}</h2> 3 6 {if condition="isset($id)"} … … 6 9 <br> 7 10 <center> 8 {if condition="isset($message)"}9 <h3 align='center'>{$message}</h3>10 {/if}11 11 {if condition="$no_add == FALSE"} 12 12 <form action='config.php{$web_var}&display=epm_devices' method='POST'> … … 112 112 <tr> 113 113 <td align='center' width='5px'><input type="checkbox" name="add[]" value="{$value.id}"></td> 114 <td align='center' width='11%'>{$value.mac_strip}< /td>114 <td align='center' width='11%'>{$value.mac_strip}<br />({$value.ip})</td> 115 115 <td width="13%" align='center'>{$value.brand}</td> 116 116 <td width="25%" align='center'> contributed_modules/modules/endpointman/templates/global_footer.html
r10227 r10233 2 2 <h6 align='center'>The Endpoint Configuration Manager is currently maintained by <a target="_blank" href=http://www.andrewsnagy.com/>Andrew Nagy</a> 3 3 <br/><?=_("The Endpoint Configuration Manager was originally written by")?> <a target="_blank" href=http://www.mymcs.us>Ed Macri</a>, <a target="_blank" href=http://www.cohutta.com> John Mullinix.</a> and <a target="_blank" href=http://www.colsolgrp.com>Tony Shiffer</a> 4 <br/>Endpoint Configuration Manager uses code from the MPL licensed project Provisioner.net at <a href="http:// https://www.assembla.com/code/provisioner/git/nodes?rev=master">https://www.assembla.com/code/provisioner/git/nodes?rev=master</a> co-written by Darren Schreiber & Andrew Nagy4 <br/>Endpoint Configuration Manager uses code from the MPL licensed project Provisioner.net at <a href="http://www.assembla.com/code/provisioner/git/nodes?rev=master">http://www.assembla.com/code/provisioner/git/nodes?rev=master</a> co-written by Darren Schreiber & Andrew Nagy 5 5 <br> <?=_("The project is maintained at")?> 6 6 <a target="_blank" href="http://projects.colsolgrp.net/projects/show/endpointman"> CSG Software Projects.</a> contributed_modules/modules/endpointman/templates/template_editor.html
r10227 r10233 18 18 {else} 19 19 {if condition="$custom != 0"} 20 <?=_('a custom config template for extension')?> {$ext}, <?=_('Model')?>: {$model} 20 <strong><?=_('Template Name')?>:</strong> <i>Custom Template: Extension {$ext}</i><br /> 21 <strong><?=_('Product Line')?>:</strong> {$product}<br /> 22 <strong><?=_('Clone of Model')?>:</strong> {$model} 21 23 {/if} 22 24 {if condition="$custom == 0"} … … 41 43 <br /> 42 44 <?=_('You can also use certain variables in your configs')?>:<br />{noparse} 43 -"{$srvip}" = <?=_('Server IP')?><br /> 45 -"{$server.ip.1}" = <?=_('Server 1 IP')?><br /> 46 -"{$server.port.1}" = <?=_('Server 1 Port')?><br /> 44 47 -"{$mac}" = <?=_('Device\'s Mac Address')?><br /> 45 -"{$ext}" = <?=_('Device\'s Default Extension (Line 1 or Master)')?><br /> 46 -"{$diplayname}" = <?=_('Device\'s Description in FreePBX (Usually the Full Name)')?><br />{/noparse} 48 -"{$model}" = <?=_('Device\'s Model')?><br /> 49 -"{$ext.line.1}" = <?=_('Device\'s Default Extension (Line 1 or Master)')?><br /> 50 -"{$displayname.line.1}" = <?=_('Device\'s Description in FreePBX (Usually the Full Name)')?><br />{/noparse} 47 51 <br /> 48 52 {/if} contributed_modules/modules/endpointman/templates/template_manager.html
r10227 r10233 1 1 {include="global_header"} 2 <h3><center>{$message}</center></h3> 2 {if condition="isset($show_error_box)"} 3 {include="message_box"} 4 {/if} 3 5 {if condition="$no_add == FALSE"} 4 6 <center>
