License Public Domain
Lines 186
Keywords
asp.net (1) data zoom (17) membership (1) nvelocity (17) sharepoint (20) velocity (16)
Permissions
Viewable by Everyone
Editable by jeremyluerkens's Friends and "SharePoint Data Zoom Web Part Community" Group Administrators
Hide
Don't get spied on – We respect your privacy and provide numerous options to protect it. Join Siafoo Now or Learn More

Membership Directory using SharePoint Data Zoom Extension for ASP.NET Membership Atom Feed 0

In Brief Membership Rolodex script provided for SharePoint Data Zoom Extension for ASP.NET Membership. This script provides you with a filterable and sortable directory of all membership accounts. SharePoint Data Zoom Web Part Extensions for ASP.NET Membership required.... more
# 's
  1#*
2 * Script: Membership Directory
3 * Publsiher: SharePoint Solutions
4 * Version: 1.0
5 *#
6
7#macro( showDate $dateTime )
8 <span title="${dateTime}" style="cursor:pointer">${dateTime.ToString("d")}</span>
9#end
10
11## Get search inputs
12#set( $searchValue = $form.get_item("SearchValue") )
13#set( $searchTypeName = $form.get_item("SearchTypeName") )
14#set( $rolodex = $form.get_item("rolodex") )
15#set( $membershipWildcard = $MembershipUtility.GetWildcard() )
16
17## Get paging attributes
18#set( $pageIndex = $Strings.ConvertToInt($form.get_item("pageIndex"), 0) )
19#set( $pageSize = $Strings.ConvertToInt($form.get_item("pageSize"), 15) )
20
21## Add filter terms
22#if( !$Strings.IsNullOrEmpty($rolodex) )
23
24 #if( $rolodex == "All" )
25 #set( $searchFilter = "" )
26 #set( $searchValue = "" )
27 #else
28 #set( $searchFilter = "$!{membershipWildcard}${rolodex}$!{membershipWildcard}" )
29 #set( $searchValue = "$rolodex" )
30 #end
31
32 ##Set the default search type
33 #set( $searchType = $MembershipSearchTypes_UserName )
34#else
35
36 #if( !$Strings.IsNullOrEmpty($searchValue) )
37 #set( $searchFilter = "$!{membershipWildcard}${searchValue}$!{membershipWildcard}" )
38 #end
39
40 #if( $searchTypeName == "$MembershipSearchTypes_Email" )
41 #set( $searchType = $MembershipSearchTypes_Email )
42 #else
43 #set( $searchType = $MembershipSearchTypes_UserName )
44 #end
45#end
46
47<script>
48<!--
49
50function applySearch()
51{
52 document.getElementById("pageIndex").value = "0";
53 document.getElementById("rolodex").value = "";
54 theForm.submit();
55}
56
57function setPageSize()
58{
59 document.getElementById("pageIndex").value = "0";
60 theForm.submit();
61}
62
63function gotoPageIndex(pageIndex)
64{
65 document.getElementById("pageIndex").value = pageIndex;
66 theForm.submit();
67}
68
69function gotoRolodex(rolodex)
70{
71 document.getElementById("pageIndex").value = "0";
72 document.getElementById("rolodex").value = rolodex;
73 theForm.submit();
74}
75
76-->
77</script>
78
79<div style="padding:10px;">
80
81<span class="ms-linksectionheader"><h3 class="ms-standardheader">Search</h3></span>
82<blockquote style="margin:10px">
83
84 <!-- Search area -->
85 <input type="hidden" name="pageIndex" value="$!{pageIndex}" />
86 <input type="hidden" name="rolodex" value="$!{rolodex}" />
87 <div class="ms-vb" style="padding:0px 0px 3px 5px">
88 Find a user whose <select name="SearchTypeName" class="ms-input">
89 <option value="$MembershipSearchTypes_UserName" #if($searchType == $MembershipSearchTypes_UserName) selected #end>User Name</option>
90 <option value="$MembershipSearchTypes_Email" #if($searchType == $MembershipSearchTypes_Email) selected #end>E-mail Address</option>
91 </select> contains
92 <input name="SearchValue" type="text" class="ms-input" value="$!{searchValue}" />
93 <a title="Find Employee" href="javascript:applySearch();">
94 <img title="Go Search" alt="Find User" src="/_layouts/images/gosearch.gif" style="border-width:0px;" />
95 </a>
96 </div>
97</blockquote>
98
99<span class="ms-linksectionheader"><h3 class="ms-standardheader">Rolodex</h3></span>
100<blockquote style="margin:10px">
101
102<!-- Rollodex -->
103<table cellpadding="2" cellspacing="2">
104 <tr>
105 #foreach($index in [0..10])
106 <td class="ms-vb"><a href="javascript:gotoRolodex('$index');">$index</a></td>
107 #end
108
109 #foreach($index in ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"])
110 <td class="ms-vb"><a href="javascript:gotoRolodex('$index');">$index</a></td>
111 #end
112
113 <td class="ms-vb"><a href="javascript:gotoRolodex('All');">All</a></td>
114 <tr>
115</table>
116</blockquote>
117
118
119#if( $searchFilter )
120
121## Get extranet users
122#if( $Strings.IsNullOrEmpty($searchFilter) )
123 #set( $extUsers = $MembershipUtility.GetUsers($pageIndex, $pageSize) )
124#else
125 #set( $extUsers = $MembershipUtility.GetUsers($pageIndex, $pageSize, $searchType, $searchFilter) )
126#end
127
128## Get the result data
129#set( $firstItemNumber = $pageIndex * $pageSize + 1 )
130#set( $lastItemNumber = $firstItemNumber + $extUsers.Count - 1 )
131#set( $prevPageIndex = $pageIndex - 1 )
132#set( $nextPageIndex = $pageIndex + 1 )
133
134<!-- Toolbar -->
135<table class="ms-menutoolbar" cellpadding="5" cellspacing="0" border="0" width="100%" >
136 <tr>
137 <td class="ms-toolbar"></td>
138
139 <td width="99%" class="ms-toolbar" nowrap><IMG SRC="/_layouts/images/blank.gif" width=1 height=18 alt=""></td>
140
141 <td class="ms-toolbar" nowrap="true">
142 <table cellpadding="0" cellspacing="0" border="0">
143 <tr>
144 #if( $pageIndex > 0 )
145 <td><img src="/_layouts/images/prev.gif" border="0" alt="Previous Page" onclick="gotoPageIndex($prevPageIndex);" /></td>
146 #end
147
148 <td class="ms-listheaderlabel" nowrap>&nbsp;${firstItemNumber}-${lastItemNumber}&nbsp;</td>
149
150 #if( $extUsers.Count == $pageSize )
151 <td><img src="/_layouts/1033/images/next.gif" border="0" alt="Next Page" onclick="gotoPageIndex($nextPageIndex);" /></td>
152 #end
153 </tr>
154 </table>
155 </td>
156
157 <td class=ms-separator>|</td>
158
159 <td class="ms-toolbar" nowrap="true">Show &nbsp;&nbsp;</td>
160 <td class="ms-toolbar" nowrap="true">
161 <select name="pageSize" onchange="setPageSize();">
162 <option value="5" #if($pageSize == 5) selected #end>5</option>
163 <option value="10"#if($pageSize == 10) selected #end>10</option>
164 <option value="15"#if($pageSize == 15) selected #end>15</option>
165 <option value="50"#if($pageSize == 50) selected #end>50</option>
166 <option value="100"#if($pageSize == 100) selected #end>100</option>
167 </select>
168 </td>
169
170 <td>&nbsp;&nbsp;&nbsp;</td>
171 </tr>
172</table>
173
174#set( $pageUrl = $serverVariables.get_item("PATH_INFO") )
175
176<!-- Results area -->
177#foreach($extUser in $extUsers)
178 #beforeall
179 <table class="ms-listviewtable" cellpadding="10" cellspacing="0" width="100%" border="0">
180 <tr class="ms-viewheadertr">
181 <th class="ms-vh2-nofilter">Username</th>
182 <th class="ms-vh2-nofilter">E-mail</th>
183 <th class="ms-vh2-nofilter">Created</th>
184 <th class="ms-vh2-nofilter">Last Login</th>
185 <th class="ms-vh2-nofilter">Pwd Changed</th>
186 <th class="ms-vh2-nofilter">Is Approved</th>
187 <th class="ms-vh2-nofilter">Locked Out</th>
188 </tr>
189 #odd
190 <tr class="">
191 #even
192 <tr class="ms-alternating">
193 #each
194 <td class="ms-vb2">$extUser.AccountName</td>
195 <td class="ms-vb2"><a href="mailto:$!{extUser.Email}">$!{extUser.Email}</a></td>
196 <td class="ms-vb2" style="text-align:center">
197 #set( $extDate = $extUser.CreationDate )
198 #showDate( $extDate )
199 </td>
200 <td class="ms-vb2" style="text-align:center">
201 #set( $extDate = $extUser.LastLoginDate)
202 #showDate( $extDate )
203 </td>
204 <td class="ms-vb2" style="text-align:center">
205 #set( $extDate = $extUser.LastPasswordChangedDate)
206 #showDate( $extDate )
207 </td>
208 <td class="ms-vb2" style="text-align:center">$!{extUser.IsApproved}</td>
209 <td class="ms-vb2" style="text-align:center">$!{extUser.IsLockedOut}</td>
210 #after
211 </tr>
212 #afterall
213 </table>
214 #nodata
215 No users found
216#end
217
218#end
219
220<div>

Membership Rolodex script provided for SharePoint Data Zoom Extension for ASP.NET Membership. This script provides you with a filterable and sortable directory of all membership accounts. SharePoint Data Zoom Web Part Extensions for ASP.NET Membership required.

http://www.siafoo.net/image/154