Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

DPSBridge module for Drupal and Domain Access Module

Wladimir
Level 1
Level 1

Hello,

we want to use a single instance of Drupal and Domain Access Module for multiple domains. Each domain will be related to a DPS 2015 project.

We couldn't get DPSBridge Module from DPCI to work with multiple domains.

Do anybody have used like that? What do you suggest as an alternative solution?

Wladimir

1 Accepted Solution
GennadyK
Correct answer by
Level 2
Level 2

> We couldn't get DPSBridge Module from DPCI to work with multiple domains.

Hi Vladimir,

Not sure if you still need this, but this shouldn't be very hard. You just need to check in the DPSBridge's code what website's node you are saving and have multiple ifelses for the credentials values, that belong to the different DPS accounts:

- check domain to which the node is published;

- set credentials to different accounts based on the domain using ifelses inside includes/dpsbridge.next.util.inc:

    // generate an array with global credentials values

    $client_id =  variable_get(DPSNextConfig::VARIABLE_CLIENT_ID, DPSNextConfig::CLIENT_ID);

    $client_secret = variable_get(DPSNextConfig::VARIABLE_CLIENT_SECRET, DPSNextConfig::CLIENT_SECRET);

    $device_id = isset($variables['device_token']) ? $variables['device_token'] : self::getDeviceId();

    $device_token = isset($variables['device_token']) ? $variables['device_token'] : self::getDeviceToken();

    $access_token = isset($variables['access_token']) ? $variables['access_token'] : self::getAccessToken();

Regards,

Gennady

View solution in original post

1 Reply
GennadyK
Correct answer by
Level 2
Level 2

> We couldn't get DPSBridge Module from DPCI to work with multiple domains.

Hi Vladimir,

Not sure if you still need this, but this shouldn't be very hard. You just need to check in the DPSBridge's code what website's node you are saving and have multiple ifelses for the credentials values, that belong to the different DPS accounts:

- check domain to which the node is published;

- set credentials to different accounts based on the domain using ifelses inside includes/dpsbridge.next.util.inc:

    // generate an array with global credentials values

    $client_id =  variable_get(DPSNextConfig::VARIABLE_CLIENT_ID, DPSNextConfig::CLIENT_ID);

    $client_secret = variable_get(DPSNextConfig::VARIABLE_CLIENT_SECRET, DPSNextConfig::CLIENT_SECRET);

    $device_id = isset($variables['device_token']) ? $variables['device_token'] : self::getDeviceId();

    $device_token = isset($variables['device_token']) ? $variables['device_token'] : self::getDeviceToken();

    $access_token = isset($variables['access_token']) ? $variables['access_token'] : self::getAccessToken();

Regards,

Gennady

View solution in original post