Example #1
0
    $script->setLimit($x);
}
$limit = $script->limit;
/* set offset */
if ($x = $backend->get('offset')) {
    $script->setOffset($x);
}
$offset = $script->offset;
$script->use_regex = $use_regex;
$script->show_locked = $show_locked;
$script->show_hidden = $show_hidden;
#############################
## Input form
#############################
$f_username = $backend->formatValue(isset($name) ? $name : '');
echo "\n\t<form action='", $backend->url('/gusersearch'), "' method='get'>\n\t\t<input type='text' name='name' value='{$f_username}' />\n\t\t", $limit != Script::DEFAULT_LIMIT ? "<input type='hidden' name='limit' value='{$limit}' />" : "", "\n\t\t<input type='submit' value='Search »' /> <br />\n\t\t<div style='padding-left:0.5em; border:1px solid gray; color:gray;'>\n\t\t\t", Form::Checkbox('show_locked', $show_locked), "\n\t\t\t<label for='show_locked'>Show locked accounts</label><br />\n\n\t\t\t", Form::Checkbox('show_hidden', $show_hidden), "\n\t\t\t<label for='show_hidden'>Show hidden accounts</label><br />\n\n\t\t\t", Form::Checkbox('regex', $use_regex, array('onClick' => 'script.toggleRegex(this.checked);')), "\n\t\t\t<label for='regex'>Use <a href='http://www.wellho.net/regex/mysql.html' title='MySQL regex reference'>regular expression</a> (much slower)</label><br />\n\n\t\t\t", Form::Checkbox('icase', $case_insensitive), "\n\t\t\t<label for='icase'>Match any capitalization (much slower)</label><br />\n\t\t\t\n\t\t\t", "\n\n\t\t\t<p>\n\t\t\t\t<b>Search syntax:</b>\n\t\t\t\t<span id='tips-regex'", $use_regex ? "" : " style='display:none;'", ">\n\t\t\t\t\tRegular expressions are much slower, but much more powerful. You will need to escape special characters like [.*^\$]. See the <a href='http://www.wellho.net/regex/mysql.html' title='MySQL regex reference'>MySQL regex reference</a>.\n\t\t\t\t</span>\n\t\t\t\t<span id='tips-like'", $use_regex ? " style='display:none;'" : "", ">\n\t\t\t\t\tAdd % to your search string for multicharacter wildcards, and _ for a single-character wildcard. For example, '%Joe%' finds every username containing the word 'Joe').\n\t\t\t\t</span>\n\t\t\t</p>\n\t\t\t<p>Beware: search is <strong><em>much slower</em></strong> if the user name starts with a wildcard!</p>\n\t\t</div>\n\t</form>\n";
#############################
## Perform search
#############################
$backend->profiler->stop('initialize');
$script->Query();
$backend->profiler->start('output');
$count = $script->db->countRows();
$has_results = (int) (!(bool) $count);
echo "\n\t<h2>Search results</h2>\n\t<p id='search-summary' class='search-results-{$has_results}'>{$script->getFormattedSearchOptions()}.</p>";
#############################
## Output
#############################
if ($count) {
    /* pagination */
    echo "[", $offset > 0 ? $script->paginationLink($limit, $offset - $limit, "&larr;newer {$limit}") : "&larr;newer {$limit}", " | ", $script->db->countRows() >= $limit ? $script->paginationLink($limit, $offset + $limit, "older {$limit}&rarr;") : "older {$limit}&rarr;", "] [show ", $script->paginationLink(50, $offset, 50), ", ", $script->paginationLink(250, $offset, 250), ", ", $script->paginationLink(500, $offset, 500), "]";
Example #2
0
## Input form
#############################
$target_form = '';
if ($script->isValid()) {
    $target_form = $backend->formatValue($script->target);
}
echo '
	<p>Who shall we stalk?</p>
	<form action="', $backend->url('/stalktoy/'), '" method="get">
		<div>
			<input type="text" name="target" value="', $target_form, '" />
			<input type="submit" value="Analyze »" /> <br />

			', Form::Checkbox('show_all_wikis', $script->show_all_wikis), '
			<label for="show_all_wikis">Show wikis where account is not registered.</label><br />
			', Form::Checkbox('global_groups_per_wiki', $script->show_groups_per_wiki), '
			<label for="global_groups_per_wiki">Show relevant global groups for each wiki.</label><br />
		</div>
	</form>';
#############################
## Process data (IP / CIDR)
#############################
$ip = $script->getGlobalIP($script->db, $script->target);
if ($script->isValid() && $ip->ip->isValid()) {
    ########
    ## Fetch data
    ########
    /* global data */
    $backend->profiler->start('fetch global');
    $global = array('wikis' => $script->wikis, 'ip' => $ip, 'pretty_range' => $ip->ip->getFriendly(IPAddress::START) . ' &mdash; ' . $ip->ip->getFriendly(IPAddress::END));
    $backend->profiler->stop('fetch global');
Example #3
0
			(this is a <?php 
echo Form::Select('cat', $cat, array(1 => 'category', 0 => 'prefix'));
?>
 on <select name="wiki" id="wiki">
			<?php 
foreach ($db->getWikis() as $wiki) {
    if (!$wiki->isClosed) {
        $selected = $wiki->dbName == $database;
        echo '<option value="', $wiki->dbName, '"', $selected ? ' selected="yes" ' : '', '>', $backend->formatText($wiki->domain), '</option>';
    }
}
?>
			</select>)<br /><br />

			<?php 
echo Form::Checkbox('listpages', $listpages);
?>
			<label for="listpages">List all pages and redirects (not recommended)</label>
			<br />

			<input type="submit" value="analyze" />
		</fieldset>
	</form>
<?php 
do {
    /***************
     * Validation
     ***************/
    // missing data (break)
    if (!$title) {
        break;