X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=mkdru.module;h=e7541ab664746e6118fde799cf1e3e8daafd9b36;hb=89996d58c6ef47fdba1944a4d4c6fde026f07d63;hp=cb20ab013ffccae21640a0d6f70fee571fd62b44;hpb=66f3bea850ee445427da4ec46e18d4374dd3e953;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.module b/mkdru.module index cb20ab0..e7541ab 100644 --- a/mkdru.module +++ b/mkdru.module @@ -117,6 +117,22 @@ function mkdru_form(&$node, $form_state) { '#required' => TRUE, '#default_value' => isset($node->mkdru->pz2_path) ? $node->mkdru->pz2_path : '/pazpar2/search.pz2', ); + $form['search_settings']['sp_user'] = array( + '#type' => 'textfield', + '#title' => t('Service Proxy username (optional)'), + '#description' => t('Service-Proxy username'), + '#required' => FALSE, + '#default_value' => isset($node->mkdru->sp_user) ? + $node->mkdru->sp_user : '', + ); + $form['search_settings']['sp_pass'] = array( + '#type' => 'textfield', + '#title' => t('Service Proxy password (optional)'), + '#description' => t('Service-Proxy password'), + '#required' => FALSE, + '#default_value' => isset($node->mkdru->sp_pass) ? + $node->mkdru->sp_pass : '', + ); $form['search_settings']['use_sessions'] = array( '#type' => 'checkbox', '#title' => t('Session handling'), @@ -177,8 +193,9 @@ function mkdru_validate($node) { * Implementation of hook_insert(). */ function mkdru_insert($node) { - db_query("INSERT INTO {mkdru} (nid, vid, pz2_path, use_sessions, source_max, author_max, subject_max) VALUES (%d, %d, '%s', %d, %d, %d, %d)", - $node->nid, $node->vid, $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max); + db_query("INSERT INTO {mkdru} (nid, vid, pz2_path, use_sessions, source_max, author_max, subject_max, sp_user, sp_pass) ". + "VALUES (%d, %d, '%s', %d, %d, %d, %d, '%s', '%s')", + $node->nid, $node->vid, $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->sp_user, $node->sp_pass); } /** @@ -190,7 +207,7 @@ function mkdru_update($node) { mkdru_insert($node); } else { - db_query("UPDATE {mkdru} SET pz2_path = '%s', use_sessions = %d, source_max = %d, author_max = %d, subject_max = %d WHERE vid = %d", $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->vid); + db_query("UPDATE {mkdru} SET pz2_path = '%s', use_sessions = %d, source_max = %d, author_max = %d, subject_max = %d, sp_user = '%s', sp_pass = '%s' WHERE vid = %d", $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->vid); } }