Osclass forums
Support forums => Plugins => Facebook Connect => Topic started by: amoric69 on April 03, 2014, 12:01:58 pm
-
Hello,
Is it possible to redirect user after his facebook connection ?
Or make appear a button loggin, somebody can help me the write the code ?
<?php if ( osc_fbc_login == true()) { ?>
<button>Redirection</button>
;
<?php if( osc_price_enabled_at_items() ) { ?>
<div class="control-group" style="margin-top:12px;margin-bottom:12px;">
<label class="control-label" for="price"><?php _e('Price', 'bender'); ?></label>
<div class="controls">
<?php ItemForm::price_input_text(); ?>
<?php ItemForm::currency_select(); ?>
</div>
</div>
<?php } ?>
-
Something like it...
somebody can help me ?
-
I am looking to do the same.. I think you gotta change base.facebook.php in the plugin folder
/**
* Get a Login URL for use with redirects. By default, full page redirect is
* assumed. If you are using the generated URL with a window.open() call in
* JavaScript, you can pass in display=popup as part of the $params.
*
* The parameters:
* - redirect_uri: the url to go to after a successful login
* - scope: comma separated list of requested extended perms
*
* @param array $params Provide custom parameters
* @return string The URL for the login flow
*/
public function getLoginUrl($params=array()) {
$this->establishCSRFTokenState();
$currentUrl = $this->getCurrentUrl();
// if 'scope' is passed as an array, convert to comma separated list
$scopeParams = isset($params['scope']) ? $params['scope'] : null;
if ($scopeParams && is_array($scopeParams)) {
$params['scope'] = implode(',', $scopeParams);
}
return $this->getUrl(
'www',
'dialog/oauth',
array_merge(array(
'client_id' => $this->getAppId(),
'redirect_uri' => $currentUrl, // possibly overwritten
'state' => $this->state),
$params));
}
/**
* Get a Logout URL suitable for use with redirects.
*
* The parameters:
* - next: the url to go to after a successful logout
*
* @param array $params Provide custom parameters
* @return string The URL for the logout flow
*/
public function getLogoutUrl($params=array()) {
return $this->getUrl(
'www',
'logout.php',
array_merge(array(
'next' => $this->getCurrentUrl(),
'access_token' => $this->getUserAccessToken(),
), $params)
);
}
-
found this work around in the forum
http://forums.osclass.org/plugins/facebook-connect-redirect-after-login/msg48158/#msg48158 (http://forums.osclass.org/plugins/facebook-connect-redirect-after-login/msg48158/#msg48158)
-
I try it :
return $this->getUrl(
'www',
'dialog/oauth',
array_merge(array(
'client_id' => $this->getAppId(),
'redirect_uri' => $currentUrl('http://www.mywebsite.com/home-page/' (http://www.mywebsite.com/home-page/')), // possibly overwritten
'state' => $this->state),
$params));
}
but, it does'nt run too
why ?
-
try this one, it works http://forums.osclass.org/plugins/facebook-connect-redirect-after-login/msg48158/#msg48158 (http://forums.osclass.org/plugins/facebook-connect-redirect-after-login/msg48158/#msg48158)