Changing the way Add Users works in a WSS Site
If you have both SPS and WSS you may have noticed that when you add users in a SPS area you can do lookups into AD while in a WSS Site you have to use your address book (which in my opinion is less than useful). However, if you have both SPS and WSS installed you can modify WSS so that you can do AD lookups also.
First, make a copy of AclInv.aspx located in the
C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033
folder (make changes to the directory as needed). Then make the changes listed below:
1) Inside the <SCRIPT language="JavaScript"> tag towards the top of the file add:
var L_ADLookup_TXT = "Select Users and Groups";
2) After the last <script> ... </script> block add:
<script language="javascript">
function UpdatePickerSelection(LabelSelectedUserID, rv) {
if (rv != null && 3 == rv.length && 1 == rv[2])
{
var lbSelectedUser = document.all.item(LabelSelectedUserID);
var fReplace = false;
if(rv[0] != null && rv[0].length > 0)
{
if (fReplace)
{
lbSelectedUser.innerText = rv[0];
}
else
{
text = lbSelectedUser.innerText;
if (text == L_DefaultEditText_TXT)
{
text="";
}
if (text.length>0)
{
lastCharacter = text.charAt(text.length - 1);
if (lastCharacter != ',' && lastCharacter != ';')
{
text += ',';
}
}
lbSelectedUser.innerText = text + rv[0];
}
}
else
{
if (fReplace)
{
lbSelectedUser.innerText = '';
}
}
}
}
function UserPickerPopupDialog(args, sDialogUrl, sFeatures)
{
var rv = window.showModalDialog(sDialogUrl, args, sFeatures);
if (rv != null && 3 == rv.length && 1 == rv[2])
{
document.all.item('users_AccountNames').value = rv[0];
document.all.item('users_SIDs').value = rv[1];
document.all.item('users_Change_').value = 'Changed';
}
return rv;
}
function UserPickerPopup_users()
{
var sPopupUrl = '\/_layouts\/1033\/UserPicker.aspx?NameFormat=NT4&SelectionMode=True&&AccountType=User%2cSecGroup&TitleLocId=CategorySecurityAdd_NewRoleMembers_PeoplePicker_Title_Text&DescriptionLocId=CategorySecurityAdd_NewRoleMembers_PeoplePicker_Description_Text';
var sDialogUrl = '\/_layouts\/1033\/PickerContainer.aspx?TitleLocId=CategorySecurityAdd_NewRoleMembers_PeoplePicker_Title_Text';
var sSelectedUser = document.all.item('users_AccountNames').value;
var sFeatures='resizable: yes; status: no; scroll: no; help: no; dialogWidth : 536pt; dialogHeight : 395pt;';
var args = new Array(sSelectedUser, sPopupUrl);
var rv=UserPickerPopupDialog(args, sDialogUrl, sFeatures);
return rv;
}
</script>
3) Look for these lines
<script language=JavaScript>
if (browseris.ie4up && browseris.win32)
Before the <script> line add the following lines:
<input type="hidden" name="users_AccountNames" value="" />
<input type="hidden" name="users_SIDs" value="" />
<input type="hidden" name="users_Change_" value="" />
4) Finally replace the line
document.write("<input type=button value='" + L_AddressBook_TXT + "' id='AddrBookID' onclick='javascript:AddrBook()'><br>");
with
document.write("<input type=button value='" + L_ADLookup_TXT + "' id='AddrBookID' onclick=\"var rv=UserPickerPopup_users(); UpdatePickerSelection('users', rv); return false;\"><br>");
Save the file, restart IIS, and you should be good to go!