예제 #1
0
 function saveConfig()
 {
     // sanitize submitted data
     configtools::sanitize(TRUE);
     // build the driver-specific DSN string
     $dsn = configtools::buildDSN(TRUE);
     // test
     $this->fw['POST.new.test'] = configtools::testConfig($dsn);
     // build final DSN strings
     $this->fw['POST.new.dsn.5'] = $dsn[5] . ";charset=" . $this->fw['POST.new.charset'];
     //save data and return to form
     $this->fw->dbCFG->write('config.json', $this->fw['POST.new']);
     $this->fw->reroute('config');
 }
예제 #2
0
 function saveConfig()
 {
     // sanitize submitted data
     configtools::sanitize();
     if (isset($this->fw['POST.new.db5.same_user'])) {
         $this->fw['POST.new.db5.user'] = $this->fw['POST.new.db3.user'];
         $this->fw['POST.new.db5.pass'] = $this->fw['POST.new.db3.pass'];
     }
     if (isset($this->fw['POST.new.db5.same_server'])) {
         $this->fw['POST.new.db5.host'] = $this->fw['POST.new.db3.host'];
         $this->fw['POST.new.db5.port'] = $this->fw['POST.new.db3.port'];
     }
     // build the driver-specific DSN string
     $dsn = configtools::buildDSN();
     // test
     $this->fw['POST.new.test'] = configtools::testConfig($dsn);
     // build final DSN strings
     $this->fw['POST.new.db3.dsn'] = $dsn['db3'] . ";charset=" . $this->fw['POST.new.db3.charset'];
     $this->fw['POST.new.db5.dsn'] = $dsn['db5'] . ";charset=" . $this->fw['POST.new.db5.charset'];
     //save data and return to form
     $this->fw->dbCFG->write('config.json', $this->fw['POST.new']);
     $this->fw->reroute('config');
 }