Example #1
0
 public function __construct()
 {
     $this->dbhost = get_dbhost();
     $this->dbuser = get_dbuser();
     $this->dbpw = get_dbpw();
     $this->dbname = get_dbname();
     $this->dbsocket = get_dbsocket();
     $this->dbport = get_dbport();
     $this->etuliite = get_etuliite();
     mb_internal_encoding('UTF-8');
     mb_http_output('UTF-8');
     mb_http_input('UTF-8');
     if (empty($this->dbsocket)) {
         $this->local_db = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpw) or die;
         mysqli_select_db($this->local_db, $this->dbname) or die;
     } else {
         $this->local_db = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpw, $this->dbname, $this->dbport, $this->dbsocket) or die;
     }
 }
Example #2
0
 case "Aastra6837i":
 case "Aastra6865i":
 case "Aastra6867i":
 case "Aastra6869i":
     $model = str_replace("Aastra5", "Aastra675", $model);
     if (stristr($file, "aastra.cfg")) {
         if (function_exists("get_aastra_cfg")) {
             $host = get_dbhost($hosts);
         }
         $sag = new Sag($host, $dbport);
         get_aastra_cfg($mac);
     } else {
         if (preg_match("/^00085D/i", $mac)) {
             global $debug;
             $debug['aastra/mswitch'][] = "(aastra) OK model={$model} file={$file}";
             $host = get_dbhost($hosts);
             $sag = new Sag($host, $dbport);
             if (preg_match("/^00085D/", $mac) && filemtime("/tmp/phone-" . $mac) <= time() - 6) {
                 touch("/tmp/phone-" . strtoupper($mac));
                 $phone_data = get_phone_data($mac, $qpass, $nonepass);
                 if ($phone_data == false) {
                     exit;
                 }
                 $phone_data['device'] = strtolower($model);
                 // Upgrade Firmware if customers.firmwareupgrade is on (is not supported now)
                 //                    if(DEBUG_FUNCTION != 'all' && DEBUG_FUNCTION != 'aastra' && $phone_data['firmwareupdate'] == '1') check_firmware($phone_type);
                 //                    else {global $debug; $debug['aastra/prov'][] = "(aastra) firmwareupdate is not supported from phone firmwareupdate=".$phone_data['firmwareupdate'];}
                 // Upgrade Firmware if customers.firmwareupgrade is on
                 if (DEBUG_FUNCTION != 'all' && DEBUG_FUNCTION != 'aastra' || $phone_data['prov'][0]['mac'] == true) {
                     get_provisioning($phone_data);
                     global $debug;