Ejemplo n.º 1
0
 function prepare_for_generateconfig()
 {
     //Mitel likes lower case letters in its mac address
     $this->mac = strtoupper($this->mac);
     $this->options['model'] = $this->model;
     parent::prepare_for_generateconfig();
 }
Ejemplo n.º 2
0
 function prepare_for_generateconfig()
 {
     //Traphone likes upper case letters in its mac address
     $this->mac = strtoupper($this->mac);
     parent::prepare_for_generateconfig();
     $this->config_file_replacements['$mac'] = strtoupper($this->mac);
     $this->config_file_replacements['$model'] = strtoupper($this->model);
 }
Ejemplo n.º 3
0
 function prepare_for_generateconfig()
 {
     //To upper case letters
     $this->mac = strtoupper($this->mac);
     parent::prepare_for_generateconfig();
     $this->config_file_replacements['$mac'] = strtoupper($this->mac);
     $this->config_file_replacements['$model'] = strtoupper($this->model);
 }
Ejemplo n.º 4
0
 function generate_file($file, $extradata, $ignoredynamicmapping = FALSE)
 {
     $data = parent::generate_file($file, $extradata, $ignoredynamicmapping);
     if ($ignoredynamicmapping == FALSE) {
         $data = array_values($this->create_encrypted_file(array($this->mac . ".cfg" => $data)));
         $data = $data[0];
     }
     return $data;
 }
Ejemplo n.º 5
0
 function generate_file($file, $extradata, $ignoredynamicmapping = FALSE, $prepare = FALSE)
 {
     if (isset($this->settings['server_fqdn']) && $this->settings['server_fqdn'] != '') {
         $this->settings['line'][0]['server_host'] = $this->settings['server_fqdn'];
         $this->settings['line'][1]['server_host'] = $this->settings['server_fqdn'];
     }
     $data = parent::generate_file($file, $extradata, $ignoredynamicmapping);
     return $data;
 }
Ejemplo n.º 6
0
 function prepare_for_generateconfig()
 {
     //spa likes lower case letters in its mac address
     $this->mac = strtoupper($this->mac);
     if (isset($this->settings['image_name']) && $this->settings['image_name'] != '' && strpos("loadInformation", $this->settings['image_name']) === FALSE) {
         $this->settings['image_name'] = '<loadInformation>' . $this->settings['image_name'] . '</loadInformation>';
     }
     parent::prepare_for_generateconfig();
     $this->config_file_replacements['$mac'] = strtolower($this->mac);
     $this->config_file_replacements['$model'] = str_replace('SPA', 'spa', strtoupper($this->model));
 }
Ejemplo n.º 7
0
 function prepare_for_generateconfig()
 {
     parent::prepare_for_generateconfig();
     preg_match('/.*(-|\\+)(\\d*):(\\d*)/i', $this->timezone['timezone'], $matches);
     switch ($matches[3]) {
         case '30':
             $point = '.5';
             break;
         default:
             $point = '';
             break;
     }
     $this->timezone['timezone'] = $matches[1] . $matches[2] . $point;
 }
Ejemplo n.º 8
0
 function prepare_for_generateconfig()
 {
     parent::prepare_for_generateconfig();
     $this->mac = strtoupper($this->mac);
     if (!isset($this->settings["vlan"]) or $this->settings["vlan"] === "") {
         $this->settings["vlan"] = "0";
     }
     if (isset($this->DateTimeZone)) {
         $transitions = $this->DateTimeZone->getTransitions();
         // Find the last 2 transitions before (1 year from now).
         // 5 day extra window just in case.
         // this can either be the next two, or the last one (very recent) and the next one.
         while (count($transitions) > 1 && $transitions[2]['ts'] < time() + 360 * 24 * 60 * 60) {
             array_shift($transitions);
         }
         if (count($transitions) == 1) {
             $options['dstoffset'] = '';
             // no more transitions - are there no transitions at all for this timezone (E.g. GMT)?
         } else {
             if ($transitions[0]['isdst']) {
                 $summer = 0;
                 $winter = 1;
             } else {
                 $summer = 1;
                 $winter = 0;
             }
         }
         $this->timezone['gmtoffset'] = $transitions[$summer]['offset'];
         $dst = $transitions[$summer]['offset'] - $transitions[$winter]['offset'];
         // Have to calculate as gmt, because otherwise DST would throw it off - the time the clocks change never
         // happens; the instant we get there, the clocks have moved.
         $summerstart = gmdate("d.m H:i:s", $transitions[$summer]['ts'] + $this->timezone['gmtoffset'] - $dst);
         $summerend = gmdate("d.m H:i:s", $transitions[$winter]['ts'] + $this->timezone['gmtoffset']);
         $this->settings['dstrule'] = "{$dst} {$summerstart} {$summerend}";
     }
 }
Ejemplo n.º 9
0
 function prepare_for_generateconfig()
 {
     $this->mac = strtoupper($this->mac);
     parent::prepare_for_generateconfig();
 }
Ejemplo n.º 10
0
 function __construct()
 {
     self::$root_dir = dirname(dirname(__FILE__)) . "/";
     $this->root_dir = self::$root_dir;
     $this->modules_path = self::$modules_path;
 }