Hi All,
I have some asp code that is using dll shareaccessext. dll and its methods via creaing its object. My code is as follows:
One exe file is also present in same folder as dll file and asp file.
The dll shareaccessext. dll is at server side.
This code is executed when clien access webpage from browser.
I am geting confused how javascript can access serverside dll file and its methods.
Its urgent plzzzzz
Thanks n Regards
Anu
I have some asp code that is using dll shareaccessext. dll and its methods via creaing its object. My code is as follows:
Code:
funcion getobj()
{
var obj = null;
var x = Request.ServerVariables("AUTH_TYPE"),
apppath = Request.ServerVariables("APPL_PHYSICAL_PATH").Item;
var xHeaderName,xHeaderValue = "";
var xHeaderPass = "";
var bHasPassword = true;
var isBasicAuth = (x == "Basic"), useBasicAuth = 0;
var isAdminSite = (apppath.indexOf("\\AdmPages") > 0);
try {
obj = new ActiveXObject("ShareAccess.ShareEnum");
obj.SetSiteData(Request.ServerVariables("SERVER_NAME"), Request.ServerVariables("LOCAL_ADDR") ,Request.ServerVariables("SERVER_PORT"));
useBasicAuth = obj.BasicAuth((isAdminSite) ? 1 : 2);
xHeaderName = obj.HeaderName;
}
catch (e)
{
useBasicAuth = -1;
xHeaderName = "";
}
if(obj == null)
{
Response.Redirect("/InternalSite/InternalError.asp?error_code=201")
return null;
}
if(useBasicAuth && isBasicAuth) {
xHeaderValue = new String(Request.ServerVariables("REMOTE_USER"));
xHeaderPass = new String(Request.ServerVariables("AUTH_PASSWORD"));
}
else if(x != "") //if not anonymous logon - use the iis impersonation
{
xHeaderValue = new String(Request.ServerVariables("REMOTE_USER"));
xHeaderPass = new String("whl_dummy_ntlm_password");
}
else if(xHeaderName != "") {
xHeaderValue = new String(Request.ServerVariables(xHeaderName).Item);
bHasPassword = false;
}
else {
xHeaderValue = new String(Request.ServerVariables("REMOTE_USER"))
}
try {
obj.SetSecurityInfo("FileAccess", Request.ServerVariables("HTTPS"), Request.ServerVariables("REQUEST_METHOD"));
if (bHasPassword == true) {
Retval = obj.SetUserDataFromHeaderUserPass(xHeaderValue, xHeaderPass);
}
else {
Retval = obj.SetUserDataFromHeader(xHeaderValue);
}
if(!Retval){
var i = xHeaderValue.indexOf(':');
if(i <= 0)i = xHeaderValue.length;
// Response.Write("Error logging on user " + xHeaderValue.substr(0,i));
if (apppath.indexOf("e-Gap")!=-1)
Response.Write("Error logging on user " + xHeaderValue.substr(0,i) + " - Wrong Credentials Supplied.");
else
Response.Write("Error logging on user " + xHeaderValue.substr(0,i) + " - Possible Misconfiguration Problem.");
Response.End();
}
}
catch(e){
Response.Write("Error " + e);
Response.End();
}
apppath = Request.ServerVariables("PATH_INFO").Item;
if(isAdminSite && (apppath.indexOf("novell_nt_login.asp") < 0) && !obj.IsAdminUser){
Response.Write("You have no permissions to configure Secure File Access Application.");
obj = null;
Response.End();
}
return obj;
}
The dll shareaccessext. dll is at server side.
This code is executed when clien access webpage from browser.
I am geting confused how javascript can access serverside dll file and its methods.
Its urgent plzzzzz
Thanks n Regards
Anu
Comment