Re: Uploading/Download (server/client both created - WeOnlyDo Discussion board

Re: Uploading/Download (server/client both created (General questions)

by Dennis, Friday, December 17, 2004, 23:25 (7282 days ago) @ wodSupport

Dennis,

I am not sure here - so please check this out. It is questionable if 'login' is same as 'session'. Perhaps when wodSFTP is used you don't see him on userlist - since he didn't actually start the console.

How will you look for connected users? Using 'finger' or 'who' perhaps? Can't you just silently ignore users not using specific tty(s)?


Well, I tried logging in with both the SSH and SFTP from the same client and both logins will be visible in the server.

I will be doing something like this to get and send the userlist to a client requesting it:

[code]Dim x as Long
Dim UserList as String

For x = 0 to Users.Count - 1
UserList = UserList & Users.Item(x).Login & vbcrlf
Next x
User.Send UserList[/code]

But I thought of something that MIGHT, work, you could give me an opnion on this one.

When someone logson with the wodSFTP component, I can have it send a tag infront of the username, like  ›down:

Upon connecting to the server, I'll do this:

[code]
If Left(Login, 6) = ›down: Login = Right(Login, Len(Login) - 6) = joe And Password = joe Then
Login = ›Download
Action = Allow
ElseIf Login = joe and Password = joe then
Action = Allow
Else
Action = Deny
End If
User.HomeDir = c:program files [/code]

Above we check for the wodSFTP tag, if it excists, we rename the Login to download to keep track of it as a downloading client. (not the › character, to make sure no one can make a login like that).
We can do the same for uploads.

No, when someone requests, the UserList, we jsut do this:

[code]Dim x as Long
Dim UserList as String

For x = 0 to Users.Count - 1
If not Users.Item(x).Login = ›Download then
UserList = UserList & Users.Item(x).Login & vbcrlf
End If
Next x
User.Send UserList[/code]

We can do the same thing for uploads I guess.

And with this trick we could also see information about a user, what he's doing right now, by removing If not in the UserList code, and checking ip on each userdownloading, comparing it to the user we want info about, and we can see if he/she is uploading/downloading.

Any ideas? Does it look like it could work?

Cheers,

Dennis


Complete thread: