本文整理汇总了PHP中Gdn_AuthenticationProviderModel::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_AuthenticationProviderModel::save方法的具体用法?PHP Gdn_AuthenticationProviderModel::save怎么用?PHP Gdn_AuthenticationProviderModel::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_AuthenticationProviderModel
的用法示例。
在下文中一共展示了Gdn_AuthenticationProviderModel::save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: structure
/**
* Create the structure in the database.
*/
public function structure()
{
// Make sure we have the OAuth2 provider.
$provider = $this->provider();
if (!val('AuthenticationKey', $provider)) {
$model = new Gdn_AuthenticationProviderModel();
$provider = ['AuthenticationKey' => $this->providerKey, 'AuthenticationSchemeAlias' => $this->providerKey, 'Name' => $this->providerKey, 'AcceptedScope' => 'profile', 'ProfileKeyEmail' => 'email', 'ProfileKeyPhoto' => 'picture', 'ProfileKeyName' => 'displayname', 'ProfileKeyFullName' => 'name', 'ProfileKeyUniqueID' => 'user_id'];
$model->save($provider);
}
}
示例2: socialController_googlePlus_create
/**
*
*
* @param $Sender
* @param $Args
*/
public function socialController_googlePlus_create($Sender, $Args)
{
$Sender->permission('Garden.Settings.Manage');
$Conf = new ConfigurationModule($Sender);
$Conf->initialize(array('Plugins.GooglePlus.ClientID' => array('LabelCode' => 'Client ID'), 'Plugins.GooglePlus.Secret' => array('LabelCode' => 'Client secret'), 'Plugins.GooglePlus.SocialReactions' => array('Control' => 'checkbox', 'Default' => true), 'Plugins.GooglePlus.SocialSharing' => array('Control' => 'checkbox', 'Default' => true), 'Plugins.GooglePlus.UseAvatars' => array('Control' => 'checkbox', 'Default' => true), 'Plugins.GooglePlus.Default' => array('Control' => 'checkbox', 'LabelCode' => 'Make this connection your default signin method.')));
if (Gdn::request()->isAuthenticatedPostBack()) {
$Model = new Gdn_AuthenticationProviderModel();
$Model->save(array('AuthenticationKey' => self::ProviderKey, 'IsDefault' => c('Plugins.GooglePlus.Default')));
}
$Sender->addSideMenu('dashboard/social');
$Sender->setData('Title', sprintf(t('%s Settings'), 'Google+'));
$Sender->ConfigurationModule = $Conf;
$Sender->render('Settings', '', 'plugins/GooglePlus');
}