-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateuser.asp
71 lines (58 loc) · 1.48 KB
/
updateuser.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!-- #include file="common.asp" -->
<%
Dim obj
strUser = request("user")
strAction = request("action")
strContainer = request("container")
select case strAction
case "edit"
Set obj = GetObject("LDAP://" & ldapEncode(strUser))
updateInfo "sAMAccountName"
case "new"
Set objContainer = GetObject("LDAP://" & ldapEncode(strContainer))
Set obj = objContainer.Create("user", "cn=" & request("sAMAccountName"))
obj.SetInfo
updateInfo "sAMAccountName"
strUser = "CN=" & request("sAMAccountName") & "," & strContainer
end select
updateInfo "givenName"
updateInfo "initials"
updateInfo "sn"
updateInfo "displayName"
updateInfo "description"
updateInfo "physicalDeliveryOfficeName"
updateInfo "mail"
updateInfo "wWWHomePage"
updateInfo "otherTelephone"
updateInfo "streetAddress"
updateInfo "l"
updateInfo "st"
updateInfo "postalCode"
updateInfo "c"
updateInfo "userWorkstations"
updateInfo "profilePath"
updateInfo "scriptPath"
updateInfo "homeDrive"
updateInfo "homePhone"
updateInfo "pager"
updateInfo "mobile"
updateInfo "facsimileTelephoneNumber"
updateInfo "ipPhone"
updateInfo "title"
updateInfo "department"
updateInfo "company"
updateInfo "manager"
obj.SetInfo
Set obj = Nothing
sub updateInfo(field)
dim strTemp
strTemp = request(field)
if not (isNull(strTemp) or isEmpty(strTemp) or len(strTemp) = 0) then
obj.Put field, strTemp
else
obj.PutEx ADS_PROPERTY_CLEAR, field, vbNullString
obj.SetInfo
end if
end sub
response.redirect "userdetails.asp?user=" & MakeURL(strUser)
%>