diff options
Diffstat (limited to 'pages/account')
-rw-r--r-- | pages/account/43.php | 78 | ||||
-rw-r--r-- | pages/account/57.php | 107 | ||||
-rw-r--r-- | pages/account/58.php | 61 |
3 files changed, 209 insertions, 37 deletions
diff --git a/pages/account/43.php b/pages/account/43.php index ca11f03..234e01a 100644 --- a/pages/account/43.php +++ b/pages/account/43.php @@ -55,14 +55,14 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); } else { // $email contains non-digits ==> search for mail addresses // Be defensive here (outer join) if primary mail is not listed in email table - $query = "select `users`.`id` as `id`, `email`.`email` as `email` + $query = "select `users`.`id` as `id`, `email`.`email` as `email` from `users` left outer join `email` on (`users`.`id`=`email`.`memid`) - where (`email`.`email` like '$emailsearch' + where (`email`.`email` like '$emailsearch' or `users`.`email` like '$emailsearch') and `users`.`deleted`=0 group by `users`.`id` limit 100"; } - // bug-975 ted+uli changes --- end + // bug-975 ted+uli changes --- end $res = mysql_query($query); if(mysql_num_rows($res) > 1) { ?> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> @@ -175,6 +175,10 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <input type="submit" value="Go"></form></nobr></td> </tr> <tr> + <td class="DataTD"><?=_("CCA accepted")?>:</td> + <td class="DataTD"><a href="account.php?id=57&userid=<?=intval($row['id'])?>"><?=intval(get_user_agreement_status($row['id'])) ? _("Yes") : _("No") ?></a></td> + </tr> + <tr> <td class="DataTD"><?=_("Trainings")?>:</td> <td class="DataTD"><a href="account.php?id=55&userid=<?=intval($row['id'])?>">show</a></td> </tr> @@ -340,7 +344,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <td colspan="2" class="title"><?=_("Account State")?></td> </tr> -<? +<? // --- bug-975 begin --- // potential db inconsistency like in a20110804.1 // Admin console -> don't list user account @@ -361,7 +365,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); 4. email.email = primary-email (???) or'd not covered by admin console find user routine, but may block users login 5. users.verified = 0|1 - further "special settings" + further "special settings" 6. users.locked (setting displayed in display form) 7. users.assurer_blocked (setting displayed in display form) @@ -372,7 +376,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); 1. users.verified = 1 2. users.deleted = 0 3. users.locked = 0 - 4. users.email = primary-email + 4. users.email = primary-email --- Assurer, assure someone find user query select * from `users` where `email`='".mysql_escape_string(stripslashes($_POST['email']))."' @@ -386,11 +390,11 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); 1. email.hash = '' Yes No No 2. email.deleted = 0 Yes No No 3. users.deleted = 0 Yes Yes Yes - 4. users.verified = 1 No Yes No + 4. users.verified = 1 No Yes No 5. users.locked = 0 No Yes No 6. users.email = prim-email No Yes Yes 7. email.email = prim-email Yes No No - + full usable account needs all 7 requirements fulfilled so if one setting isn't set/cleared there is an inconsistency either way if eg email.email is not avail, admin console cannot open user info @@ -434,7 +438,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); } - + if ($drow) { $eemail = $drow['eemail']; $edeleted = $drow['edeleted']; @@ -453,11 +457,11 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); } if ($edeleted!=0) { $inconsistency += 8; - $inccause .= (empty($inccause)?"":"<br>")._("Email record set deleted"); + $inccause .= (empty($inccause)?"":"<br>")._("Email record set deleted"); } if ($ehash!='') { $inconsistency += 16; - $inccause .= (empty($inccause)?"":"<br>")._("Email record hash not unset"); + $inccause .= (empty($inccause)?"":"<br>")._("Email record hash not unset"); } } else { $inconsistency = 32; @@ -476,14 +480,14 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); "operations and needs to be fixed manually through arbitration/critical ". "team.")?> </td> - </tr> + </tr> <? } // --- bug-975 end --- ?> </table> <br> -<? +<? // End - Debug infos ?> @@ -512,12 +516,12 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $total = $drow['total']; - + $maxexpire = "0000-00-00 00:00:00"; if ($drow['maxexpire']) { $maxexpire = $drow['maxexpire']; } - + if($total > 0) { $query = "select COUNT(*) as `valid` from `domains` inner join `domaincerts` @@ -528,7 +532,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $valid = $drow['valid']; - + $query = "select COUNT(*) as `expired` from `domains` inner join `domaincerts` on `domains`.`id` = `domaincerts`.`domid` @@ -537,7 +541,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; - + $query = "select COUNT(*) as `revoked` from `domains` inner join `domaincerts` on `domains`.`id` = `domaincerts`.`domid` @@ -570,12 +574,12 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $total = $drow['total']; - + $maxexpire = "0000-00-00 00:00:00"; if ($drow['maxexpire']) { $maxexpire = $drow['maxexpire']; } - + if($total > 0) { $query = "select COUNT(*) as `valid` from `emailcerts` @@ -585,7 +589,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $valid = $drow['valid']; - + $query = "select COUNT(*) as `expired` from `emailcerts` where `memid` = '".intval($row['id'])."' @@ -593,7 +597,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; - + $query = "select COUNT(*) as `revoked` from `emailcerts` where `memid` = '".intval($row['id'])."' @@ -625,12 +629,12 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $total = $drow['total']; - + $maxexpire = "0000-00-00 00:00:00"; if ($drow['maxexpire']) { $maxexpire = $drow['maxexpire']; } - + if($total > 0) { $query = "select COUNT(*) as `valid` from `gpg` @@ -639,7 +643,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $valid = $drow['valid']; - + $query = "select COUNT(*) as `expired` from `emailcerts` where `memid` = '".intval($row['id'])."' @@ -647,7 +651,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; - + ?> <td class="DataTD"><?=intval($total)?></td> <td class="DataTD"><?=intval($valid)?></td> @@ -664,7 +668,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); </tr> <tr> - <td class="DataTD"><?=_("Org Server")?>:</td> + <td class="DataTD"><a href="account.php?id=58&userid=<?=intval($row['id'])?>"><?=_("Org Server")?></a>:</td> <? $query = "select COUNT(*) as `total`, MAX(`orgcerts`.`expire`) as `maxexpire` @@ -674,12 +678,12 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $total = $drow['total']; - + $maxexpire = "0000-00-00 00:00:00"; if ($drow['maxexpire']) { $maxexpire = $drow['maxexpire']; } - + if($total > 0) { $query = "select COUNT(*) as `valid` from `orgdomaincerts` as `orgcerts` inner join `org` @@ -690,7 +694,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $valid = $drow['valid']; - + $query = "select COUNT(*) as `expired` from `orgdomaincerts` as `orgcerts` inner join `org` on `orgcerts`.`orgid` = `org`.`orgid` @@ -699,7 +703,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; - + $query = "select COUNT(*) as `revoked` from `orgdomaincerts` as `orgcerts` inner join `org` on `orgcerts`.`orgid` = `org`.`orgid` @@ -734,12 +738,12 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $total = $drow['total']; - + $maxexpire = "0000-00-00 00:00:00"; if ($drow['maxexpire']) { $maxexpire = $drow['maxexpire']; } - + if($total > 0) { $query = "select COUNT(*) as `valid` from `orgemailcerts` as `orgcerts` inner join `org` @@ -750,7 +754,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $valid = $drow['valid']; - + $query = "select COUNT(*) as `expired` from `orgemailcerts` as `orgcerts` inner join `org` on `orgcerts`.`orgid` = `org`.`orgid` @@ -759,7 +763,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; - + $query = "select COUNT(*) as `revoked` from `orgemailcerts` as `orgcerts` inner join `org` on `orgcerts`.`orgid` = `org`.`orgid` @@ -829,7 +833,7 @@ function showassuredto() <td class="DataTD"><?=intval($drow['points'])?></td> <td class="DataTD"><?=sanitizeHTML($drow['location'])?></td> <td class="DataTD"><?=sanitizeHTML($drow['method'])?></td> - <td class="DataTD"><a href="account.php?id=43&userid=<?=intval($drow['to'])?>&assurance=<?=intval($drow['id'])?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=_("Are you sure you want to revoke this assurance?")?>');"><?=_("Revoke")?></a></td> + <td class="DataTD"><a href="account.php?id=43&userid=<?=intval($drow['to'])?>&assurance=<?=intval($drow['id'])?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=sprintf(_("Are you sure you want to revoke the assurance with ID "%s"?"),$drow['id'])?>');"><?=_("Revoke")?></a></td> </tr> <? } ?> <tr> @@ -875,7 +879,7 @@ function showassuredby() <td class="DataTD"><?=$drow['points']?></td> <td class="DataTD"><?=$drow['location']?></td> <td class="DataTD"><?=$drow['method']?></td> - <td class="DataTD"><a href="account.php?id=43&userid=<?=$drow['from']?>&assurance=<?=$drow['id']?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=_("Are you sure you want to revoke this assurance?")?>');"><?=_("Revoke")?></a></td> + <td class="DataTD"><a href="account.php?id=43&userid=<?=$drow['from']?>&assurance=<?=$drow['id']?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=sprintf(_("Are you sure you want to revoke the assurance with ID "%s"?"),$drow['id'])?>');"><?=_("Revoke")?></a></td> </tr> <? } ?> <tr> @@ -886,7 +890,7 @@ function showassuredby() </table> <? } ?> <br><br> -<? } } +<? } } if(isset($_GET['shownotary'])) { switch($_GET['shownotary']) { diff --git a/pages/account/57.php b/pages/account/57.php new file mode 100644 index 0000000..76eee27 --- /dev/null +++ b/pages/account/57.php @@ -0,0 +1,107 @@ +<? /* + 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 +*/ ?> +<? + include_once($_SESSION['_config']['filepath'].'/includes/notary.inc.php'); + + if ($_SESSION['profile']['admin'] != 1 || !array_key_exists('userid',$_REQUEST) || intval($_REQUEST['userid']) < 1) { + + echo _('You do not have access to this page'); + + } else { + $user_id = intval($_REQUEST['userid']); + $query = "select * from `users` where `id`='$user_id' and `users`.`deleted`=0"; + $res = mysql_query($query); + if(mysql_num_rows($res) <= 0) + { + echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!"); + } else { + $row = mysql_fetch_assoc($res); +?> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td colspan="5" class="title"><?=_('CCA agreement of').' '.sanitizeHTML($row['fname']).' '.sanitizeHTML($row['mname']).' '.sanitizeHTML($row['lname'])?></td> + </tr> +</table> + + +<br> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td class="DataTD"><b><?=_('CCA type')?></b></td> + <td class="DataTD"><b><?=_('Date')?></b></td> + <td class="DataTD"><b><?=_('Method')?></b></td> + <td class="DataTD"><b><?=_('Type')?></b></td> + </tr> +<? + $data=get_first_user_agreement($user_id,1); + if (!isset($data['active'])){ + $type=''; + }else{ + $type=_('active'); + } +?> + <tr> + <td class="DataTD"><?=_('First active CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +<? + $data=get_first_user_agreement($user_id,0); + if (!isset($data['active'])){ + $type=""; + }else{ + $type=_('passive'); + } +?> + <tr> + <td class="DataTD"><?=_('First passive CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +<? + $data=get_last_user_agreement($user_id); + if (!isset($data['active'])){ + $type=""; + }elseif($data['active']==1){ + $type=_('active'); + }else{ + $type=_('passive'); + } +?> + <tr> + <td class="DataTD"><?=_('Last CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +</table> +<br> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> +<? + if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) { +?> + <tr><td colspan="3" class="DataTD"><a href="account.php?id=43&userid=<?=$user_id ?>">back</a></td></tr> +<? } +?> </table> +<? + } +} +?> diff --git a/pages/account/58.php b/pages/account/58.php new file mode 100644 index 0000000..1f6b1a0 --- /dev/null +++ b/pages/account/58.php @@ -0,0 +1,61 @@ +<? /* + 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 ($_SESSION['profile']['admin'] != 1 || !array_key_exists('userid',$_REQUEST) || intval($_REQUEST['userid']) < 1) { + echo _('You do not have access to this page'); +} else { + $user_id = intval($_REQUEST['userid']); + $query = "select `users`.`fname`, `users`.`mname`, `users`.`lname` from `users` where `id`='$user_id' and `users`.`deleted`=0"; + $res = mysql_query($query); + if(mysql_num_rows($res) != 1){ + echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!"); + } else { + if ($row = mysql_fetch_assoc($res)){ + $username=sanitizeHTML($row['fname']).' '.sanitizeHTML($row['mname']).' '.sanitizeHTML($row['lname']); + $query = "select `orginfo`.`o`, `org`.`masteracc` + FROM `orginfo`, `org` + WHERE `orginfo`.`id` = `org`.`orgid` + AND `org`.`memid`='$user_id' order by `orginfo`.`o`"; + $res1 = mysql_query($query);?> + <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"><? + if (mysql_num_rows($res1) <= 0) {?> + <tr> + <td colspan="2" class="title"><?=sprintf(_('%s is not listed as Organisation Administrator'), $username)?></td> + </tr> + <?}else{?> + <tr> + <td colspan="2" class="title"><?=sprintf(_('%s is listed as Organisation Administrator for:'), $username)?></td> + </tr> + <tr> + <td class="DataTD"><b><?=_('Organisation')?></b></td> + <td class="DataTD"><b><?=_('Masteraccount')?></b></td> + </tr><? + while($drow = mysql_fetch_assoc($res1)){?> + <tr> + <td class="DataTD"><?=$drow['o']?></td> + <td class="DataTD"><?=$drow['masteracc'] ? _("Yes") : _("No") ?></td> + </tr> + <?} + } + ?></table> +<? }else{ + echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!"); + } + } +} +?> |