Computing.Net > Forums > Novell Netware > My own login program

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

My own login program

Reply to Message Icon

Name: Anjanesh
Date: December 5, 2002 at 03:04:54 Pacific
OS: Novell (DOS)
CPU/Ram: 133/16
Comment:

I am working on Novell (DOS based) platform. We login on a workstation using Novell's login.exe which asks for our username & password.
There are 2 Novell servers - server1 & server2.
Switch on the computer & it automatically gets connected to server2 (default) - this is what shows up on the screen first.
F:\>
To login onto server1 this is what happens:

F:\>login server1/id001 //take some id say id001
Enter password: //password gets masked by blanks
K:\id001>You are logged onto server1 //blah blah blah
K:\id001>_ //we continue the rest from here
K:\id001>logout //the cmd for logout
F:\> //back to f drive

And similarly for server2 (if you have an id in that server).
K: & F: are drives on the same server.

I tried to write my own login program mylogin.exe in Turbo C++ 3.1 using the system() function & had the exe file copied to the server. But unfortunately it did not work. This is the program that I wrote:

mylogin.cpp
#include
#include
void main(int argc,char*argv[])
{
char userID[20],loginCmd[50];
strcpy(loginCmd,"login server1/");

if (argc!=2)
{
cout > userID;
}
else
strcpy(userID,argv[1]);

strcat(loginCmd,userID);
system(loginCmd); // This is where the program fails.
}

IMP: I do not need the password extracted from my program but the userid HAS to be entered using my program so that I can know who is logging in. Typing login or login server1/ will ask for the userid & then the password & then log in. But typing login server1/id001 will only ask for the password. That's why I used login with argument in the system function.

Now mylogin is copied to server1 (F:\PUBLIC, the directory where login.exe is located & which is default directory for all public users as in when the computer starts up or when logged off)
Run mylogin with or without a parameter & loginCmd will contain the same thing when we type it directly.
Theoretically this should work because it simply calls the login program like as if we were typing it. The line system(loginCmd); should login in successfully but it fails at that point. I don't understand why since mylogin.exe is in the host so there should be no problem of rights.
(A: & F: are one and the same and there is no floppy drive anywhere)
Anyway the error that appears is this : Cannot read drive A:/ or something like that
Abort, Ignore, Retry?
I have to select abort & continue with the normal procedure.

Now let¡¯s look at this at a different view.
Switch on the computer & id001 has logged in using the normal procedure (using login.exe)
Now that he is logged in, if he types mylogin id002 (or without the parameter for that matter) he gets logged onto id002

K:\id001>mylogin id002
Enter password:
K:\id002>You are logged onto server1
K:\id002>_

But there is one problem in this - id001 DOES NOT LOGGED OUT! He is still logged in. So I modified the program. I first checked if the current directory was a user's or the public one. If it was a user's then system("logout"); & the rest of the code. But again the logout works & all code after that fails.
All lines in the program work as long as a user has logged in. Once he is logged out (even if it¡¯s from mylogin.exe), the rest of the code does not execute. I can't understand why this does not happen when I have made my program as the parent. It should resume back to my program.

This is just the starting. I actually intend to make an IDE program where each user has his own profile. So you login in using mylogin. A window appears (menu driven). Do whatever you want - go to c++,COBOL etc etc. If you go to c++ then it goes to c++ & once you exit it'll come back to my program. So basically anything else you go to are my program's children. The next line of does not get run until the child is closed. And when you want to logoff just go to the exit menu or whatever. The control goes back to F:\PUBLIC. To login again he must type mylogin. Or better still no need of quitting mylogin at all. To login as another user just select the 'login as' option & to exit select 'shut down'. 'login as' will logout the current user & login as another user. I hope you get the picture. My program should have control of everything/anything.
I tried a lot of stuff for quite a long time now but nothing works.
So please help.
Anjanesh



Sponsored Link
Ads by Google

Response Number 1
Name: wanderer
Date: December 5, 2002 at 08:43:34 Pacific
Reply:

why are you wasting your time on this when netware already has login.exe? Instead you should concentrate on writing login scripts and using MENU which is builtin to Netware and gives you a gui interface with choices. You should also look at the ATTACH command which will automaticly login to the 2nd server during the running of the login script. BTW login belongs in the LOGIN directory on the SYS volume not Public. You would have to rewrite the client software to look for your mylogin instead of the default native to Netware. There is no Netware for Dos. I would suspect you have netware 3x and are using the old dos client for WFW or Windows 3.1. Might want to update your environment. Best of luck!


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Novell Netware Forum Home


Sponsored links

Ads by Google


Results for: My own login program

How do I void Novell Volera??? www.computing.net/answers/netware/how-do-i-void-novell-volera/5004.html

Can't access windows login www.computing.net/answers/netware/cant-access-windows-login/4269.html

hacking novell netware at school www.computing.net/answers/netware/hacking-novell-netware-at-school/2483.html