person; $_roles= $_person['role_ids']; // if no id: add, else: display(update) if( !$_GET['id'] ) { if( $_POST['submitted'] ) { // get person's site id $site_id= $_person['site_ids'][0]; // build dict $fields= array( 'protocol'=>$_POST['protocol'], 'hostname'=>$_POST['hostname'], 'model'=>$_POST['model'], 'username'=>$_POST['username'], 'password'=>$_POST['password'], 'notes'=>$_POST['notes'], 'ip'=>$_POST['ip'] ); $pcu_id= $api->AddPCU( $site_id, $fields ); if( $pcu_id != 0 ) { // xxx is l_pcu defined & effective ? plc_redirect( l_pcu($pcu_id)); exit(); } else { $error= $api->error(); } } if( !empty( $error ) ) echo '