cacert-webdb/pages/account/49.php

104 lines
3.7 KiB
PHP
Raw Normal View History

2004-12-07 12:35:40 +00:00
<? /*
2008-04-06 19:45:09 +00:00
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
2004-12-07 12:35:40 +00:00
2008-04-06 19:45:09 +00:00
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.
2004-12-07 12:35:40 +00:00
2008-04-06 19:45:09 +00:00
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.
2004-12-07 12:35:40 +00:00
2008-04-06 19:45:09 +00:00
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
2004-12-07 12:35:40 +00:00
*/ ?>
<?
2008-09-05 15:49:47 +00:00
$userid=0; if(array_key_exists('userid',$_GET)) $userid=intval($_GET['userid']);
if($userid <= 0)
2004-12-07 12:35:40 +00:00
{
2005-12-04 21:04:05 +00:00
$domainsearch = $domain = mysql_escape_string(stripslashes($_POST['domain']));
if(!strstr($domain, "%"))
$domainsearch = "%$domain%";
if(preg_match("/^\d+$/",$domain))
2005-12-04 21:04:05 +00:00
$domainsearch = "";
2010-08-05 10:41:03 +00:00
$query = "select `users`.`id` as `id`, `domains`.`domain` as `domain`, `domains`.`id`as `domid` from `users`,`domains`
2005-12-04 21:04:05 +00:00
where `users`.`id`=`domains`.`memid` and
(`domains`.`domain` like '$domainsearch' or `domains`.`id`='$domain') and
`domains`.`deleted`=0 and `users`.`deleted`=0 and
2004-12-07 13:21:06 +00:00
`users`.`verified`=1
2004-12-07 12:35:40 +00:00
group by `users`.`id` limit 100";
$res = mysql_query($query);
2005-12-04 21:04:05 +00:00
if(mysql_num_rows($res) >= 1) { ?>
2004-12-07 12:35:40 +00:00
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="5" class="title"><?=_("Select Specific User Account Details")?></td>
2004-12-07 12:35:40 +00:00
</tr>
<?
while($row = mysql_fetch_assoc($res))
{ ?>
<tr>
<td class="DataTD"><?=_("Domain")?>:</td>
2010-08-05 10:41:03 +00:00
<td class="DataTD"><?=$row['domid']?></td>
2008-09-03 17:43:31 +00:00
<td class="DataTD"><a href="account.php?id=43&amp;userid=<?=$row['id']?>"><?=sanitizeHTML($row['domain'])?></a></td>
2004-12-07 12:35:40 +00:00
</tr>
<? } if(mysql_num_rows($res) >= 100) { ?>
<tr>
2010-08-05 10:41:03 +00:00
<td class="DataTD" colspan="3"><?=_("Only the first 100 rows are displayed.")?></td>
2004-12-07 12:35:40 +00:00
</tr>
<? } else { ?>
<tr>
2010-08-05 10:41:03 +00:00
<td class="DataTD" colspan="3"><? printf(_("%s rows displayed."), mysql_num_rows($res)); ?></td>
2004-12-07 12:35:40 +00:00
</tr>
<? } ?>
</table><br><br>
2005-12-04 21:04:05 +00:00
<? } elseif(mysql_num_rows($res) == 1) {
$row = mysql_fetch_assoc($res);
2008-09-03 17:43:31 +00:00
$_GET['userid'] = intval($row['id']);
2005-12-04 21:04:05 +00:00
} else {
2008-11-23 17:06:23 +00:00
printf(_("No personal domains found matching %s"), sanitizeHTML($domain));
2005-12-04 21:04:05 +00:00
}
2010-08-05 10:41:03 +00:00
$query = "select `orgid`,`domain`,`id` from `orgdomains` where `domain` like '$domainsearch' or `id`='$domain' limit 100";
2005-12-04 21:04:05 +00:00
$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 Organisation Account Details")?></td>
2005-12-04 21:04:05 +00:00
</tr>
<?
while($row = mysql_fetch_assoc($res))
{ ?>
<tr>
<td class="DataTD"><?=_("Domain")?>:</td>
2010-08-05 10:41:03 +00:00
<td class="DataTD"><?=$row['id']?></td>
2008-11-23 16:23:17 +00:00
<td class="DataTD"><a href="account.php?id=26&amp;orgid=<?=intval($row['orgid'])?>"><?=sanitizeHTML($row['domain'])?></a></td>
2005-12-04 21:04:05 +00:00
</tr>
<? } if(mysql_num_rows($res) >= 100) { ?>
<tr>
2010-08-05 10:41:03 +00:00
<td class="DataTD" colspan="3"><?=_("Only the first 100 rows are displayed.")?></td>
2005-12-04 21:04:05 +00:00
</tr>
<? } else { ?>
<tr>
2010-08-05 10:41:03 +00:00
<td class="DataTD" colspan="3"><? printf(_("%s rows displayed."), mysql_num_rows($res)); ?></td>
2005-12-04 21:04:05 +00:00
</tr>
<? } ?>
</table><br><br>
2004-12-07 12:35:40 +00:00
<? } elseif(mysql_num_rows($res) == 1) {
$row = mysql_fetch_assoc($res);
2008-09-03 17:43:31 +00:00
$_GET['userid'] = intval($row['id']);
2004-12-07 12:35:40 +00:00
} else {
2008-11-23 17:06:23 +00:00
printf(_("No organisational domains found matching %s"), sanitizeHTML($domain));
2004-12-07 12:35:40 +00:00
}
}
2008-09-05 15:49:47 +00:00
if($userid > 0)
2004-12-07 12:35:40 +00:00
{
2008-09-03 17:43:31 +00:00
header("location: account.php?id=43&userid=".intval($_GET['userid']));
2004-12-07 12:35:40 +00:00
exit;
}
?>