@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
at upstream/main 55 lines 1.4 kB view raw
1<?php 2 3final class PhabricatorAuthSSHKeyTransaction 4 extends PhabricatorApplicationTransaction { 5 6 const TYPE_NAME = 'sshkey.name'; 7 const TYPE_KEY = 'sshkey.key'; 8 const TYPE_DEACTIVATE = 'sshkey.deactivate'; 9 10 public function getApplicationName() { 11 return 'auth'; 12 } 13 14 public function getApplicationTransactionType() { 15 return PhabricatorAuthSSHKeyPHIDType::TYPECONST; 16 } 17 18 public function getTitle() { 19 $author_phid = $this->getAuthorPHID(); 20 21 $old = $this->getOldValue(); 22 $new = $this->getNewValue(); 23 24 switch ($this->getTransactionType()) { 25 case PhabricatorTransactions::TYPE_CREATE: 26 return pht( 27 '%s created this key.', 28 $this->renderHandleLink($author_phid)); 29 case self::TYPE_NAME: 30 return pht( 31 '%s renamed this key from "%s" to "%s".', 32 $this->renderHandleLink($author_phid), 33 $old, 34 $new); 35 case self::TYPE_KEY: 36 return pht( 37 '%s updated the public key material for this SSH key.', 38 $this->renderHandleLink($author_phid)); 39 case self::TYPE_DEACTIVATE: 40 if ($new) { 41 return pht( 42 '%s revoked this key.', 43 $this->renderHandleLink($author_phid)); 44 } else { 45 return pht( 46 '%s reinstated this key.', 47 $this->renderHandleLink($author_phid)); 48 } 49 50 } 51 52 return parent::getTitle(); 53 } 54 55}