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

Profile image stuff

+56 -6
+2
conf/default.conf.php
··· 42 42 'recaptcha.private-key' => null, 43 43 44 44 45 + 'user.default-profile-image-phid' => 'PHID-FILE-f57aaefce707fc4060ef', 46 + 45 47 46 48 );
+18
src/applications/auth/controller/facebookauth/PhabricatorFacebookAuthController.php
··· 131 131 return id(new AphrontRedirectResponse()) 132 132 ->setURI('/'); 133 133 } 134 + 135 + $known_email = id(new PhabricatorUser()) 136 + ->loadOneWhere('email = %s', $user_data['email']); 137 + if ($known_email) { 138 + if ($known_email->getFacebookUID()) { 139 + throw new Exception( 140 + "The email associated with the Facebook account you just logged in ". 141 + "with is already associated with another Phabricator account which ". 142 + "is, in turn, associated with a Facebook account different from ". 143 + "the one you just logged in with."); 144 + } 145 + $known_email->setFacebookUID($user_id); 146 + $session_key = $known_email->establishSession('web'); 147 + $request->setCookie('phusr', $known_email->getUsername()); 148 + $request->setCookie('phsid', $session_key); 149 + return id(new AphrontRedirectResponse()) 150 + ->setURI('/'); 151 + } 134 152 135 153 $current_user = $this->getRequest()->getUser(); 136 154 if ($current_user->getPHID()) {
+2 -1
src/applications/auth/controller/login/PhabricatorLoginController.php
··· 85 85 $panel = new AphrontPanelView(); 86 86 $panel->setHeader('Phabricator Login'); 87 87 $panel->setWidth(AphrontPanelView::WIDTH_FORM); 88 + // $panel->setCreateButton('Register New Account', '/login/register/'); 88 89 $panel->appendChild($form); 89 90 90 91 $fbauth_enabled = PhabricatorEnv::getEnvConfig('facebook.auth-enabled'); ··· 117 118 id(new AphrontFormSubmitControl()) 118 119 ->setValue("Login with Facebook \xC2\xBB")); 119 120 120 - $panel->appendChild('<br /><h1>Login with Facebook</h1>'); 121 + $panel->appendChild('<br /><h1>Login or Register with Facebook</h1>'); 121 122 $panel->appendChild($facebook_auth); 122 123 } 123 124
+11 -5
src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php
··· 50 50 51 51 $date = date('F jS, Y g:i:s A', $comment->getDateCreated()); 52 52 53 - $author = $comment->getAuthorPHID(); 54 - $author = $this->handles[$author]->renderLink(); 53 + $author = $this->handles[$comment->getAuthorPHID()]; 54 + $author_link = $author->renderLink(); 55 55 56 56 $verb = DifferentialAction::getActionPastTenseVerb($comment->getAction()); 57 57 $verb = phutil_escape_html($verb); 58 58 59 59 $content = $comment->getContent(); 60 60 if (strlen(rtrim($content))) { 61 - $title = "{$author} {$verb} this revision:"; 61 + $title = "{$author_link} {$verb} this revision:"; 62 62 $content = 63 63 '<div class="phabricator-remarkup">'. 64 64 $this->markupEngine->markupText($content). ··· 67 67 $title = null; 68 68 $content = 69 69 '<div class="differential-comment-nocontent">'. 70 - "<p>{$author} {$verb} this revision.</p>". 70 + "<p>{$author_link} {$verb} this revision.</p>". 71 71 '</div>'; 72 72 } 73 + 74 + $background = null; 75 + $uri = $author->getImageURI(); 76 + if ($uri) { 77 + $background = "background-image: url('{$uri}');"; 78 + } 73 79 74 80 return 75 81 '<div class="differential-comment '.$action_class.'">'. ··· 77 83 '<div class="differential-comment-date">'.$date.'</div>'. 78 84 '<div class="differential-comment-title">'.$title.'</div>'. 79 85 '</div>'. 80 - '<div class="differential-comment-body">'. 86 + '<div class="differential-comment-body" style="'.$background.'">'. 81 87 '<div class="differential-comment-core">'. 82 88 '<div class="differential-comment-content">'. 83 89 $content.
+1
src/applications/files/controller/view/PhabricatorFileViewController.php
··· 52 52 53 53 $form = new AphrontFormView(); 54 54 $form->setAction('/file/view/'.$file->getPHID().'/'); 55 + $form->setUser($this->getRequest()->getUser()); 55 56 $form 56 57 ->appendChild( 57 58 id(new AphrontFormStaticControl())
+6
src/applications/people/storage/user/PhabricatorUser.php
··· 30 30 protected $profileImagePHID; 31 31 32 32 private $sessionKey; 33 + 34 + public function getProfileImagePHID() { 35 + return nonempty( 36 + $this->profileImagePHID, 37 + PhabricatorEnv::getEnvConfig('user.default-profile-image-phid')); 38 + } 33 39 34 40 public function getConfiguration() { 35 41 return array(
+10
src/applications/phid/handle/PhabricatorObjectHandle.php
··· 23 23 private $type; 24 24 private $name; 25 25 private $email; 26 + private $imageURI; 26 27 27 28 public function setURI($uri) { 28 29 $this->uri = $uri; ··· 67 68 68 69 public function getEmail() { 69 70 return $this->email; 71 + } 72 + 73 + public function setImageURI($uri) { 74 + $this->imageURI = $uri; 75 + return $this; 76 + } 77 + 78 + public function getImageURI() { 79 + return $this->imageURI; 70 80 } 71 81 72 82 public function renderLink() {
+6
src/applications/phid/handle/data/PhabricatorObjectHandleData.php
··· 58 58 $handle->setName($user->getUsername()); 59 59 $handle->setURI('/p/'.$user->getUsername().'/'); 60 60 $handle->setEmail($user->getEmail()); 61 + 62 + $img_phid = $user->getProfileImagePHID(); 63 + if ($img_phid) { 64 + $handle->setImageURI( 65 + PhabricatorFileURI::getViewURIForPHID($img_phid)); 66 + } 61 67 } 62 68 $handles[$phid] = $handle; 63 69 }