Page MenuHomePhabricator

D18892.diff
No OneTemporary

D18892.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2126,6 +2126,7 @@
'PhabricatorAuthSessionGarbageCollector' => 'applications/auth/garbagecollector/PhabricatorAuthSessionGarbageCollector.php',
'PhabricatorAuthSessionInfo' => 'applications/auth/data/PhabricatorAuthSessionInfo.php',
'PhabricatorAuthSessionQuery' => 'applications/auth/query/PhabricatorAuthSessionQuery.php',
+ 'PhabricatorAuthSessionRevoker' => 'applications/auth/revoker/PhabricatorAuthSessionRevoker.php',
'PhabricatorAuthSetPasswordController' => 'applications/auth/controller/PhabricatorAuthSetPasswordController.php',
'PhabricatorAuthSetupCheck' => 'applications/config/check/PhabricatorAuthSetupCheck.php',
'PhabricatorAuthStartController' => 'applications/auth/controller/PhabricatorAuthStartController.php',
@@ -7413,6 +7414,7 @@
'PhabricatorAuthSessionGarbageCollector' => 'PhabricatorGarbageCollector',
'PhabricatorAuthSessionInfo' => 'Phobject',
'PhabricatorAuthSessionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+ 'PhabricatorAuthSessionRevoker' => 'PhabricatorAuthRevoker',
'PhabricatorAuthSetPasswordController' => 'PhabricatorAuthController',
'PhabricatorAuthSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorAuthStartController' => 'PhabricatorAuthController',
diff --git a/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php b/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php
new file mode 100644
--- /dev/null
+++ b/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php
@@ -0,0 +1,33 @@
+<?php
+
+final class PhabricatorAuthSessionRevoker
+ extends PhabricatorAuthRevoker {
+
+ const REVOKERKEY = 'session';
+
+ public function revokeAllCredentials() {
+ $table = new PhabricatorAuthSession();
+ $conn = $table->establishConnection('w');
+
+ queryfx(
+ $conn,
+ 'DELETE FROM %T',
+ $table->getTableName());
+
+ return $conn->getAffectedRows();
+ }
+
+ public function revokeCredentialsFrom($object) {
+ $table = new PhabricatorAuthSession();
+ $conn = $table->establishConnection('w');
+
+ queryfx(
+ $conn,
+ 'DELETE FROM %T WHERE userPHID = %s',
+ $table->getTableName(),
+ $object->getPHID());
+
+ return $conn->getAffectedRows();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 21, 2:47 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7698425
Default Alt Text
D18892.diff (2 KB)

Event Timeline