diff -urpN og_contact4/og_contact.install og_contact/og_contact.install --- og_contact4/og_contact.install 2009-03-12 06:34:20.000000000 +0100 +++ og_contact/og_contact.install 2009-06-12 11:28:47.272400000 +0200 @@ -43,13 +43,13 @@ function og_contact_update_3() { $ret[] = update_sql("ALTER TABLE {og_contact} ADD grouprecipients text NULL DEFAULT NULL"); $ret[] = update_sql("ALTER TABLE {og_contact} ADD info text NULL DEFAULT NULL"); $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN recipients text NULL DEFAULT NULL"); - $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN reply text NULL DEFAULT NULL)"); + $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN reply text NULL DEFAULT NULL"); break; case 'pgsql': $ret[] = update_sql("ALTER TABLE {og_contact} ADD COLUMN grouprecipients text NULL default ''"); $ret[] = update_sql("ALTER TABLE {og_contact} ADD COLUMN info text NULL default ''"); $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN recipients text NULL DEFAULT NULL"); - $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN reply text NULL DEFAULT NULL)"); + $ret[] = update_sql("ALTER TABLE {og_contact} MODIFY COLUMN reply text NULL DEFAULT NULL"); break; } } diff -urpN og_contact4/og_contact.module og_contact/og_contact.module --- og_contact4/og_contact.module 2009-03-12 06:34:20.000000000 +0100 +++ og_contact/og_contact.module 2009-06-12 11:24:59.621000000 +0200 @@ -157,7 +157,7 @@ function og_contact_admin_add($gid = NUL $form['not_public'] = array( '#type' => 'checkbox', '#title' => t('Only allow group members to access contact form.'), - '#default_value' => variable_get('not_public', 0), + '#default_value' => variable_get('og_contact_group_not_public', 0), '#description' => t('This allows you to restrict contact form submissions only to members of this group.'), ); $form['no_admin'] = array( @@ -239,10 +239,11 @@ function og_contact_admin_edit() { $form['group'] = array('#type' => 'hidden', '#value' => $gid, ); + $form['not_public'] = array( '#type' => 'checkbox', '#title' => t('Only allow group members to access contact form.'), - '#default_value' => variable_get('not_public', 0), + '#default_value' => $edit['notpublic'], '#description' => t('This allows you to restrict contact form submissions only to members of this group.'), ); $form['no_admin'] = array( @@ -304,7 +305,7 @@ function og_contact_admin_edit_validate( function og_contact_admin_edit_submit($form_id, $form_values) { $name = og_contact_get_group_name($form_values['group']); drupal_set_title('Edit '.$name.'\'s Contact'); - db_query("UPDATE {og_contact} SET reply = '%s', noadmin = %d, recipients = '%s' WHERE gid = %d", $form_values['reply'], $form_values['no_admin'], $form_values['recipients'], $form_values['group']); + db_query("UPDATE {og_contact} SET reply = '%s', noadmin = %d, recipients = '%s', notpublic = %d WHERE gid = %d", $form_values['reply'], $form_values['no_admin'], $form_values['recipients'], $form_values['not_public'], $form_values['group']); drupal_set_message(t('Contact form for %group has been updated.', array('%group' => $name))); watchdog('mail', t('OG Contact: Form for %group updated.', array('%group' => $name)), WATCHDOG_NOTICE, l(t('view'), 'admin/og/contact')); if ($form_values['return'] == 'admin') { @@ -689,7 +690,7 @@ function og_contact_admin_add_all_submit //Check if group doesn't already have a contact form if (!og_contact_group_has_form($gid->nid)) { //It doesn't, so add it to the og_contact table - db_query('INSERT INTO {og_contact} (gid, reply) VALUES ("%d","%s")', $gid->nid, ""); + db_query('INSERT INTO {og_contact} (gid, reply, notpublic) VALUES ("%d","%s",%d)', $gid->nid, "", variable_get('og_contact_group_not_public',0)); $alteredno++; } $grpno++;