Exemplo n.º 1
0
 public static function update($conditions, $newdata)
 {
     if (!is_array($conditions)) {
         $conditions = array('id' => $conditions);
     }
     return update_records(get_called_class(), $conditions, $newdata);
 }
Exemplo n.º 2
0
         update_records($zone, $old_record, $records);
         # remove from old list
         update_records($zone, $record, $newRecords);
         # add to new list
     } else {
         array_push($records, $record);
         update_records($zone, $record, $records);
     }
     $record['id'] = json_encode($record);
     jtable_respond($record, 'single');
     break;
 case "deleterecord":
     $zone = get_zone_by_url(isset($_GET['zoneurl']) ? $_GET['zoneurl'] : '');
     $old_record = decode_record_id(isset($_POST['id']) ? $_POST['id'] : '');
     $records = get_records_except($zone, $old_record);
     update_records($zone, $old_record, $records);
     jtable_respond(null, 'delete');
     break;
 case "export":
     $zone = $_GET['zone'];
     $export = api_request("/servers/{$apisid}/zones/{$zone}/export");
     jtable_respond($export, 'single');
     break;
 case "gettemplatenameservers":
     $ret = array();
     $type = $_GET['prisec'];
     foreach (user_template_list() as $template) {
         if ($template['name'] !== $_GET['template']) {
             continue;
         }
         $rc = 0;