Jump to content

Integrated login from another web app


LFA

Recommended Posts

Extract the attached file to your TCAdmin Web folder and redirect the user to this page from your website with these parameters:

 

http://xxx.xxx.xxx.xxx/md5login.aspx?[b]userid[/b]=TCADMIN_USER_ID&[b]md5pass[/b]=MD5_PASSWORD&[b]remember[/b]=0

 

Parameters

userid: The tcadmin user id

 

md5pass: The MD5 hash for the user's password. You can get this value from the tcadmin database in TC_USERS.MD5_PASSWORD

 

remember: This value is optional. Set the value to 1 to use the "remember me" login option.

md5login.zip

Link to comment
Share on other sites

If you have give your customers a login to your website they can log in to TCAdmin automatically. For example:

 

- The user logs in to your website

- They click on the tcadmin control panel link

- The coding in this page takes the user's email and looks for the user id and md5 password in the tcadmin database.

SELECT USER_ID, MD5_PASSWORD FROM TC_USERS WHERE EMAIL1='customer@yahoo.com'

- With this information you can redirect them to the md5login page for the automatic login.

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...

Yeah I noticed ECF ;).

 

I have just choosen the 'easy' way for now. Integrate the design as template into the panel. (the way around)

 

I quite like our current set up. One 'basic' interface on our own control panel at the website (basic start/stop/restart, overview, filemanager using Curl and the SDK) and one 'expert' interface just using the login method of LFA auto logging in fetching the userid and md5pass from the tcadmin DB assigned to that customer and being the panel itself. :)

 

I love TCAdmin.

Link to comment
Share on other sites

Hello LFA,

 

How can I integrate this into my website with Curl?

It seems to not accept the sessions properly.

 

If you create a TCAdmin session and logout in every custom script you should not have any problems with curl sessions.

Link to comment
Share on other sites

  • 6 months later...

here if you guys want it to redirect back to a page with a result, instead of leaving a white page here is the code.

 

<%

Dim userid As String = Request.QueryString("userid")

Dim md5pass As String = Request.QueryString("md5pass")

Dim remember As Boolean = False

Dim user As New TCAdminSDK.Objects.User

 

If Not Request.QueryString("remember") Is Nothing Then

remember = Request.QueryString("remember").Equals("1")

End If

 

user.UserID = userid

If user.Find Then

If user.MD5Password.Equals(md5pass) Then

Dim sesssion As New TCAdminSDK.Web.Session

Dim userpass As String = TCAdminBase.Encryption.DecryptString128Bit(user.Password)

If sesssion.LogOn(user.UserID, userpass) Then

If remember Then

Dim uCookie As HttpCookie = New HttpCookie("TCAdminUserID", user.UserID)

Dim pCookie As HttpCookie = New HttpCookie("TCAdminUserPassword", TCAdminBase.Encryption.EncryptString128Bit(userpass, System.Web.HttpContext.Current.Request.UserHostAddress()))

uCookie.Expires = Now.AddDays(15)

pCookie.Expires = Now.AddDays(15)

Response.Cookies.Add(uCookie)

Response.Cookies.Add(pCookie)

End If

 

Response.Redirect("~/Templates/Default/user_home.aspx")

Else

Response.Write("Could not create session.")

End If

 

Else

Response.Redirect("http://yourdomain/index.php?error=1")

End If

%>

 

here is an example of its use, https:

//www.an-servers.com/index.php as a non error, and here is with error, http://www.an-servers.com/index.php?error=1

 

of course you need a script to look at the result error=1

 

anyway, i am making a script to multi login for whmcs, tcadmin, and another control panel

Link to comment
Share on other sites

  • 2 years later...
Extract the attached file to your TCAdmin Web folder and redirect the user to this page from your website with these parameters:

 

http://xxx.xxx.xxx.xxx/md5login.aspx?[b]userid[/b]=TCADMIN_USER_ID&[b]md5pass[/b]=MD5_PASSWORD&[b]remember[/b]=0

 

Parameters

userid: The tcadmin user id

 

md5pass: The MD5 hash for the user's password. You can get this value from the tcadmin database in TC_USERS.MD5_PASSWORD

 

remember: This value is optional. Set the value to 1 to use the "remember me" login option.

 

I tried this but i keep getting a incorrect password.

 

I have followed this step by step. What am i doing wrong?

 

Thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 9 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use