Differential D20659 Diff 49281 src/applications/auth/controller/config/PhabricatorAuthEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/config/PhabricatorAuthEditController.php
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
} | } | ||||
if (!strlen($config->getProviderDomain())) { | if (!strlen($config->getProviderDomain())) { | ||||
$config->setProviderDomain($provider->getProviderDomain()); | $config->setProviderDomain($provider->getProviderDomain()); | ||||
} | } | ||||
} | } | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_LOGIN) | PhabricatorAuthConfigLoginTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('allowLogin', 0)); | ->setNewValue($request->getInt('allowLogin', 0)); | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_REGISTRATION) | PhabricatorAuthConfigRegistrationTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('allowRegistration', 0)); | ->setNewValue($request->getInt('allowRegistration', 0)); | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_LINK) | PhabricatorAuthConfigLinkTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('allowLink', 0)); | ->setNewValue($request->getInt('allowLink', 0)); | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_UNLINK) | PhabricatorAuthConfigUnlinkTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('allowUnlink', 0)); | ->setNewValue($request->getInt('allowUnlink', 0)); | ||||
if ($provider->shouldAllowEmailTrustConfiguration()) { | |||||
amckinley: This is also new. | |||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_TRUST_EMAILS) | PhabricatorAuthConfigTrustEmailsTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('trustEmails', 0)); | ->setNewValue($request->getInt('trustEmails', 0)); | ||||
} | |||||
if ($provider->supportsAutoLogin()) { | if ($provider->supportsAutoLogin()) { | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_AUTO_LOGIN) | PhabricatorAuthConfigAutoLoginTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($request->getInt('autoLogin', 0)); | ->setNewValue($request->getInt('autoLogin', 0)); | ||||
} | } | ||||
foreach ($properties as $key => $value) { | foreach ($properties as $key => $value) { | ||||
$xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | $xactions[] = id(new PhabricatorAuthProviderConfigTransaction()) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorAuthProviderConfigTransaction::TYPE_PROPERTY) | PhabricatorAuthConfigPropertyTransaction::TRANSACTIONTYPE) | ||||
->setMetadataValue('auth:property', $key) | ->setMetadataValue('auth:property', $key) | ||||
->setNewValue($value); | ->setNewValue($value); | ||||
} | } | ||||
if ($is_new) { | if ($is_new) { | ||||
$config->save(); | $config->save(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |
This is also new.