Differential D25031 Diff 83 src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php
Context not available. | |||||
$type = $args->getArg('type'); | $type = $args->getArg('type'); | ||||
$is_everything = $args->getArg('everything'); | $is_everything = $args->getArg('everything'); | ||||
if (!strlen($type) && !$is_everything) { | if (!@strlen($type) && !$is_everything) { | ||||
if ($is_list) { | if ($is_list) { | ||||
// By default, "bin/revoke --list" implies "--everything". | // By default, "bin/revoke --list" implies "--everything". | ||||
$types = $all_types; | $types = $all_types; | ||||
Context not available. | |||||
'"--everything". Use "--list" to list available credential '. | '"--everything". Use "--list" to list available credential '. | ||||
'types.')); | 'types.')); | ||||
} | } | ||||
} else if (strlen($type) && $is_everything) { | } else if (@strlen($type) && $is_everything) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Specify the credential type to revoke with "--type" or '. | 'Specify the credential type to revoke with "--type" or '. | ||||
Context not available. | |||||
$from = $args->getArg('from'); | $from = $args->getArg('from'); | ||||
if ($is_list) { | if ($is_list) { | ||||
if (strlen($from) || $is_everywhere) { | if (@strlen($from) || $is_everywhere) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'You can not "--list" and revoke credentials (with "--from" or '. | 'You can not "--list" and revoke credentials (with "--from" or '. | ||||
Context not available. | |||||
} | } | ||||
$target = null; | $target = null; | ||||
if (!strlen($from) && !$is_everywhere) { | if (!@strlen($from) && !$is_everywhere) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Specify the target to revoke credentials from with "--from" or '. | 'Specify the target to revoke credentials from with "--from" or '. | ||||
'specify "--everywhere".')); | 'specify "--everywhere".')); | ||||
} else if (strlen($from) && $is_everywhere) { | } else if (@strlen($from) && $is_everywhere) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Specify the target to revoke credentials from with "--from" or '. | 'Specify the target to revoke credentials from with "--from" or '. | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0