I wanted to use a name, other than the my site name, for the Disqus drop down box to select my SSO option. I also wanted to send the user to a different url other than the default user/login because our drupal site is using CAS for our company SSO and the default login wasn't working for Disqus. So, I created a patch that makes these two SSO options configurable. I don't know if it's of interest to any one else but I thought I'd make an attempt at contributing.

Comments

sassafrass’s picture

StatusFileSize
new2.48 KB
slashrsm’s picture

Version: 7.x-1.10 » 8.x-1.x-dev
Status: Active » Needs work

Thanks! Since we already have Drupal 8 version we first need to get this into D8 and then we can commit to D7 also.

  1. +++ b/disqus.module
    @@ -986,12 +986,16 @@ function disqus_sso_disqus_settings($account = NULL) {
    -    'name' => variable_get('site_name', t('Drupal')),
    -    // The login window must be closed once the user logs in.
    -    'url' => url('user/login', array('query' => array('destination' => 'disqus/closewindow'), 'absolute' => TRUE)),
    +
    +    'name' => variable_get('disqus_sso_label', t('Drupal')),
    +    'url' => url($sso_login_link, array('query' => array('destination' => $sso_login_return))),
         // The logout link must redirect back to the original page.
    

    I'd use something like:

    variable_get('disqus_sso_label', variable_get('site_name', t('Drupal')));

  2. +++ b/disqus.module
    @@ -986,12 +986,16 @@ function disqus_sso_disqus_settings($account = NULL) {
    -    'logout' => url('user/logout', array('query' => array('destination' => $_GET['q']), 'absolute' => TRUE)),
    +    'logout' => url($base_url.'/user/logout', array('query' => array('destination' => $_GET['q']))),
         'width' => 800,
    

    $base_url is not needed. url() takes care of that.

damienmckenna’s picture

Assigned: sassafrass » Unassigned
gaurav.kapoor’s picture

Status: Needs work » Closed (outdated)

Well, thanks for working on the Disqus module and contributing. Not very sure regarding we should work on this issue more and push this to the module, so I will be closing this issue for now.