username variable??

  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

in the same way I can use Global variables to automatically pull in a computer name and ip address, is it possible to obtain the name of the user currently logged in?
I dont believe there is a global variable for this is there?

Cheers in advance

Tommy
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

not sure but i see ppl do somthing like this

global $diplomacy, $log, $members, $news, $status, $templates, $useronline, $images;

not sure what it means and all but those are varibles and the global thingy infront i think means something ^^ YOU DESIDE!
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

What language are you using?

If it is PHP then you are able to pull the computer and IP address of the machine logged on to your site.

As for a username it wouldn't make sense that you can skim that info because as far as I understand, gettting a username is half the work done when trying to exploit a machine.

to see the variables you can retrieve create a php file with the following function in it
PHP Code: [ Select ]
phpinfo()


and then run the page. This will list all the possible variables and your PHP configuration

hope it helps
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Rabid Dog wrote:
As for a username it wouldn't make sense that you can skim that info because as far as I understand, gettting a username is half the work done when trying to exploit a machine.


Couple that with the fact that there is very rarely a legit reason for wanting it - I cant think of any off the top of my head (although that proves nothing :lol: ). Then take into account that you don't <i>need</i> it for an http transaction like you need an IP.

I would be very suprised if this was possible.

@spooF
Code: [ Select ]
global $diplomacy, $log, $members, $news, $status, $templates, $useronline, $images;


I would imagine this is being used so that the variables that are intiated outside of a function, can be used within a fuction, giving them global scope with in the script.
  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

not to worry, the actual reason I wanted them was for form entries on our intranet, rather than have the user fill that part of the form in, I would have a hidden field with the username already filled in

nothing sinister
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Glad I chose my words carefully now :D

I guess the users can't be worked out using static IP's or anything? It's a long shot.....
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

tommya wrote:
not to worry, the actual reason I wanted them was for form entries on our intranet, rather than have the user fill that part of the form in, I would have a hidden field with the username already filled in

nothing sinister


What OS is the server running and is it DHCP or static?
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Hang on.

You want to be able to automatically complete forms with user info, right?

Surely the logon name for the computer will not be the users actual name? (security issues come to mind)

Anyways, if that is what you want it for then why don't you just create a user registration form and have users log in to the intranet. That way you have all the info available to you in a nice neat database and can track the user with a session cookie.

I tend to try and leave the OS out of any development I do so the web app is stand alone. Makes it more portable.

Does this make sense?
  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

Well, eventually, I'll probably get round to doing a registration form etc....but I'll need MySQL for that right??.....which I havent got round to learning about yet

Excuse my naiveness in all of this but as I'm still learning, I'm just picking up tips as I go along, hence technically, my original question was only about a possible use of a variable
I'm aware that a user registration form would be a lot better, but do I definitely need MySQL database for this or can it be done simply with PHP??

All advice is appreciated guys, thankyou

Tommy
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Well the best way to develop a PHP app is to use the MySQL database. It allows you to expand th app at later stages as needed.

My advice to you is to download a copy of MySQL and start fiddling with it. It is relatively simple and when you get your first query right you'll see how easy it comes. I started with the MySQL manual.

Listen you probably could figure some work around out but what happens when you upgrade the server, change the OS or any other form of large change? Is your solution still going to work?

Okay so I did a search for you. go check out this site if your server is running windows

http://www.savageforums.com/showthread.php?t=16209

there is a posting there from a guy called Mr B who has solved your problem

Let us know if it works
  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

i dabbled with MySQL a few months back but couldnt commit the time to go any further into it, so I've kind lost track on it now, but I agree, it does seem relatively easy! but as for developing any kind of workable backend database with it, lets just see how I get on studying!! lol

which manual did you use exactly? is there a place I can get it from?

Right, as for 'Mr B' and his solution, I can confirm it works a treat
I disabled Anonymous usage and left Windows Integrated Security ticked.
Restarted IIS and IE6, went back in ran my script for showing all global variables, I can confirm that my doman/login name appeared in the following 4 variables

AUTH_USER
LOGON_USER
REMOTE_USER
UNMAPPED_REMOTE_USER

So all in all, we got there in the end, thanks for looking up that forum thread for me

And to recap, in the long run, for portability etc....I will no doubt be better off using MySQL but for simplicity in certain circumstances, I think this could come in very handy

Tommy
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Glad I could be of help!

Thanks for letting me know it worked and good luck with your project

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 71 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.