Source of file FacebookLoginForm.php
Size: 1,581 Bytes - Last Modified: 2021-12-23T10:59:39+00:00
/var/www/docs.ssmods.com/process/src/code/forms/FacebookLoginForm.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | <?php /** * Return a Facebook Login Form for the website. * * @package facebookconnect */ class FacebookLoginForm extends MemberLoginForm { protected $authenticator_class = 'FacebookAuthenticator'; public function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true) { if ($checkCurrentUser && Member::currentUser() && Member::logged_in_session_exists()) { $fields = new FieldList( new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this) ); $actions = new FieldList( new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")) ); } else { $permissions = Config::inst()->get( 'FacebookControllerExtension', 'permissions' ); $fields = new FieldList( new LiteralField('FacebookLoginIn', "<fb:login-button scope='". implode(',', $permissions) ."'></fb:login-button>") ); $actions = new FieldList( new LiteralField('FacebookLoginLink', "<!-- <a href='".$controller->getFacebookLoginLink() ."'>". _t('FacebookLoginForm.LOGIN', 'Login') ."</a> -->") ); } $backURL = (isset($_REQUEST['BackURL'])) ? $_REQUEST['BackURL'] : Session::get('BackURL'); if (isset($backURL)) { $fields->push(new HiddenField('BackURL', 'BackURL', $backURL)); } return parent::__construct($controller, $name, $fields, $actions); } } |