2 Copyright © 2002-2006, The AROS Development Team.
8 #include <exec/types.h>
13 #include <proto/alib.h>
14 #include <proto/exec.h>
15 #include <proto/dos.h>
16 #include <proto/intuition.h>
17 #include <proto/muimaster.h>
20 #include <intuition/gadgetclass.h>
21 #include <intuition/icclass.h>
22 #include <clib/alib_protos.h>
23 #include <zune/loginwindow.h>
25 #include <libraries/mui.h>
29 #define ARG_TEMPLATE "LOCAL/S"
35 IPTR argarray
[TOTAL_ARGS
] = { (IPTR
)NULL
};
36 struct RDArgs
*args
=NULL
;
37 Object
*LoginWin
=NULL
;
38 char *userName
=NULL
, *userPass
=NULL
, *loginMeth
=NULL
, *string
=NULL
;
39 struct SecurityBase
*SecurityBase
=NULL
;
40 int error
= RETURN_ERROR
;
42 if (!(SecurityBase
= (struct SecurityBase
*)OpenLibrary("security.library", 0)))
44 PutStr("Opening of security.library failed\n");
45 error
= ERROR_INVALID_RESIDENT_LIBRARY
;
49 args
= ReadArgs( ARG_TEMPLATE
, argarray
, NULL
);
51 if (argarray
[ARG_LOCAL
])
53 app
= ApplicationObject
,
54 SubWindow
, LoginWin
= LoginWindowObject
,
61 app
= ApplicationObject
,
62 SubWindow
, LoginWin
= LoginWindowObject
,
63 MUIA_LoginWindow_UserName
, (IPTR
)string
,
64 MUIA_LoginWindow_Method
, (IPTR
)"smb: NAHOMENET Domain",
65 MUIA_LoginWindow_Method
, (IPTR
)"smb: aros.org Domain",
66 MUIA_LoginWindow_Method
, (IPTR
)"smb: Dialup Connection...",
67 MUIA_LoginWindow_Cancel_Disabled
, TRUE
,
78 LoginWin
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
) app
,
79 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
82 set(LoginWin
,MUIA_Window_Open
,TRUE
);
84 while (DoMethod(app
, MUIM_Application_NewInput
, (IPTR
) &sigs
) != MUIV_Application_ReturnID_Quit
)
88 if (sigs
== LWA_RV_OK
)
91 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
93 if (sigs
& SIGBREAKF_CTRL_C
)
95 if (sigs
& SIGBREAKF_CTRL_D
)
101 if (sigs
== LWA_RV_OK
)
103 get(LoginWin
, MUIA_LoginWindow_UserName
, &string
);
104 userName
= StrDup(string
);
106 get(LoginWin
, MUIA_LoginWindow_UserPass
, &string
);
107 userPass
= StrDup(string
);
109 get(LoginWin
, MUIA_LoginWindow_Method
, &string
);
110 loginMeth
= StrDup(string
);
112 Printf(" Hello %s, welcome to aros..\n",userName
);
113 Printf(" i shouldnt really say this but your password is '%s'\n",userPass
);
114 Printf("\n you have logged on using '%s'\n",loginMeth
);
125 PutStr(" User canceled");
127 MUI_DisposeObject(app
);
131 printf("Failed to intialize Zune GUI\n");
133 if (args
) FreeArgs(args
);
137 CloseLibrary((struct Library
*)SecurityBase
);