php : LOGON_USER / apache : mod_ntlm (delší)
Miroslav BENES
miroslav_benes na zdas.cz
Pátek Červen 16 10:29:03 CEST 2006
Přeji krásný den !
Kolega by v jednom projektu potřeboval zjišťovat pomocí php kdo je
přihlášen (do domény) na stanici, ze které je uživatel připojen.
Má vyzkoušeno, že se tato informace objeví v proměnné LOGON_USER.
Bohužel to funguje jen pokud php běží na MS Win. Jak se dá téhož
dosáhnout na linuxu ?
Pomocí google jsem našel odkaz na :
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20562144.html
.. kde je uvedeno :
"This will only work under IIS, for Apache you will need to install a
additional module (mod_ntlm)."
Kde se dá najít mod_ntlm pro FC5 ? Našel jsem jenom
http://sourceforge.net/projects/modntlm, ale tento zdroják se nedá v FC5
přeložit :
$ make
apxs -c -Wc,-Wall mod_ntlm.c
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd
-I/usr/include/apr-1 -I/usr/include/apr-1 -Wall -c -o mod_ntlm.lo
mod_ntlm.c && touch mod_ntlm.slo
In file included from mod_ntlm.c:36:
mod_ntlm.h:19: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'ntlm_module'
mod_ntlm.c:44: warning: conflicting types for built-in function 'log'
mod_ntlm.c: In function 'log':
mod_ntlm.c:53: warning: passing argument 4 of 'ap_log_rerror' makes
integer from pointer without a cast
mod_ntlm.c:53: warning: passing argument 5 of 'ap_log_rerror' from
incompatible pointer type
mod_ntlm.c:53: error: too few arguments to function 'ap_log_rerror'
In file included from mod_ntlm.c:79:
ntlmssp.inc.c: In function 'ntlm_msg_type':
ntlmssp.inc.c:136: warning: pointer targets in passing argument 1 of
'strlen' differ in signedness
ntlmssp.inc.c:136: warning: pointer targets in passing argument 1 of
'strlen' differ in signedness
...
mod_ntlm.c:812: warning: passing argument 5 of 'ap_log_rerror' from
incompatible pointer type
mod_ntlm.c: At top level:
mod_ntlm.c:825: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'ntlm_module'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_ntlm.so] Error 1
Takto dopadnul mod_ntlm-0.4. Na uvedené adrese je ještě mod_ntlm2-0.1,
ale to je totéž v bleděnodrém :
$ make
apxs -c -o mod_ntlm.so -Wc,-shared mod_ntlm.c
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd
-I/usr/include/apr-1 -I/usr/include/apr-1 -shared -c -o mod_ntlm.lo
mod_ntlm.c && touch mod_ntlm.slo
mod_ntlm.c:44: warning: conflicting types for built-in function 'log'
In file included from mod_ntlm.c:86:
ntlmssp.inc.c: In function 'ntlm_msg_type':
ntlmssp.inc.c:136: warning: pointer targets in passing argument 1 of
'strlen' differ in signedness
ntlmssp.inc.c:136: warning: pointer targets in passing argument 1 of
'strlen' differ in signedness
...
mod_ntlm.c:703: warning: pointer targets in passing argument 1 of
'__builtin_strcmp' differ in signedness
mod_ntlm.c:703: warning: pointer targets in passing argument 1 of
'__builtin_strcmp' differ in signedness
mod_ntlm.c:703: warning: pointer targets in passing argument 1 of
'__builtin_strcmp' differ in signedness
apxs:Error: Command failed with rc=65536
.
make: *** [mod_ntlm.so] Error 1
Ty zdrojáky jou 3,5 roku staré a asi se na straně apache staly nějaké
změny, kvůli kterým už to na sebe "nepasuje". Jenomže co s tím ? Dá se
modul "mod_ntlm" někde sehnat pro FC5 a aktuální verzi apache ?
Předem děkuji za tipy, protože už nevím jak dál.
M.B.
Další informace o konferenci Linux