@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Start fleshing out PhabricatorAuthProviderViewController

Summary:
Ref D20645. Start making this view a little more useful:

{F6573605}

Test Plan: Mk. 1 eyeball

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D20646

+80
+80
src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php
··· 114 114 pht('Provider Type'), 115 115 $config->getProvider()->getProviderName()); 116 116 117 + $status = $this->buildStatus($config); 118 + $view->addProperty(pht('Status'), $status); 119 + 117 120 return $view; 118 121 } 122 + 123 + private function buildStatus(PhabricatorAuthProviderConfig $config) { 124 + $viewer = $this->getViewer(); 125 + $view = id(new PHUIStatusListView()) 126 + ->setViewer($viewer); 127 + 128 + $icon_enabled = PHUIStatusItemView::ICON_ACCEPT; 129 + $icon_disabled = PHUIStatusItemView::ICON_REJECT; 130 + 131 + $icon_map = array( 132 + true => $icon_enabled, 133 + false => $icon_disabled, 134 + ); 135 + 136 + $color_map = array( 137 + true => 'green', 138 + false => 'red', 139 + ); 140 + 141 + $provider = $config->getProvider(); 142 + 143 + $view->addItem( 144 + id(new PHUIStatusItemView()) 145 + ->setIcon( 146 + $icon_map[$config->getIsEnabled()], 147 + $color_map[$config->getIsEnabled()]) 148 + ->setTarget(pht('Provider Enabled'))); 149 + 150 + $view->addItem( 151 + id(new PHUIStatusItemView()) 152 + ->setIcon( 153 + $icon_map[$config->getShouldAllowLogin()], 154 + $color_map[$config->getShouldAllowLogin()]) 155 + ->setTarget(pht('Allow Logins'))); 156 + 157 + $view->addItem( 158 + id(new PHUIStatusItemView()) 159 + ->setIcon( 160 + $icon_map[$config->getShouldAllowRegistration()], 161 + $color_map[$config->getShouldAllowRegistration()]) 162 + ->setTarget(pht('Allow Registration'))); 163 + 164 + $view->addItem( 165 + id(new PHUIStatusItemView()) 166 + ->setIcon( 167 + $icon_map[$config->getShouldAllowLink()], 168 + $color_map[$config->getShouldAllowLink()]) 169 + ->setTarget(pht('Allow Account Linking'))); 170 + 171 + $view->addItem( 172 + id(new PHUIStatusItemView()) 173 + ->setIcon( 174 + $icon_map[$config->getShouldAllowUnlink()], 175 + $color_map[$config->getShouldAllowUnlink()]) 176 + ->setTarget(pht('Allow Account Unlinking'))); 177 + 178 + if ($provider->shouldAllowEmailTrustConfiguration()) { 179 + $view->addItem( 180 + id(new PHUIStatusItemView()) 181 + ->setIcon( 182 + $icon_map[$config->getShouldTrustEmails()], 183 + $color_map[$config->getShouldTrustEmails()]) 184 + ->setTarget(pht('Trust Email Addresses'))); 185 + } 186 + 187 + if ($provider->supportsAutoLogin()) { 188 + $view->addItem( 189 + id(new PHUIStatusItemView()) 190 + ->setIcon( 191 + $icon_map[$config->getShouldAutoLogin()], 192 + $color_map[$config->getShouldAutoLogin()]) 193 + ->setTarget(pht('Allow Auto Login'))); 194 + } 195 + 196 + return $view; 197 + } 198 + 119 199 }