You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cacert-webdb/pages/account/49.php

101 lines
3.4 KiB
PHP

<? /*
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
if(intval($_GET['userid']) <= 0)
{
$domainsearch = $domain = mysql_escape_string(stripslashes($_POST['domain']));
if(!strstr($domain, "%"))
$domainsearch = "%$domain%";
if(intval($domain) > 0)
$domainsearch = "";
$query = "select `users`.`id` as `id`, `domains`.`domain` as `domain` from `users`,`domains`
where `users`.`id`=`domains`.`memid` and
(`domains`.`domain` like '$domainsearch' or `domains`.`id`='$domain') and
`domains`.`deleted`=0 and `users`.`deleted`=0 and
`users`.`verified`=1
group by `users`.`id` limit 100";
$res = mysql_query($query);
if(mysql_num_rows($res) >= 1) { ?>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="5" class="title"><?=_("Select Specific Account Details")?></td>
</tr>
<?
while($row = mysql_fetch_assoc($res))
{ ?>
<tr>
<td class="DataTD"><?=_("Domain")?>:</td>
<td class="DataTD"><a href="account.php?id=43&userid=<?=$row['id']?>"><?=$row['domain']?></a></td>
</tr>
<? } if(mysql_num_rows($res) >= 100) { ?>
<tr>
<td class="DataTD" colspan="2"><?=_("Only the first 100 rows are displayed.")?></td>
</tr>
<? } else { ?>
<tr>
<td class="DataTD" colspan="2"><? printf(_("%s rows displayed."), mysql_num_rows($res)); ?></td>
</tr>
<? } ?>
</table><br><br>
<? } elseif(mysql_num_rows($res) == 1) {
$row = mysql_fetch_assoc($res);
$_GET['userid'] = $row['id'];
} else {
// printf(_("No domains found matching %s"), $email);
}
$query = "select `orgid`,`domain` from `orgdomains` where `domain` like '$domainsearch' or `id`='$domain' limit 100";
$res = mysql_query($query);
if(mysql_num_rows($res) >= 1) { ?>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="5" class="title"><?=_("Select Specific Account Details")?></td>
</tr>
<?
while($row = mysql_fetch_assoc($res))
{ ?>
<tr>
<td class="DataTD"><?=_("Domain")?>:</td>
<td class="DataTD"><a href="account.php?id=26&orgid=<?=$row['orgid']?>"><?=$row['domain']?></a></td>
</tr>
<? } if(mysql_num_rows($res) >= 100) { ?>
<tr>
<td class="DataTD" colspan="2"><?=_("Only the first 100 rows are displayed.")?></td>
</tr>
<? } else { ?>
<tr>
<td class="DataTD" colspan="2"><? printf(_("%s rows displayed."), mysql_num_rows($res)); ?></td>
</tr>
<? } ?>
</table><br><br>
<? } elseif(mysql_num_rows($res) == 1) {
$row = mysql_fetch_assoc($res);
$_GET['userid'] = $row['id'];
} else {
printf(_("No domains found matching %s"), $email);
}
}
if(intval($_GET['userid']) > 0)
{
header("location: account.php?id=43&userid=".$_GET['userid']);
exit;
}
?>