summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-12-08 11:09:16 +0100
committerINOPIAE <inopiae@cacert.org>2013-12-08 11:09:16 +0100
commita8b2dbd698b3bd4ccaa1b11c6e1879a4b1e68d5b (patch)
tree7229a1c64728e93e8fb1d6056171a86b8ba967fb
parenta9aaceb1048d530f2ab5f43228886dc898a651fb (diff)
downloadcacert-devel-a8b2dbd698b3bd4ccaa1b11c6e1879a4b1e68d5b.tar.gz
cacert-devel-a8b2dbd698b3bd4ccaa1b11c6e1879a4b1e68d5b.tar.xz
cacert-devel-a8b2dbd698b3bd4ccaa1b11c6e1879a4b1e68d5b.zip
bug 1138: added fuction to get_user_data
-rw-r--r--includes/notary.inc.php17
-rw-r--r--pages/account/43.php6
2 files changed, 21 insertions, 2 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 0d270b9..34c7960 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1150,3 +1150,20 @@ function valid_ticket_number($ticketno){
}
return false;
}
+
+/**
+ * get_user_data()
+ * returns all data of to an account given by the id
+ * @param mixed $userid - account id
+ * @param mixed $deleted - states is the account is deleted, default = 0
+ * @return
+ */
+function get_user_data($userid, $deleted=0){
+ $userid = intval($userid);
+ $filter='';
+ if (0==$deleted) {
+ $filter='and `users`.`deleted`=0';
+ }
+ $query = "select * from `users` where `users`.`id`='$userid' ".$filter;
+ return mysql_query($query);
+} \ No newline at end of file
diff --git a/pages/account/43.php b/pages/account/43.php
index cad5423..177d261 100644
--- a/pages/account/43.php
+++ b/pages/account/43.php
@@ -103,8 +103,10 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
if(intval($_REQUEST['userid']) > 0)
{
$userid = intval($_REQUEST['userid']);
- $query = "select * from `users` where `users`.`id`='$userid' and `users`.`deleted`=0";
- $res = mysql_query($query);
+// comment to be deleted before release
+// $query = "select * from `users` where `users`.`id`='$userid' and `users`.`deleted`=0";
+// $res = mysql_query($query);
+ $res =get_user_data($userid);
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!");