Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php final class PhabricatorAuthPasswordRevoker extends PhabricatorAuthRevoker { co..
Decoded Output download
<?php
final class PhabricatorAuthPasswordRevoker
extends PhabricatorAuthRevoker {
const REVOKERKEY = 'password';
public function getRevokerName() {
return pht('Passwords');
}
public function getRevokerDescription() {
return pht(
"Revokes all stored passwords.
".
"Account passwords and VCS passwords (used to access repositories ".
"over HTTP) will both be revoked. Passwords for any third party ".
"applications which use shared password infrastructure will also ".
"be revoked.
".
"Users will need to reset account passwords, possibly by using the ".
"\"Forgot Password?\" link on the login page. They will also need ".
"to reset VCS passwords.
".
"Passwords are revoked, not just removed. Users will be unable to ".
"select the passwords they used previously and must choose new, ".
"unique passwords.
".
"Revoking passwords will not terminate outstanding login sessions. ".
"Use the \"session\" revoker in conjunction with this revoker to force ".
"users to login again.");
}
public function getRevokerNextSteps() {
return pht(
'NOTE: Revoking passwords does not terminate existing sessions which '.
'were established using the old passwords. To terminate existing '.
'sessions, run the "session" revoker now.');
}
public function revokeAllCredentials() {
$query = new PhabricatorAuthPasswordQuery();
return $this->revokeWithQuery($query);
}
public function revokeCredentialsFrom($object) {
$query = id(new PhabricatorAuthPasswordQuery())
->withObjectPHIDs(array($object->getPHID()));
return $this->revokeWithQuery($query);
}
private function revokeWithQuery(PhabricatorAuthPasswordQuery $query) {
$viewer = $this->getViewer();
$passwords = $query
->setViewer($viewer)
->withIsRevoked(false)
->execute();
$content_source = PhabricatorContentSource::newForSource(
PhabricatorDaemonContentSource::SOURCECONST);
$revoke_type = PhabricatorAuthPasswordRevokeTransaction::TRANSACTIONTYPE;
$auth_phid = id(new PhabricatorAuthApplication())->getPHID();
foreach ($passwords as $password) {
$xactions = array();
$xactions[] = $password->getApplicationTransactionTemplate()
->setTransactionType($revoke_type)
->setNewValue(true);
$editor = $password->getApplicationTransactionEditor()
->setActor($viewer)
->setActingAsPHID($auth_phid)
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true)
->setContentSource($content_source)
->applyTransactions($password, $xactions);
}
return count($passwords);
}
}
?>
Did this file decode correctly?
Original Code
<?php
final class PhabricatorAuthPasswordRevoker
extends PhabricatorAuthRevoker {
const REVOKERKEY = 'password';
public function getRevokerName() {
return pht('Passwords');
}
public function getRevokerDescription() {
return pht(
"Revokes all stored passwords.\n\n".
"Account passwords and VCS passwords (used to access repositories ".
"over HTTP) will both be revoked. Passwords for any third party ".
"applications which use shared password infrastructure will also ".
"be revoked.\n\n".
"Users will need to reset account passwords, possibly by using the ".
"\"Forgot Password?\" link on the login page. They will also need ".
"to reset VCS passwords.\n\n".
"Passwords are revoked, not just removed. Users will be unable to ".
"select the passwords they used previously and must choose new, ".
"unique passwords.\n\n".
"Revoking passwords will not terminate outstanding login sessions. ".
"Use the \"session\" revoker in conjunction with this revoker to force ".
"users to login again.");
}
public function getRevokerNextSteps() {
return pht(
'NOTE: Revoking passwords does not terminate existing sessions which '.
'were established using the old passwords. To terminate existing '.
'sessions, run the "session" revoker now.');
}
public function revokeAllCredentials() {
$query = new PhabricatorAuthPasswordQuery();
return $this->revokeWithQuery($query);
}
public function revokeCredentialsFrom($object) {
$query = id(new PhabricatorAuthPasswordQuery())
->withObjectPHIDs(array($object->getPHID()));
return $this->revokeWithQuery($query);
}
private function revokeWithQuery(PhabricatorAuthPasswordQuery $query) {
$viewer = $this->getViewer();
$passwords = $query
->setViewer($viewer)
->withIsRevoked(false)
->execute();
$content_source = PhabricatorContentSource::newForSource(
PhabricatorDaemonContentSource::SOURCECONST);
$revoke_type = PhabricatorAuthPasswordRevokeTransaction::TRANSACTIONTYPE;
$auth_phid = id(new PhabricatorAuthApplication())->getPHID();
foreach ($passwords as $password) {
$xactions = array();
$xactions[] = $password->getApplicationTransactionTemplate()
->setTransactionType($revoke_type)
->setNewValue(true);
$editor = $password->getApplicationTransactionEditor()
->setActor($viewer)
->setActingAsPHID($auth_phid)
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true)
->setContentSource($content_source)
->applyTransactions($password, $xactions);
}
return count($passwords);
}
}
Function Calls
None |
Stats
MD5 | aafe47657a1cab1e0b83e337b9e1b9e5 |
Eval Count | 0 |
Decode Time | 77 ms |