本文整理汇总了PHP中SpamModel::disabled方法的典型用法代码示例。如果您正苦于以下问题:PHP SpamModel::disabled方法的具体用法?PHP SpamModel::disabled怎么用?PHP SpamModel::disabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpamModel
的用法示例。
在下文中一共展示了SpamModel::disabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: base_connectData_handler
/**
* Inject into the process of the base connection.
*
* @param Gdn_Controller $sender.
* @param Gdn_Controller $args.
*/
public function base_connectData_handler($sender, $args)
{
if (val(0, $args) != $this->getProviderKey()) {
return;
}
// Retrieve the profile that was saved to the session in the entry controller.
$savedProfile = Gdn::session()->stash($this->getProviderKey(), '', false);
if (Gdn::session()->stash($this->getProviderKey(), '', false)) {
$this->log('Base Connect Data Profile Saved in Session', ['profile' => $savedProfile]);
}
$profile = val('Profile', $savedProfile);
$accessToken = val('AccessToken', $savedProfile);
trace($profile, 'Profile');
trace($accessToken, 'Access Token');
/* @var Gdn_Form $form */
$form = $sender->Form;
//new Gdn_Form();
// Create a form and populate it with values from the profile.
$originaFormValues = $form->formValues();
$formValues = array_replace($originaFormValues, $profile);
$form->formValues($formValues);
trace($formValues, 'Form Values');
// Save some original data in the attributes of the connection for later API calls.
$attributes = [];
$attributes[$this->getProviderKey()] = ['AccessToken' => $accessToken, 'Profile' => $profile];
$form->setFormValue('Attributes', $attributes);
$sender->EventArguments['Profile'] = $profile;
$sender->EventArguments['Form'] = $form;
$this->log('Base Connect Data Before OAuth Event', ['profile' => $profile, 'form' => $form]);
// Throw an event so that other plugins can add/remove stuff from the basic sso.
$sender->fireEvent('OAuth');
SpamModel::disabled(true);
$sender->setData('Trusted', true);
$sender->setData('Verified', true);
}