<commit_before><?php

require_once dirname(__FILE__).'/accesscheck.php';

$access = accessLevel('send');
switch ($access) {
    case 'owner':
        $subselect = ' where owner = '.$_SESSION['logindetails']['id'];
        $ownership = ' and owner = '.$_SESSION['logindetails']['id'];
        break;
    case 'all':
        $subselect = '';
        $ownership = '';
        break;
    case 'none':
    default:
        $subselect = ' where id = 0';
        $ownership = ' and id = 0';
        break;
}
$some = 0;

// handle commandline
if ($GLOBALS['commandline']) {
    $cline = parseCline();
    reset($cline);
    if (!$cline || !is_array($cline) || !$cline['s'] || !$cline['l']) {
        clineUsage('-s subject -l list [-f from] < message');
        exit;
    }

    $listnames = explode(' ', $cline['l']);
    $listids = array();
    foreach ($listnames as $listname) {
        if (!is_numeric($listname)) {
            $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where name = "%s"',
                $tables['list'], $listname));
            if ($listid['id']) {
                $listids[$listid['id']] = $listname;
            }
        } else {
            $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d',
                $tables['list'], $listname));
            if ($listid['id']) {
                $listids[$listid['id']] = $listid['name'];
            }
        }
    }

    $_POST['targetlist'] = array();<commit_msg>For command line set the subselect and ownership to reflect 'all' permissions<commit_after><?php

require_once dirname(__FILE__).'/accesscheck.php';

$access = accessLevel('send');
switch ($access) {
    case 'owner':
        $subselect = ' where owner = '.$_SESSION['logindetails']['id'];
        $ownership = ' and owner = '.$_SESSION['logindetails']['id'];
        break;
    case 'all':
        $subselect = '';
        $ownership = '';
        break;
    case 'none':
    default:
        $subselect = ' where id = 0';
        $ownership = ' and id = 0';
        break;
}
$some = 0;

// handle commandline
if ($GLOBALS['commandline']) {
    $subselect = '';
    $ownership = '';
    $cline = parseCline();
    reset($cline);
    if (!$cline || !is_array($cline) || !$cline['s'] || !$cline['l']) {
        clineUsage('-s subject -l list [-f from] < message');
        exit;
    }

    $listnames = explode(' ', $cline['l']);
    $listids = array();
    foreach ($listnames as $listname) {
        if (!is_numeric($listname)) {
            $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where name = "%s"',
                $tables['list'], $listname));
            if ($listid['id']) {
                $listids[$listid['id']] = $listname;
            }
        } else {
            $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d',
                $tables['list'], $listname));
            if ($listid['id']) {
                $listids[$listid['id']] = $listid['name'];
            }
        }
    }

    $_POST['targetlist'] = array();
{'fraction_non_alphanumeric': 0.1913214990138067, 'fraction_numerical': 0.0019723865877712033, 'mean_word_length': 2.203157894736842, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5302920', 'n_tokens_mistral': 979, 'n_tokens_neox': 946, 'n_words': 206}