This file is indexed.

/usr/bin/horde-remove-user-data is in php-horde 5.2.9+debian0-1build1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
#!/usr/bin/php
<?php
/**
 * This script will delete all user data for a given user.
 *
 * Copyright 2013-2016 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (LGPL-2). If you
 * did not receive this file, see http://www.horde.org/licenses/lgpl.
 *
 * @author    Michael Slusarz <slusarz@horde.org>
 * @category  Horde
 * @copyright 2013-2016 Horde LLC
 * @license   http://www.horde.org/licenses/lgpl LGPL-2
 * @package   Horde
 */

$baseFile = __DIR__ . '/../lib/Application.php';
if (file_exists($baseFile)) {
    require_once $baseFile;
} else {
    require_once 'PEAR/Config.php';
    require_once PEAR_Config::singleton()
        ->get('horde_dir', null, 'pear.horde.org') . '/lib/Application.php';
}
Horde_Registry::appInit('horde', array(
    'authentication' => 'none',
    'cli' => true,
    'user_admin' => true
));

$usage = <<<USAGE
Remove user data from Horde database

  horde-remove-user-data [options] [user...]

If no user is specified on command line, the user is prompted for one.
The a prompt for the Horde application is displayed.

If at least one user is specified on command line, the data for
all Horde applications is remove for all specified users.
USAGE;

// Parse command line arguments.
$parser = new Horde_Argv_Parser(
    array(
        'usage' => $usage,
        'optionList' => array(
            new Horde_Argv_Option('-c', '--continue', array(
                'action' => 'store_true',
                'help' => 'Continue with next user on failure',
                'dest' => 'continue'
            )),
            new Horde_Argv_Option('-f', '--force', array(
                'action' => 'store_true',
                'help' => 'Force removing without prompt',
                'dest' => 'force'
            )),
        )
    )
);
list($options, $argv) = $parser->parseArgs();

/* null = all; particular app otherwise */
$app = null;

if (!count($argv)) {
    $cli->message('Horde directory: ' . realpath(HORDE_BASE), 'cli.message');

    do {
        $user = $cli->prompt('Username:');
    } while (!strlen($user));

    $argv = array($user);
    $app = $cli->prompt('Application to remove data from (blank for all apps):');
    if (!strlen($app)) {
        $app = null;
    }

    $cli->writeln();
}

if (!$options->force) {
    $cli->writeln($cli->red('Removing data of user(s)') . ':');
    $cli->writeln('  ' . implode(', ', $argv));
    $cli->writeln();

    if ($cli->prompt($cli->red('Are you sure you want to remove user data?'), array('y' => 'Yes', 'n' => 'No'), 'n') != 'y') {
        exit(0);
    }
}

foreach ($argv as $user) {
    try {
        $registry->removeUserData($user, $app);
        $cli->message($user . ': Data removed.', 'cli.success');
    } catch (Horde_Exception $e) {
        if ($options->continue) {
            $cli->message($user . ': Data NOT removed completely. ' . $e->getMessage() , 'cli.error');
        } else {
            $cli->fatal($user . ': Data NOT removed completely. ' . $e->getMessage());
        }
    }
}