Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15565407
D20669.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D20669.id.diff
View Options
diff --git a/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php b/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php
--- a/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php
+++ b/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'auth.password';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 20 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php b/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php
--- a/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php
+++ b/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php
@@ -4,10 +4,6 @@
const TYPECONST = 'mail.login';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 3 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthNewFactorAction.php b/src/applications/auth/action/PhabricatorAuthNewFactorAction.php
--- a/src/applications/auth/action/PhabricatorAuthNewFactorAction.php
+++ b/src/applications/auth/action/PhabricatorAuthNewFactorAction.php
@@ -4,10 +4,6 @@
const TYPECONST = 'auth.factor.new';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 60 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthTestSMSAction.php b/src/applications/auth/action/PhabricatorAuthTestSMSAction.php
--- a/src/applications/auth/action/PhabricatorAuthTestSMSAction.php
+++ b/src/applications/auth/action/PhabricatorAuthTestSMSAction.php
@@ -4,10 +4,6 @@
const TYPECONST = 'auth.sms.test';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 60 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php b/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php
--- a/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php
+++ b/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'mail.try-login';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 20 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthTryFactorAction.php b/src/applications/auth/action/PhabricatorAuthTryFactorAction.php
--- a/src/applications/auth/action/PhabricatorAuthTryFactorAction.php
+++ b/src/applications/auth/action/PhabricatorAuthTryFactorAction.php
@@ -4,10 +4,6 @@
const TYPECONST = 'auth.factor';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 10 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php b/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php
--- a/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php
+++ b/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'auth.password';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 100 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php b/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php
--- a/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php
+++ b/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'auth.password-without-captcha';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 10 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php b/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php
--- a/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php
+++ b/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'files.outbound';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 60 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php b/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php
--- a/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php
+++ b/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php
@@ -2,9 +2,7 @@
final class PhabricatorMetaMTAErrorMailAction extends PhabricatorSystemAction {
- public function getActionConstant() {
- return 'email.error';
- }
+ const TYPECONST = 'email.error';
public function getScoreThreshold() {
return 6 / phutil_units('1 hour in seconds');
diff --git a/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php b/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php
--- a/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php
+++ b/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php
@@ -5,10 +5,6 @@
const TYPECONST = 'phortune.payment-method.add';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 60 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php b/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php
--- a/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php
+++ b/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php
@@ -4,10 +4,6 @@
const TYPECONST = 'email.add';
- public function getActionConstant() {
- return self::TYPECONST;
- }
-
public function getScoreThreshold() {
return 6 / phutil_units('1 hour in seconds');
}
diff --git a/src/applications/system/action/PhabricatorSystemAction.php b/src/applications/system/action/PhabricatorSystemAction.php
--- a/src/applications/system/action/PhabricatorSystemAction.php
+++ b/src/applications/system/action/PhabricatorSystemAction.php
@@ -2,7 +2,10 @@
abstract class PhabricatorSystemAction extends Phobject {
- abstract public function getActionConstant();
+ final public function getActionConstant() {
+ return $this->getPhobjectClassConstant('TYPECONST', 32);
+ }
+
abstract public function getScoreThreshold();
public function shouldBlockActor($actor, $score) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 2:32 AM (5 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7222391
Default Alt Text
D20669.id.diff (6 KB)
Attached To
Mode
D20669: Simplify implementation of "SysetemAction->getSystemActionConstant()"
Attached
Detach File
Event Timeline
Log In to Comment