php - How to manage Facebook connect in Drupal multisite? -
i have drupal multisite installation. not common multisite installation. long story short: have 1 single database, 1 single setting.php , change of theme managed according site domain module themekey. drupal installation makes 2 sites working different themes , managed have them 2 different domains using apache server alias, have 2 sites www.foo.com , www.bar.com.
now i'm managing facebook registration module fboauth allows enter 1 facebook app id. in first site, let's www.foo.com, facebook registration works connected facebook app fboauth knows about. in second site, www.bar.com, registration doesn't work facebook allows me add, single facebook app, one domain (or subdomain of it, that's not case). mean, in facebook app can enter www.foo.com, not www.bar.com, if try register www.bar.com facebook throws 'domain not allowed' error.
i think correct way deal opening second facebook app www.bar.com, fbaouth allows me enter 1 app id. how can overcome this?
edit: there 2 variables fboauth_id , fboauth_secret. overriding these solves problem, can't in setting.php, there's way?
raw solution: solved problem, modifying fboauth module code. created 2 functions: 1 returning app id, returning app secret, depending on domain i'm in. substituted every "variable_get('fboauth_id', '')" , "variable_get('fboauth_secret', '')" in module files customized functions. not elegant, , i'm still interested in better solutions.
function fboauth_get_app_id_depending_on_domain(){ $server_name = ($_server['server_name']); $server_uri =($_server['request_uri']); if($server_name=='www.bar.com'){ $app_id='1234567890'; }else{ $app_id=variable_get('fboauth_id', ''); } return $app_id; } function fboauth_get_app_secret_depending_on_domain(){ $server_name = ($_server['server_name']); $server_uri =($_server['request_uri']); if($server_name=='www.bar.com'){ $app_secret='1234567890'; }else{ $app_secret=variable_get('fboauth_secret', ''); } return $app_secret; }
Comments
Post a Comment