summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorChristoph Burschka2016-09-25 15:25:59 +0200
committerChristoph Burschka2016-09-25 13:43:27 +0000
commitcc202c462f34fff212d3e51a095c63008c20b050 (patch)
treeff1f6cd43e9ef088357830a9fd2a0cc2bc44701f /core
parentFix the JSON content type. (diff)
downloadejabberd-auth-php-cc202c462f34fff212d3e51a095c63008c20b050.tar.gz
Fix #16 Accept command-line arguments.
If main.php is called with commandline arguments, these will be passed to the bridge as a single request, instead of running the bridge as a daemon. The arguments are, in order: <command> <username> <server> <password> The result will be printed to stdout (1 for success, 0 for failure), and will be set as the exit status (0 for success, 1 for failure).
Diffstat (limited to 'core')
-rw-r--r--core/EjabberdAuth.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/EjabberdAuth.php b/core/EjabberdAuth.php
index c9b5ec4..d2465ce 100644
--- a/core/EjabberdAuth.php
+++ b/core/EjabberdAuth.php
@@ -61,7 +61,7 @@ class EjabberdAuth {
}
function execute($data) {
- $args = explode(':', $data . ':::');
+ $args = is_array($data) ? array_merge($data, [NULL,NULL,NULL]) : explode(':', $data . ':::');
list($command, $username, $server, $password) = $args;
$username = xmpp_unescape_node($username);