| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : users.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : July 4, 2004 |
|---|
| 6 | Last Updated : July 12, 2006 |
|---|
| 7 | History : Fixed bugs related to sendnotifications change (rkc 8/3/05) |
|---|
| 8 | Removed mappings (rkc 8/27/05) |
|---|
| 9 | Handle requireconfirmation (rkc 7/12/06) |
|---|
| 10 | Purpose : |
|---|
| 11 | ---> |
|---|
| 12 | |
|---|
| 13 | <cfparam name="url.search" default=""> |
|---|
| 14 | <cfparam name="form.search" default="#url.search#"> |
|---|
| 15 | |
|---|
| 16 | <cfmodule template="../tags/layout.cfm" templatename="admin" title="User Editor"> |
|---|
| 17 | |
|---|
| 18 | <!--- handle deletions ---> |
|---|
| 19 | <cfif isDefined("form.mark") and len(form.mark)> |
|---|
| 20 | <cfloop index="id" list="#form.mark#"> |
|---|
| 21 | <cfset application.galleon.user.deleteUser(id)> |
|---|
| 22 | </cfloop> |
|---|
| 23 | <cfoutput> |
|---|
| 24 | <p> |
|---|
| 25 | <b>User(s) deleted.</b> |
|---|
| 26 | </p> |
|---|
| 27 | </cfoutput> |
|---|
| 28 | </cfif> |
|---|
| 29 | |
|---|
| 30 | <!--- get users ---> |
|---|
| 31 | <cfset users = application.galleon.user.getUsers()> |
|---|
| 32 | |
|---|
| 33 | <cfif len(trim(form.search))> |
|---|
| 34 | <cfquery name="users" dbtype="query"> |
|---|
| 35 | select * |
|---|
| 36 | from users |
|---|
| 37 | where lower(username) like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#lcase(form.search)#%"> |
|---|
| 38 | or lower(emailaddress) like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#lcase(form.search)#%"> |
|---|
| 39 | </cfquery> |
|---|
| 40 | </cfif> |
|---|
| 41 | |
|---|
| 42 | <cfif application.galleon.settings.requireconfirmation> |
|---|
| 43 | <cfset list = "username,emailaddress,postcount,confirmed,datecreated"> |
|---|
| 44 | <cfelse> |
|---|
| 45 | <cfset list = "username,emailaddress,postcount,datecreated"> |
|---|
| 46 | </cfif> |
|---|
| 47 | |
|---|
| 48 | <cfoutput> |
|---|
| 49 | <p> |
|---|
| 50 | <form action="#cgi.script_name#?#cgi.query_string#" method="post"> |
|---|
| 51 | <input type="text" name="search" value="#form.search#"> <input type="submit" value="Filter"> |
|---|
| 52 | </form> |
|---|
| 53 | </p> |
|---|
| 54 | </cfoutput> |
|---|
| 55 | |
|---|
| 56 | <cfmodule template="../tags/datatable.cfm" |
|---|
| 57 | data="#users#" list="#list#" |
|---|
| 58 | editlink="users_edit.cfm" linkcol="username" linkval="username" label="User" linkappend="&search=#form.search#" /> |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | </cfmodule> |
|---|
| 62 | |
|---|
| 63 | <cfsetting enablecfoutputonly=false> |
|---|