Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | if ($ex instanceof PhabricatorPolicyException) { | ||||
$auth_app_class = 'PhabricatorAuthApplication'; | $auth_app_class = 'PhabricatorAuthApplication'; | ||||
$auth_app = PhabricatorApplication::getByClass($auth_app_class); | $auth_app = PhabricatorApplication::getByClass($auth_app_class); | ||||
$login_controller->setCurrentApplication($auth_app); | $login_controller->setCurrentApplication($auth_app); | ||||
return $login_controller->handleRequest($request); | return $login_controller->handleRequest($request); | ||||
} | } | ||||
$content = array( | |||||
phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'aphront-policy-rejection', | |||||
), | |||||
$ex->getRejection()), | |||||
); | |||||
if ($ex->getCapabilityName()) { | |||||
$list = $ex->getMoreInfo(); | $list = $ex->getMoreInfo(); | ||||
foreach ($list as $key => $item) { | foreach ($list as $key => $item) { | ||||
$list[$key] = phutil_tag('li', array(), $item); | $list[$key] = phutil_tag('li', array(), $item); | ||||
} | } | ||||
if ($list) { | if ($list) { | ||||
$list = phutil_tag('ul', array(), $list); | $list = phutil_tag('ul', array(), $list); | ||||
} | } | ||||
$content = array( | $content[] = phutil_tag( | ||||
phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'aphront-policy-rejection', | |||||
), | |||||
$ex->getRejection()), | |||||
phutil_tag( | |||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'aphront-capability-details', | 'class' => 'aphront-capability-details', | ||||
), | ), | ||||
pht('Users with the "%s" capability:', $ex->getCapabilityName())), | pht('Users with the "%s" capability:', $ex->getCapabilityName())); | ||||
$list, | |||||
); | |||||
$dialog = new AphrontDialogView(); | $content[] = $list; | ||||
$dialog | } | ||||
$dialog = id(new AphrontDialogView()) | |||||
->setTitle($ex->getTitle()) | ->setTitle($ex->getTitle()) | ||||
->setClass('aphront-access-dialog') | ->setClass('aphront-access-dialog') | ||||
->setUser($user) | ->setUser($user) | ||||
->appendChild($content); | ->appendChild($content); | ||||
if ($this->getRequest()->isAjax()) { | if ($this->getRequest()->isAjax()) { | ||||
$dialog->addCancelButton('/', pht('Close')); | $dialog->addCancelButton('/', pht('Close')); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |