Commit b735ccbc authored by Rob Loach's avatar Rob Loach
Browse files

Issue #976312 by alexkb: Allow disabling inheriting the Drupal username/email.

parent b0106f09
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -76,6 +76,12 @@ function disqus_admin_settings() {
    '#description' => t("When enabled, overrides the language set by Disqus with the language provided by the site."),
    '#default_value' => variable_get('disqus_localization', FALSE),
  );
  $form['behavior']['disqus_inherit_login'] = array(
    '#type' => 'checkbox',
    '#title' => t('Inherit User Credentials'),
    '#description' => t("When enabled and a user is logged in, the Disqus 'Post as Guest' login form will be pre-filled with the user's name and email address."),
    '#default_value' => variable_get('disqus_inherit_login', TRUE),
  );
  $form['behavior']['disqus_developer'] = array(
    '#type' => 'checkbox',
    '#title' => t('Testing'),
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ function disqus_element_post_render($children, &$element) {

  // If the user is logged in, we can inject the username and email for Disqus.
  global $user;
  if ($user->uid > 0) {
  if (variable_get('disqus_inherit_login', TRUE) && $user->uid > 0) {
    $disqus['name'] = $user->name;
    $disqus['email'] = $user->mail;
  }