mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +01:00
Update Auth for new UI
Summary: [WIP] Tossing this up for safety and to read through it. Need to test, update some of the other flows. This updates everything in Auth for new UI and modern conventions. Test Plan: Loooots of random testing, new providers, edit providers, logging out, forgot password... more coming. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15550
This commit is contained in:
parent
2386705873
commit
6bbba1e315
17 changed files with 156 additions and 153 deletions
|
@ -66,15 +66,12 @@ final class PhabricatorAuthConfirmLinkController
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Confirm Link'), $panel_uri);
|
$crumbs->addTextCrumb(pht('Confirm Link'), $panel_uri);
|
||||||
$crumbs->addTextCrumb($provider->getProviderName());
|
$crumbs->addTextCrumb($provider->getProviderName());
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
array(
|
->setTitle(pht('Confirm External Account Link'))
|
||||||
$crumbs,
|
->setCrumbs($crumbs)
|
||||||
$dialog,
|
->appendChild($dialog);
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Confirm External Account Link'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,9 @@ abstract class PhabricatorAuthController extends PhabricatorController {
|
||||||
$view->setTitle($title);
|
$view->setTitle($title);
|
||||||
$view->setErrors($messages);
|
$view->setErrors($messages);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
$view,
|
->setTitle($title)
|
||||||
array(
|
->appendChild($view);
|
||||||
'title' => $title,
|
|
||||||
));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,15 +116,12 @@ final class PhabricatorAuthLinkController
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Link Account'), $panel_uri);
|
$crumbs->addTextCrumb(pht('Link Account'), $panel_uri);
|
||||||
$crumbs->addTextCrumb($provider->getProviderName($name));
|
$crumbs->addTextCrumb($provider->getProviderName($name));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
array(
|
->setTitle($title)
|
||||||
$crumbs,
|
->setCrumbs($crumbs)
|
||||||
$form,
|
->appendChild($form);
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => $title,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,6 @@ final class PhabricatorAuthLoginController
|
||||||
$content) {
|
$content) {
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->setBorder(true);
|
|
||||||
|
|
||||||
if ($this->getRequest()->getUser()->isLoggedIn()) {
|
if ($this->getRequest()->getUser()->isLoggedIn()) {
|
||||||
$crumbs->addTextCrumb(pht('Link Account'), $provider->getSettingsURI());
|
$crumbs->addTextCrumb(pht('Link Account'), $provider->getSettingsURI());
|
||||||
|
@ -245,15 +244,12 @@ final class PhabricatorAuthLoginController
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs->addTextCrumb($provider->getProviderName());
|
$crumbs->addTextCrumb($provider->getProviderName());
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
array(
|
->setTitle(pht('Login'))
|
||||||
$crumbs,
|
->setCrumbs($crumbs)
|
||||||
$content,
|
->appendChild($content);
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Login'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildProviderErrorResponse(
|
public function buildProviderErrorResponse(
|
||||||
|
|
|
@ -28,11 +28,10 @@ final class PhabricatorAuthNeedsApprovalController
|
||||||
->appendChild($wait_for_approval)
|
->appendChild($wait_for_approval)
|
||||||
->addCancelButton('/', pht('Wait Patiently'));
|
->addCancelButton('/', pht('Wait Patiently'));
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
$dialog,
|
->setTitle(pht('Wait For Approval'))
|
||||||
array(
|
->appendChild($dialog);
|
||||||
'title' => pht('Wait For Approval'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,15 +76,16 @@ final class PhabricatorAuthNeedsMultiFactorController
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$view = array(
|
||||||
array(
|
$help,
|
||||||
$crumbs,
|
$panel,
|
||||||
$help,
|
);
|
||||||
$panel,
|
|
||||||
),
|
return $this->newPage()
|
||||||
array(
|
->setTitle(pht('Add Multi-Factor Authentication'))
|
||||||
'title' => pht('Add Multi-Factor Authentication'),
|
->setCrumbs($crumbs)
|
||||||
));
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -497,6 +497,7 @@ final class PhabricatorAuthRegisterController
|
||||||
$crumbs->addTextCrumb($provider->getProviderName());
|
$crumbs->addTextCrumb($provider->getProviderName());
|
||||||
$title = pht('Phabricator Registration');
|
$title = pht('Phabricator Registration');
|
||||||
}
|
}
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$welcome_view = null;
|
$welcome_view = null;
|
||||||
if ($is_setup) {
|
if ($is_setup) {
|
||||||
|
@ -511,7 +512,6 @@ final class PhabricatorAuthRegisterController
|
||||||
}
|
}
|
||||||
|
|
||||||
$object_box = id(new PHUIObjectBoxView())
|
$object_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($title)
|
|
||||||
->setForm($form)
|
->setForm($form)
|
||||||
->setFormErrors($errors);
|
->setFormErrors($errors);
|
||||||
|
|
||||||
|
@ -520,16 +520,21 @@ final class PhabricatorAuthRegisterController
|
||||||
$invite_header = $this->renderInviteHeader($invite);
|
$invite_header = $this->renderInviteHeader($invite);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$header = id(new PHUIHeaderView())
|
||||||
array(
|
->setHeader($title);
|
||||||
$crumbs,
|
|
||||||
$welcome_view,
|
$view = id(new PHUITwoColumnView())
|
||||||
$invite_header,
|
->setHeader($header)
|
||||||
$object_box,
|
->setFooter(array(
|
||||||
),
|
$welcome_view,
|
||||||
array(
|
$invite_header,
|
||||||
'title' => $title,
|
$object_box,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadDefaultAccount() {
|
private function loadDefaultAccount() {
|
||||||
|
|
|
@ -189,16 +189,17 @@ final class PhabricatorAuthStartController
|
||||||
$crumbs->addTextCrumb(pht('Login'));
|
$crumbs->addTextCrumb(pht('Login'));
|
||||||
$crumbs->setBorder(true);
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$title = pht('Login to Phabricator');
|
||||||
array(
|
$view = array(
|
||||||
$crumbs,
|
$header,
|
||||||
$header,
|
$invite_message,
|
||||||
$invite_message,
|
$out,
|
||||||
$out,
|
);
|
||||||
),
|
|
||||||
array(
|
return $this->newPage()
|
||||||
'title' => pht('Login to Phabricator'),
|
->setTitle($title)
|
||||||
));
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ final class PhabricatorDisabledUserController
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
return id(new AphrontDialogView())
|
return $this->newDialog()
|
||||||
->setUser($viewer)
|
|
||||||
->setTitle(pht('Account Disabled'))
|
->setTitle(pht('Account Disabled'))
|
||||||
->addCancelButton('/logout/', pht('Okay'))
|
->addCancelButton('/logout/', pht('Okay'))
|
||||||
->appendParagraph(pht('Your account has been disabled.'));
|
->appendParagraph(pht('Your account has been disabled.'));
|
||||||
|
|
|
@ -144,6 +144,7 @@ final class PhabricatorEmailLoginController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Reset Password'));
|
$crumbs->addTextCrumb(pht('Reset Password'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$dialog = new AphrontDialogView();
|
$dialog = new AphrontDialogView();
|
||||||
$dialog->setUser($request->getUser());
|
$dialog->setUser($request->getUser());
|
||||||
|
@ -152,14 +153,11 @@ final class PhabricatorEmailLoginController
|
||||||
$dialog->addSubmitButton(pht('Send Email'));
|
$dialog->addSubmitButton(pht('Send Email'));
|
||||||
$dialog->setSubmitURI('/login/email/');
|
$dialog->setSubmitURI('/login/email/');
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->newPage()
|
||||||
array(
|
->setTitle(pht('Forgot Password'))
|
||||||
$crumbs,
|
->setCrumbs($crumbs)
|
||||||
$dialog,
|
->appendChild($dialog);
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Forgot Password'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,15 +77,13 @@ final class PhabricatorEmailVerificationController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Verify Email'));
|
$crumbs->addTextCrumb(pht('Verify Email'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle(pht('Verify Email'))
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($dialog);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
|
||||||
array(
|
|
||||||
$crumbs,
|
|
||||||
$dialog,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Verify Email'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,14 +56,11 @@ final class PhabricatorLogoutController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($viewer->getPHID()) {
|
if ($viewer->getPHID()) {
|
||||||
$dialog = id(new AphrontDialogView())
|
return $this->newDialog()
|
||||||
->setUser($viewer)
|
|
||||||
->setTitle(pht('Log out of Phabricator?'))
|
->setTitle(pht('Log out of Phabricator?'))
|
||||||
->appendChild(pht('Are you sure you want to log out?'))
|
->appendChild(pht('Are you sure you want to log out?'))
|
||||||
->addSubmitButton(pht('Logout'))
|
->addSubmitButton(pht('Logout'))
|
||||||
->addCancelButton('/');
|
->addCancelButton('/');
|
||||||
|
|
||||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return id(new AphrontRedirectResponse())->setURI('/');
|
return id(new AphrontRedirectResponse())->setURI('/');
|
||||||
|
|
|
@ -53,14 +53,15 @@ final class PhabricatorMustVerifyEmailController
|
||||||
->appendParagraph($send_again)
|
->appendParagraph($send_again)
|
||||||
->addSubmitButton(pht('Send Another Email'));
|
->addSubmitButton(pht('Send Another Email'));
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$view = array(
|
||||||
array(
|
$sent,
|
||||||
$sent,
|
$dialog,
|
||||||
$dialog,
|
);
|
||||||
),
|
|
||||||
array(
|
return $this->newPage()
|
||||||
'title' => pht('Must Verify Email'),
|
->setTitle(pht('Must Verify Email'))
|
||||||
));
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,15 +176,33 @@ final class PhabricatorAuthEditController
|
||||||
$button = pht('Add Provider');
|
$button = pht('Add Provider');
|
||||||
}
|
}
|
||||||
$crumb = pht('Add Provider');
|
$crumb = pht('Add Provider');
|
||||||
$title = pht('Add Authentication Provider');
|
$title = pht('Add Auth Provider');
|
||||||
|
$header_icon = 'fa-plus-square';
|
||||||
$cancel_uri = $this->getApplicationURI('/config/new/');
|
$cancel_uri = $this->getApplicationURI('/config/new/');
|
||||||
} else {
|
} else {
|
||||||
$button = pht('Save');
|
$button = pht('Save');
|
||||||
$crumb = pht('Edit Provider');
|
$crumb = pht('Edit Provider');
|
||||||
$title = pht('Edit Authentication Provider');
|
$title = pht('Edit Auth Provider');
|
||||||
|
$header_icon = 'fa-pencil';
|
||||||
$cancel_uri = $this->getApplicationURI();
|
$cancel_uri = $this->getApplicationURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader(pht('%s: %s', $title, $provider->getProviderName()))
|
||||||
|
->setHeaderIcon($header_icon);
|
||||||
|
|
||||||
|
if ($config->getIsEnabled()) {
|
||||||
|
$status_name = pht('Enabled');
|
||||||
|
$status_color = 'green';
|
||||||
|
$status_icon = 'fa-check';
|
||||||
|
$header->setStatus($status_icon, $status_color, $status_name);
|
||||||
|
} else if (!$is_new) {
|
||||||
|
$status_name = pht('Disabled');
|
||||||
|
$status_color = 'indigo';
|
||||||
|
$status_icon = 'fa-ban';
|
||||||
|
$header->setStatus($status_icon, $status_color, $status_name);
|
||||||
|
}
|
||||||
|
|
||||||
$config_name = 'auth.email-domains';
|
$config_name = 'auth.email-domains';
|
||||||
$config_href = '/config/edit/'.$config_name.'/';
|
$config_href = '/config/edit/'.$config_name.'/';
|
||||||
|
|
||||||
|
@ -253,32 +271,8 @@ final class PhabricatorAuthEditController
|
||||||
'Phabricator will automatically login with this provider if it is '.
|
'Phabricator will automatically login with this provider if it is '.
|
||||||
'the only available provider.'));
|
'the only available provider.'));
|
||||||
|
|
||||||
$status_tag = id(new PHUITagView())
|
|
||||||
->setType(PHUITagView::TYPE_STATE);
|
|
||||||
if ($is_new) {
|
|
||||||
$status_tag
|
|
||||||
->setName(pht('New Provider'))
|
|
||||||
->setBackgroundColor('blue');
|
|
||||||
} else if ($config->getIsEnabled()) {
|
|
||||||
$status_tag
|
|
||||||
->setName(pht('Enabled'))
|
|
||||||
->setBackgroundColor('green');
|
|
||||||
} else {
|
|
||||||
$status_tag
|
|
||||||
->setName(pht('Disabled'))
|
|
||||||
->setBackgroundColor('red');
|
|
||||||
}
|
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormStaticControl())
|
|
||||||
->setLabel(pht('Provider'))
|
|
||||||
->setValue($provider->getProviderName()))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormStaticControl())
|
|
||||||
->setLabel(pht('Status'))
|
|
||||||
->setValue($status_tag))
|
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCheckboxControl())
|
id(new AphrontFormCheckboxControl())
|
||||||
->setLabel(pht('Allow'))
|
->setLabel(pht('Allow'))
|
||||||
|
@ -348,6 +342,7 @@ final class PhabricatorAuthEditController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb($crumb);
|
$crumbs->addTextCrumb($crumb);
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$timeline = null;
|
$timeline = null;
|
||||||
if (!$is_new) {
|
if (!$is_new) {
|
||||||
|
@ -358,23 +353,28 @@ final class PhabricatorAuthEditController
|
||||||
foreach ($xactions as $xaction) {
|
foreach ($xactions as $xaction) {
|
||||||
$xaction->setProvider($provider);
|
$xaction->setProvider($provider);
|
||||||
}
|
}
|
||||||
|
$timeline->setShouldTerminate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$form_box = id(new PHUIObjectBoxView())
|
$form_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($title)
|
->setHeaderText(pht('Provider'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$view = id(new PHUITwoColumnView())
|
||||||
array(
|
->setHeader($header)
|
||||||
$crumbs,
|
->setFooter(array(
|
||||||
$form_box,
|
$form_box,
|
||||||
$footer,
|
$footer,
|
||||||
$timeline,
|
$timeline,
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => $title,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
final class PhabricatorAuthListController
|
final class PhabricatorAuthListController
|
||||||
extends PhabricatorAuthProviderConfigController {
|
extends PhabricatorAuthProviderConfigController {
|
||||||
|
|
||||||
public function processRequest() {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
$viewer = $this->getViewer();
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
$configs = id(new PhabricatorAuthProviderConfigQuery())
|
$configs = id(new PhabricatorAuthProviderConfigQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
|
@ -93,6 +92,7 @@ final class PhabricatorAuthListController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Auth Providers'));
|
$crumbs->addTextCrumb(pht('Auth Providers'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$domains_key = 'auth.email-domains';
|
$domains_key = 'auth.email-domains';
|
||||||
$domains_link = $this->renderConfigLink($domains_key);
|
$domains_link = $this->renderConfigLink($domains_key);
|
||||||
|
@ -155,24 +155,29 @@ final class PhabricatorAuthListController
|
||||||
->setDisabled(!$can_manage)
|
->setDisabled(!$can_manage)
|
||||||
->setText(pht('Add Provider'));
|
->setText(pht('Add Provider'));
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
|
||||||
->setHeader(pht('Authentication Providers'))
|
|
||||||
->addActionLink($button);
|
|
||||||
|
|
||||||
$list->setFlush(true);
|
$list->setFlush(true);
|
||||||
$list = id(new PHUIObjectBoxView())
|
$list = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeaderText(pht('Providers'))
|
||||||
->setInfoView($warning)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($list);
|
->appendChild($list);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$title = pht('Auth Providers');
|
||||||
array(
|
$header = id(new PHUIHeaderView())
|
||||||
$crumbs,
|
->setHeader($title)
|
||||||
|
->setHeaderIcon('fa-key')
|
||||||
|
->addActionLink($button);
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
|
$warning,
|
||||||
$list,
|
$list,
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Authentication Providers'),
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderConfigLink($key) {
|
private function renderConfigLink($key) {
|
||||||
|
|
|
@ -80,21 +80,32 @@ final class PhabricatorAuthNewController
|
||||||
->setValue(pht('Continue')));
|
->setValue(pht('Continue')));
|
||||||
|
|
||||||
$form_box = id(new PHUIObjectBoxView())
|
$form_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Add Authentication Provider'))
|
->setHeaderText(pht('Provider'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Add Provider'));
|
$crumbs->addTextCrumb(pht('Add Provider'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$title = pht('Add Auth Provider');
|
||||||
array(
|
|
||||||
$crumbs,
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader($title)
|
||||||
|
->setHeaderIcon('fa-plus-square');
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
$form_box,
|
$form_box,
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Add Authentication Provider'),
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ final class PhabricatorAuthProviderConfigTransaction
|
||||||
switch ($this->getTransactionType()) {
|
switch ($this->getTransactionType()) {
|
||||||
case self::TYPE_ENABLE:
|
case self::TYPE_ENABLE:
|
||||||
if ($new) {
|
if ($new) {
|
||||||
return 'fa-play';
|
return 'fa-check';
|
||||||
} else {
|
} else {
|
||||||
return 'fa-pause';
|
return 'fa-ban';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ final class PhabricatorAuthProviderConfigTransaction
|
||||||
if ($new) {
|
if ($new) {
|
||||||
return 'green';
|
return 'green';
|
||||||
} else {
|
} else {
|
||||||
return 'red';
|
return 'indigo';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue