<commit_before>#!/usr/bin/php
<?php
/*
 * Script that synchronizes ejabberd users with kyberia
 * Call as needed
 */

//$echo='echo '; //Test only...
$jabber_domain=escapeshellarg('kyberia.cz');

// Use relative address of config file
// Change this, if you move you cron directory.
$dir=substr(__FILE__, 0, strrpos(__FILE__, '/'));
require($dir.'/../wwwroot/config/config.inc');

//require(INCLUDE_DIR.'/log.inc');
require(INCLUDE_DIR.'/database.inc');
//require(INCLUDE_DIR.'/nodes.inc');
//require(INCLUDE_DIR.'/permissions.inc');
//require(INCLUDE_DIR.'/ubik.inc');
//require(INCLUDE_DIR.'/senate.inc');

//REGISTRATION_VOTES CONSTANT DEFINED IN INC/SENATE.INC
define('REGISTER_TEXT','request for access');

$_SESSION['user_id']=UBIK_ID;

$db=new CLASS_DATABASE();

$q='SELECT * FROM users;';

$set=$db->query($q);

while($set->next()) {
	$user=escapeshellarg($set->getString('login'));
	$pass=escapeshellarg(md5('jabber:'.$set->getString('password')));
	system($echo."ejabberdctl register $user $jabber_domain $pass");
	system($echo."ejabberdctl set-password $user $jabber_domain $pass"); //needs mod_ctlextra installed in ejabberd
}
<commit_msg>Added Ejabberd shell notes<commit_after>#!/usr/bin/php
<?php
/*
 * Script that synchronizes ejabberd users with kyberia
 * Call as needed
 */

$echo='echo '; //Test only...
$jabber_domain=escapeshellarg('kyberia.cz');

// Use relative address of config file
// Change this, if you move you cron directory.
$dir=substr(__FILE__, 0, strrpos(__FILE__, '/'));
require($dir.'/../wwwroot/config/config.inc');

//require(INCLUDE_DIR.'/log.inc');
require(INCLUDE_DIR.'/database.inc');
//require(INCLUDE_DIR.'/nodes.inc');
//require(INCLUDE_DIR.'/permissions.inc');
//require(INCLUDE_DIR.'/ubik.inc');
//require(INCLUDE_DIR.'/senate.inc');

//REGISTRATION_VOTES CONSTANT DEFINED IN INC/SENATE.INC
define('REGISTER_TEXT','request for access');

$_SESSION['user_id']=UBIK_ID;

$db=new CLASS_DATABASE();

$q='SELECT * FROM users;';

$set=$db->query($q);

while($set->next()) {
	$user=escapeshellarg($set->getString('login'));
	$pass=escapeshellarg(md5('jab<PASSWORD>:'.$set->getString('password')));
	system($echo."ejabberdctl register $user $jabber_domain $pass");
	system($echo."ejabberdctl set-password $user $jabber_domain $pass"); //needs mod_ctlextra installed in ejabberd
}

/* ejabberdctl debug:
 * mnesia:dirty_read(passwd, {"har<PASSWORD>", "<PASSWORD>"}).
 * mnesia:dirty_write({passwd, {"harvie", "<PASSWORD>"}, "HESLOO"}).
 */
{'fraction_non_alphanumeric': 0.20177562550443906, 'fraction_numerical': 0.0016142050040355124, 'mean_word_length': 5.886111111111111, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4474369', 'n_tokens_mistral': 940, 'n_tokens_neox': 888, 'n_words': 158}