@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.

Conpherence - allow for public rooms to really work

Summary: Fixes T8102. This makes public rooms actually work. Also lets users see the search listings page so they can wander into all public rooms without logging in.

Test Plan: As logged out user, visited ZXX and ZYY. ZXX was public, so I could see it and had a little "Login to Participate" button in the bottom. ZYY was not public so I was prompted to login. Back on ZXX I clicked the Conpherence crumb and got a sensible UI where most links prompted me to login. CLicked "search" and saw listings for all public rooms.

Reviewers: epriestley, chad

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8102

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

+58 -12
+2 -2
resources/celerity/map.php
··· 47 47 'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', 48 48 'rsrc/css/application/conpherence/durable-column.css' => '2e68a92f', 49 49 'rsrc/css/application/conpherence/menu.css' => 'f389e048', 50 - 'rsrc/css/application/conpherence/message-pane.css' => '3150e2a2', 50 + 'rsrc/css/application/conpherence/message-pane.css' => '0e75feef', 51 51 'rsrc/css/application/conpherence/notification.css' => 'd208f806', 52 52 'rsrc/css/application/conpherence/transaction.css' => '885433f0', 53 53 'rsrc/css/application/conpherence/update.css' => '1099a660', ··· 514 514 'config-welcome-css' => '6abd79be', 515 515 'conpherence-durable-column-view' => '2e68a92f', 516 516 'conpherence-menu-css' => 'f389e048', 517 - 'conpherence-message-pane-css' => '3150e2a2', 517 + 'conpherence-message-pane-css' => '0e75feef', 518 518 'conpherence-notification-css' => 'd208f806', 519 519 'conpherence-thread-manager' => '9e507b59', 520 520 'conpherence-transaction-css' => '885433f0',
+4
src/applications/conpherence/controller/ConpherenceListController.php
··· 25 25 return $mode; 26 26 } 27 27 28 + public function shouldAllowPublic() { 29 + return true; 30 + } 31 + 28 32 public function handleRequest(AphrontRequest $request) { 29 33 $user = $request->getUser(); 30 34 $title = pht('Conpherence');
+1 -2
src/applications/conpherence/controller/ConpherenceNewController.php
··· 42 42 } 43 43 } 44 44 } else { 45 - $uri = $this->getApplicationURI($conpherence->getID()); 46 45 return id(new AphrontRedirectResponse()) 47 - ->setURI($uri); 46 + ->setURI('/'.$conpherence->getMonogram()); 48 47 } 49 48 } else { 50 49 $participant_prefill = $request->getStr('participant');
+1 -2
src/applications/conpherence/controller/ConpherenceNewRoomController.php
··· 36 36 ->setActor($user) 37 37 ->applyTransactions($conpherence, $xactions); 38 38 39 - $uri = $this->getApplicationURI($conpherence->getID()); 40 39 return id(new AphrontRedirectResponse()) 41 - ->setURI($uri); 40 + ->setURI('/'.$conpherence->getMonogram()); 42 41 } catch (PhabricatorApplicationTransactionValidationException $ex) { 43 42 $validation_exception = $ex; 44 43
+4
src/applications/conpherence/controller/ConpherenceRoomListController.php
··· 2 2 3 3 final class ConpherenceRoomListController extends ConpherenceController { 4 4 5 + public function shouldAllowPublic() { 6 + return true; 7 + } 8 + 5 9 public function handleRequest(AphrontRequest $request) { 6 10 $user = $request->getUser(); 7 11
+1 -1
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 251 251 case 'redirect': 252 252 default: 253 253 return id(new AphrontRedirectResponse()) 254 - ->setURI($this->getApplicationURI($conpherence->getID().'/')); 254 + ->setURI('/'.$conpherence->getMonogram()); 255 255 break; 256 256 } 257 257 }
+18 -3
src/applications/conpherence/controller/ConpherenceViewController.php
··· 5 5 6 6 const OLDER_FETCH_LIMIT = 5; 7 7 8 + public function shouldAllowPublic() { 9 + return true; 10 + } 11 + 8 12 public function handleRequest(AphrontRequest $request) { 9 13 $user = $request->getUser(); 10 14 ··· 138 142 $conpherence, 139 143 PhabricatorPolicyCapability::CAN_JOIN); 140 144 $participating = $conpherence->getParticipantIfExists($user->getPHID()); 141 - if (!$can_join && !$participating) { 145 + if (!$can_join && !$participating && $user->isLoggedIn()) { 142 146 return null; 143 147 } 144 148 $draft = PhabricatorDraft::newFromUserAndKey( ··· 147 151 if ($participating) { 148 152 $action = ConpherenceUpdateActions::MESSAGE; 149 153 $button_text = pht('Send'); 150 - } else { 154 + } else if ($user->isLoggedIn()) { 151 155 $action = ConpherenceUpdateActions::JOIN_ROOM; 152 156 $button_text = pht('Join'); 157 + } else { 158 + // user not logged in so give them a login button. 159 + $login_href = id(new PhutilURI('/auth/start/')) 160 + ->setQueryParam('next', '/'.$conpherence->getMonogram()); 161 + return id(new PHUIFormLayoutView()) 162 + ->addClass('login-to-participate') 163 + ->appendChild( 164 + id(new PHUIButtonView()) 165 + ->setTag('a') 166 + ->setText(pht('Login to Participate')) 167 + ->setHref((string)$login_href)); 153 168 } 154 169 $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); 155 170 ··· 157 172 158 173 $form = 159 174 id(new AphrontFormView()) 175 + ->setUser($user) 160 176 ->setAction($update_uri) 161 177 ->addSigil('conpherence-pontificate') 162 178 ->setWorkflow(true) 163 - ->setUser($user) 164 179 ->addHiddenInput('action', $action) 165 180 ->appendChild( 166 181 id(new PhabricatorRemarkupControl())
+11 -1
src/applications/conpherence/controller/ConpherenceWidgetController.php
··· 13 13 return $this->userPreferences; 14 14 } 15 15 16 + public function shouldAllowPublic() { 17 + return true; 18 + } 19 + 16 20 public function handleRequest(AphrontRequest $request) { 17 21 $request = $this->getRequest(); 18 22 $user = $request->getUser(); ··· 26 30 ->withIDs(array($conpherence_id)) 27 31 ->needWidgetData(true) 28 32 ->executeOne(); 33 + if (!$conpherence) { 34 + return new Aphront404Response(); 35 + } 29 36 $this->setConpherence($conpherence); 30 37 31 38 $this->setUserPreferences($user->loadPreferences()); ··· 138 145 PhabricatorPolicyCapability::CAN_JOIN); 139 146 if ($can_join) { 140 147 $text = pht('Settings are available after joining the room.'); 148 + } else if ($viewer->isLoggedIn()) { 149 + $text = pht('Settings not applicable to rooms you can not join.'); 141 150 } else { 142 - $text = pht('Settings not applicable to rooms you can not join.'); 151 + $text = pht( 152 + 'Settings are available after logging in and joining the room.'); 143 153 } 144 154 return phutil_tag( 145 155 'div',
+8 -1
src/view/form/PHUIFormLayoutView.php
··· 7 7 */ 8 8 final class PHUIFormLayoutView extends AphrontView { 9 9 10 + private $classes = array(); 10 11 private $fullWidth; 11 12 12 13 public function setFullWidth($width) { 13 14 $this->fullWidth = $width; 15 + return $this; 16 + } 17 + 18 + public function addClass($class) { 19 + $this->classes[] = $class; 14 20 return $this; 15 21 } 16 22 ··· 38 44 } 39 45 40 46 public function render() { 41 - $classes = array('phui-form-view'); 47 + $classes = $this->classes; 48 + $classes[] = 'phui-form-view'; 42 49 43 50 if ($this->fullWidth) { 44 51 $classes[] = 'phui-form-full-width';
+8
webroot/rsrc/css/application/conpherence/message-pane.css
··· 113 113 right: 241px; 114 114 } 115 115 116 + .conpherence-message-pane .phui-form-view.login-to-participate { 117 + height: 28px; 118 + } 119 + 120 + .conpherence-message-pane .login-to-participate a.button { 121 + float: right; 122 + } 123 + 116 124 .conpherence-message-pane .aphront-form-control-submit button, 117 125 .conpherence-message-pane .aphront-form-control-submit a.button { 118 126 margin-top: 6px;