Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/oauthserver/storage/PhabricatorOAuthServerTransaction.php
12242 views
1
<?php
2
3
final class PhabricatorOAuthServerTransaction
4
extends PhabricatorApplicationTransaction {
5
6
const TYPE_NAME = 'oauthserver.name';
7
const TYPE_REDIRECT_URI = 'oauthserver.redirect-uri';
8
const TYPE_DISABLED = 'oauthserver.disabled';
9
10
public function getApplicationName() {
11
return 'oauth_server';
12
}
13
14
public function getTableName() {
15
return 'oauth_server_transaction';
16
}
17
18
public function getApplicationTransactionType() {
19
return PhabricatorOAuthServerClientPHIDType::TYPECONST;
20
}
21
22
public function getTitle() {
23
$author_phid = $this->getAuthorPHID();
24
$old = $this->getOldValue();
25
$new = $this->getNewValue();
26
27
switch ($this->getTransactionType()) {
28
case PhabricatorTransactions::TYPE_CREATE:
29
return pht(
30
'%s created this OAuth application.',
31
$this->renderHandleLink($author_phid));
32
case self::TYPE_NAME:
33
return pht(
34
'%s renamed this application from "%s" to "%s".',
35
$this->renderHandleLink($author_phid),
36
$old,
37
$new);
38
case self::TYPE_REDIRECT_URI:
39
return pht(
40
'%s changed the application redirect URI from "%s" to "%s".',
41
$this->renderHandleLink($author_phid),
42
$old,
43
$new);
44
case self::TYPE_DISABLED:
45
if ($new) {
46
return pht(
47
'%s disabled this application.',
48
$this->renderHandleLink($author_phid));
49
} else {
50
return pht(
51
'%s enabled this application.',
52
$this->renderHandleLink($author_phid));
53
}
54
}
55
56
return parent::getTitle();
57
}
58
59
}
60
61