function xmpp_login()
{
if (!$_SESSION["allow_api"]) {
- $password = substr(random_string(),0,16);
+ $password = random_string(16);
PConfig::set(local_user(), "xmpp", "password", $password);
}
}
{
$t = get_markup_template("admin.tpl", "addon/xmpp/");
- $o = replace_macros($t, array(
+ $o = replace_macros($t, [
'$submit' => t('Save Settings'),
- '$bosh_proxy' => array('bosh_proxy', t('Jabber BOSH host'), Config::get('xmpp', 'bosh_proxy'), ''),
- '$central_userbase' => array('central_userbase', t('Use central userbase'), Config::get('xmpp', 'central_userbase'), t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')),
- ));
+ '$bosh_proxy' => ['bosh_proxy', t('Jabber BOSH host'), Config::get('xmpp', 'bosh_proxy'), ''],
+ '$central_userbase' => ['central_userbase', t('Use central userbase'), Config::get('xmpp', 'central_userbase'), t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')],
+ ]);
}
function xmpp_plugin_admin_post()
return;
}
- if (in_array($a->query_string, array("admin/federation/"))) {
+ if (in_array($a->query_string, ["admin/federation/"])) {
return;
}
if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) {
$bosh_proxy = Config::get("xmpp", "bosh_proxy");
- $password = PConfig::get(local_user(), "xmpp", "password");
+ $password = PConfig::get(local_user(), "xmpp", "password", '', true);
if ($password == "") {
$password = random_string(16);
return;
}
- if (in_array($a->argv[0], array("manage", "logout"))) {
+ if (in_array($a->argv[0], ["manage", "logout"])) {
$additional_commands = "converse.user.logout();\n";
} else {
$additional_commands = "";