1
Chris03
script translation
  • 2005/4/3 4:08

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


Is there anyone that knows php and asp? if you do would you translate this

<% 
txtUsername UCase(Request.Form("txtUsername")) 
txtPassword Request.Form("txtPassword"
IsValid "FALSE" 
AccessLevel "-1" 

If Len(txtUsername)>0 Then 
   Set oSecurity 
Server.CreateObject("HELM.CSecurity"
   
On Error Resume Next 
   Set rsSecureUser 
oSecurity.LoginUser(txtUsernametxtPassword
   If 
Err.Number 0 Then 
      On Error 
Goto 
      IsValid 
"TRUE" 
      
AccessLevel rsSecureUser("AccountType"
   Else 
      
errText=err.Description 
   End 
If 
       
   
Set rsSecureUser Nothing 
   Set oSecurity 
Nothing 
Else 
   
errText="No Username provided" 
End if 

Response.Write "vbcrlf 
Response
.Write "vbcrlf 
Response
.Write "IsValid "" vbcrlf 
Response
.Write "errText "" vbcrlf 
Response
.Write "txtUsername "" vbcrlf 
Response
.Write "AccessLevel "" vbcrlf 
Response
.Write "" 
%>


and

<% 
On Error Resume Next 
'Login against HelmDB 
IsOk = False 
If Not IsOk Then 
   Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") 
   Set xmldom  = Server.CreateObject("MSXML2.DOMDocument") 

   xmlhttp.open "POST", "http://yourcontrolpanel.com/webservices/login.asp", False 
   xmlhttp.setRequestHeader "content-type"," application/x-www-form-urlencoded" 
   xmlhttp.send("txtUsername="&postUsername&"&txtPassword="&postPassword) 
   xmldom.loadXML(xmlhttp.responseText) 

   If xmldom.getElementsByTagName("IsValid").item(0).text ="TRUE" Then 
      IsOk = True 
      ProfileSource = "HELM" 
   End If 
   set xmldom = nothing 
   set xmlhttp= nothing 
End If 

If IsOk Then 
'
Valid User credentials... 
Else 
'Invalid user credentials... 
End If 
%>


as im trying to reuse logins from my hosting control to xoops.

Thank you!

2
Chris03
Re: script translation
  • 2005/4/3 5:22

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


ok i got it done.

function checkHelmLogin($username$password){
    
$dh fopen("http://cp.amdmail.net:8084/login.asp?txtusername=$username&txtpassword=$password""r");
    while(!
feof($dh)){
      
$result .= fread($dh8192);
    }
    
fclose($dh);
    
    if(
substr_count($result"TRUE") > 0){
        return 
true;
    }else{
        return 
false;
    }
}

$username $_GET["username"];
$password $_GET["password"];

if(
checkHelmLogin($username$password)){
    echo 
"Login OK!";
}else{
    echo 
"Login INVALID!";
}
?>



how can integrate this into xoops?

Login

Who's Online

231 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 231


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits