Results 1 to 7 of 7
I want to be able to create a php webpage that will show the logged in users files and how full their home directory is (roaming profiles).
The php side ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-14-2011 #1Just Joined!
- Join Date
- Mar 2011
- Posts
- 9
How to find the username of a user who has logged in (roaming profile)
I want to be able to create a php webpage that will show the logged in users files and how full their home directory is (roaming profiles).
The php side isn't a problem....the problem is how do i determine the username of the user who is logged into Linux not the webpage itself?
What i want is when the user opens this page, it knows who they are already.
I have seen this done on an intranet at work (don't know what OS it is running on tho) where I login to the network, view the page and it says my name.
- 03-18-2011 #2
"w" command will give you list of logged in users. Just quite curious , If its not confidential , what your application will do?
First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-----
FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org
- 03-18-2011 #3Just Joined!
- Join Date
- Mar 2011
- Posts
- 9
All i want is as intranet page whci hwill have the usual crap on there but also a list of files the user has on there home drive plus how much space they have left.
Is there a file that gets updated with a list of logged on users that I can read?
- 03-19-2011 #4
Yes,there is utmp file check
But its hard to parse - better use "w" command abd parse its output.man utmpFirst they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-----
FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org
- 03-19-2011 #5Just Joined!
- Join Date
- Mar 2011
- Posts
- 9
- 03-19-2011 #6
Are you running php application on the same machine.Where users logs in?
If so,php has system() function where you can provide/invoke shell commands.
PHP: system - Manual
You can redirect the output to some file and then parse that file. Or you can store the output of "w" to php variable and parse it.First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-----
FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org
- 03-21-2011 #7Just Joined!
- Join Date
- Mar 2011
- Posts
- 9
Thanks for the reply....i think it is what i need.
I just saw something about security risks and that a user could gain access to the computer. Would anyone be able to do this if the web page is only hosted locally using php and apache and my users who i want to allow the view the page would only be users who VPN onto the machine?
I will only have about 5 users that i will create so would VPN be secure enough or is there alternative method which my users could do (most of them are not tech savvy but will know how to do it when i show them).


Reply With Quote

