diff options
author | Adam Young <ayoung@redhat.com> | 2010-06-16 19:39:46 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-06-17 14:41:47 -0400 |
commit | 5808c857cb5f62d6b8a52cfd07e06d984debb085 (patch) | |
tree | 3971eef72ad3bc51cd0cd92b835dc70da8cd4023 | |
parent | 3c9096f97c30e8d6afcbce251ef130d526991a62 (diff) | |
download | freeipa-5808c857cb5f62d6b8a52cfd07e06d984debb085.tar.gz freeipa-5808c857cb5f62d6b8a52cfd07e06d984debb085.tar.xz freeipa-5808c857cb5f62d6b8a52cfd07e06d984debb085.zip |
use json call to populate search table.
-rw-r--r-- | web/user-find.inc | 6 | ||||
-rw-r--r-- | web/user.js | 28 |
2 files changed, 23 insertions, 11 deletions
diff --git a/web/user-find.inc b/web/user-find.inc index a3cae73f2..afb4d672b 100644 --- a/web/user-find.inc +++ b/web/user-find.inc @@ -5,13 +5,15 @@ }); </script> -<div><input type="text"/><input id="userquery" type="submit" value="find" />...............................................<a href="ipa.xhtml?bodycontent=user-edit.inc">New User</a></div> +<div><input id="queryFilter" type="text"/><input id="userquery" type="submit" value="find" />...............................................<a href="ipa.xhtml?bodycontent=user-edit.inc">New User</a></div> <div > <table id="usersTable" border="1"> <thead> <tr> - <th>User Name</th> + <th>Name</th> + <th>Login</th> + <th>UID</th> <th>Email Address</th> <th>Phone</th> <th>Job Title</th> diff --git a/web/user.js b/web/user.js index 7597bff00..909870fec 100644 --- a/web/user.js +++ b/web/user.js @@ -2,8 +2,11 @@ function setupUserSearch(){ $("#userquery").click(function(){ + var queryFilter = $("#queryFilter").val(); - var jsonData = {"method":"user_find","params":[["kfrog"],{}],"id":0} + + var jsonData = {"method":"user_find","params":[[queryFilter],{"all":"true"}],"id":0} + var jsonRequest = JSON.stringify(jsonData); $.ajax({ @@ -13,19 +16,26 @@ $("#userquery").click(function(){ }, type: "POST", url: "/ipa/json", + //For development without a webserver, just fetch a static file + //url: "sampledata/userlist.json", processData: false, data: jsonRequest, dataType: "json", success: function(json){ - $('#usersTable tbody:last').append('<tr>' - +'<td>' + json.result.result[0].uid + '</td>' - +'<td>' + json.result.result[0].givenname + '</td>' - +'<td>' + json.result.result[0].sn + '</td>' - +'<td>' + json.result.result[0].homedirectory + '</td>' - +'<td>' + json.result.result[0].loginshell + '</td>' + for (var index = 0; index != json.result.result.length; index++){ + $('#usersTable tbody:last').append + ('<tr>' + +'<td>' + json.result.result[index].cn + '</td>' + +'<td>' + json.result.result[index].uid + '</td>' + +'<td>' + json.result.result[index].uidnumber + '</td>' + +'<td>' + json.result.result[index].mail + '</td>' + +'<td> Phone number is not yet in LDAP' + '</td>' + +'<td> Job Title' + '</td>' + +'<td> Actions go here</td>' - +'</tr>'); - } + +'</tr>'); + } + } }); }); }
\ No newline at end of file |