|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
how to detect act. directory user login?
hi all, i'm sort of giving up for this particular problem and i hope so much somebody in here can help me out...
here's the problem: how do i detect the username of a user logged in to an Active Directory domain? is there a javascript solution for this? the objective of this problem is: to redirect the logged in user to his/her customized web page which is done in php. i hope u guys can help me out...thanx |
|
#2
|
|||
|
|||
|
RE: how to detect act. directory user login?
don't quote me on this, but i don't think it can be done, at least, not from JS..
you might want to try some other way to identify the user. maybe by his IP, or something else? also, you can let them input their username once (first time), and than just save it in a cookie, and read it from there every next time.. |
|
#3
|
|||
|
|||
|
RE: how to detect act. directory user login?
mm..is there another way i can do it, let say by using w32 api in php?
i dont want to authenticate by using his IP because he should be able to log in from anywhere in the network, provided he uses his domain username and password. |
|
#4
|
|||
|
|||
|
RE: RE: how to detect act. directory user login?
Quote:
maybe if your web server (with php) is on the same comp as your AD domain, and there is a win32api function to check what user is loged in on what IP address.. |
|
#5
|
|||
|
|||
|
RE: how to detect act. directory user login?
yes the web server is on the same machine as the AD, i got this code from php.net but the i kept getting USERNAME: SYSTEM instead of the actual username. anyone know why? [highlight=php] <?php $api = new win32; /* BOOL GetUserName( LPTSTR lpBuffer, // address of name buffer LPDWORD nSize // address of size of name buffer ); Returns the current thread's username "&" passes argument as "refrence" not as "copy" */ $api->registerfunction("long GetUserName (string &a, int &b) From advapi32.dll"); /* DWORD GetTickCount(VOID) Returns the ms the OS is running */ $api->registerfunction("long GetTickCount () From Kernel32.dll"); $len = 255; // set the length your variable should have $name = str_repeat(" |