logs archiveIRC Archive / Freenode / #php / 2006 / June / 7 / 5
linux2
Julian|Work: well i have two books here with me
cythrawll
not listening
linux2
and both fail to explain anything well
Julian|Work
linux2, sounds like it's time for a new book!
cythrawll
its a uniqid that points to vars on the server side
Julian|Work
cythrawll, I understand
linux2
Julian|Work: well they are good for everything but user authentication
cythrawll
to escalate levels there you have to guess a valid session identifier
Julian|Work
linux2, so buy a book that includes user auth.
         

Jymmm
lol
cythrawll
which should be almost impossible
Julian|Work
cythrawll, guessing sure, but there are ways to capture it.
Jymmm
CTRL+H
cythrawll
now that,s bad design Julian
Julian|Work
What's bad design? Capturing session IDs?
cythrawll
no
allowing it to happen
Julian|Work
Not everything's under my control.
Jymmm
browser history on any public computer will show past sessionid's
linux2
Julian|Work: well i want this basically. if someone comes to my site and they are not logged in they will see the login bar on the right and it will say "you are logged in as guest". and then when they login i want it to remove the login bar with a logout bar and say "you are logged in as (username)" and then have another little added in piece that just says there are "(number of guests) on the site and (number of users logged in) logged
in"
cythrawll
thats true
Xyphoid
trans_sid will leak session ID's too. trans_sid is a terrible feature
cythrawll
but that's a public terminal
that is outside the control
Julian|Work
I like to include IP/user_agent as part of a check.
cythrawll
but that's not any more safer than cookies
Jymmm
cy_ so will me mucking with your computer when you head to the kitchen.
cythrawll so will me mucking with your computer when you head to the kitchen.
Julian|Work
Haha
cythrawll
people have been killed for less Jymmm
Jymmm
cythrawll if you feel froggish....
lig
(Action) really knows she isn't a CS geek when she has to pull out the dictionary to explain what a vertor and orthogonal is
         

Julian|Work
A girl on the internet?
Jymmm
Julian|Work Yeah, you and lig.
Julian|Work
I thought I was all alone.
lig
never alone
cythrawll
theirs girls on the internet all over
just not many in freenode
go to maispace
Jymmm
cythrawll he said girls, not sluts.
linux2
i am completely lost as where to start
Jymmm
no offense lig
cythrawll
I cold say something derogatory but i wont
linux2
first. how would i set username?
kavelot
any hints on translating a "hexa" string (just 0-9a-f) into a 0-9a-z format, so more data can be written in a short string (must have a back function)
lig
none taken darlin Jymmm
jbrimble
!+sprintf
linux2
so that i can make a function that says "you are logged in as 'guest'"
and have permissions assigned to the guest user
Jymmm
lig I know how hard you've worked for for your "slut" status, and you should be proved of your accomplishments.
proud
cythrawll
linux2 for guest i would make everything default
lig
hehe - being a smart slut - is that an oxymoron?
Julian|Work
http://www.rpgsource.net/gallery/girl_internet_1.jpg http://www.rpgsource.net/gallery/girl_internet_2.jpg <-
cythrawll
and then add on permissions when privleges escalate (log in)
Julian|Work
Not at all. Maybe it's smart to be a slut.
richardlynch
kavelot: So, you want to convert hex to base-26 numbering?... http://php.net/base_convert
Julian|Work
er, sh*t.
kavelot
thanks :)
Julian|Work
lig
LOL
linux2
cythrawll: can you give me a little help on this
just to get me started
Julian|Work
That's us.
linux2
once i get going i will be all set. my books just fail to show how to setup userlevels
the database assigns everyuser a level
which is by number
cythrawll
yeah
bullr[a]ge
linux2, use numbers (1 to 5) to given priveliges
linux2, 1 is the bottom user and 5 is the admin
linux2
already have that setup in the database
but now how do i make it so my pages limit users
Julian|Work
if() statements
bullr[a]ge
linux2, using if's to check
jbrimble
What's wrong with this?
$db_query = ("UPDATE `client_accounts` SET `LastLogin` = 'now()' WHERE `ClientID` =%s LIMIT 1 ;", quote_smart($clientID));
$result = mysql_query($db_query);
linux2
bullr[a]ge: ok not too hard
Julian|Work
Schmoke time.
linux2
would it make sense to just make a user in the database called guest
Julian|Work
jbrimble, now() should not be in quotes.
linux2
and login them by default
jbrimble
oh, i see
lig
(Action) notes orthogonal means at a right angle. she then thinks "What the heck is the difference between orthoganal and perpendicular then?"
cythrawll
if($_SESSION['level'] >= 3){ //level 3 and up can do this } else { //everyone else does this }
bullr[a]ge
jbrimble, $db_query = sprintf("UPDATE `client_accounts` SET `LastLogin` = now() WHERE `ClientID` =%s LIMIT 1 ;", quote_smart($clientID));
Julian|Work
jbrimble, I don't think you need the trailing ; either.
jbrimble
The error I'm getting is this - Parse error: syntax error, unexpected ','
linux2
cythrawll: ok makes sense
Julian|Work
lig: 3 letters?
jbrimble
thanks bullr[a]ge
richardlynch
lib: orthogonal and perpendicular are the same, in 2-D... Orthogonal is used more in n-space, however, I think.
linux2
so how to login a user by default
richardlynch
brb
lig
Julian|Work, I think they use it just to confuse people
cythrawll
linux2, I would not login a user by default
Julian|Work
lig: "In mathematics, orthogonal is synonymous with perpendicular when used as a simple adjective that is not part of any longer phrase with a standard definition. It means at right angles."
http://en.wikipedia.org/wiki/Orthogonality
lig
(Action) reads
linux2
cythrawll: well userlevel 1 = guest
2 is logged in
cythrawll
because that would require setting up a cooke or session, and if that user doesn't accept sessions or cookies....
linux2
well let me give you an example of what i want
if you go to tuxopia.com (don't mean to advertise)
see the login thing on the right
something like that
cythrawll
yeah
bullr[a]ge
linux2, just use an UPDATE query to change the status to 2, then the database will presume he/she is logged on. On logout, reset it to 1
lig
(Action) blinks... oh god - math... hunkers down
cythrawll
i would say guest has no level
Jymmm
(Action) throws trig at lig
fh|killy
Fatal error: Call to undefined function: simplexml_load_string()
linux2
ok. not really a change needed for that
bullr[a]ge
yeh, having guest as a level makes things complicated
fh|killy
looks like my host doesn't have simple xml?
or maybe it doesnt have php 5?
lig
(Action) gets hit in the head with trig and is dazed
fh|killy
can i get the function somewhere and copy it into my script?
Bread
Ah, here's the contents of the config.log : http://channels.debian.net/paste/2764
bullr[a]ge
fh|killy, phpinfo() might help
linux2
so now where to being with the script that gives anyuser a username on going to my site
cythrawll
a registration script?
fh|killy
ya its php 4.4.0
richardlynch
fh|killy: Upgrade, or forget using simpleXML.
linux2
cythrawll: well see how on the the tuxopia site. on the right it says there are (amount of guests) logged in
fh|killy
i can't upgrade
linux2
first i would like to add something like that
fh|killy
OK i have a variable $xml which contains an xml file
linux2
so it says that for all unknown users or as i will call them "guests"
fh|killy
whats hte best way to parse it without using simplexml?
linux2
cause my site will not require that you login to do most of the stuff you want, but a lot of features will be missing etc
Apocs
if ($x == y || $a == b){...} <-- || is an OR operator right?
richardlynch
linux2: How about: $username = isset($_SESSION['username']) ? $_SESSION['username'] : 'guest';
JJPeerless
how can i set how long a session lasts?
cythrawll
well i guess you can set a session if you want to do that linux2, but then i wouldn't actually check it for permissions.
bullr[a]ge
My lecturer said something to me today.. In theory PHP is easy, it's putting it into practice where most people get stuck
Creed2PE
How can I use a date that looks like this (512006) to query from a table field that stores dates that look like this (2006-05-31 15:32:43)?
Bread
richardlynch
Bread
Creed2PE, http://www.php.net/strtotime
Or use MySQL's internal datetime functions like UNIX_TIMESTAMP()
bullr[a]ge
linux2, you could also create a session and generate a hashkey for anybody not logged whilst prefixing it with guest and then store it in the database and then do a count on all hashed keys prefixed with guest
Apocs
richardlynch: ok, then i was setting up this if statement, and first i used if ($x == y OR $a == b) {...} and that wouldn't work so i tried the || operator
linux2
im still completely lost on where to start
i understand what i have to do
just now how to do it 100%
richardlynch
linux2: How do you tell one guest from another is where you need to start.
linux2
well i could do it by session id
lig
(Action) thinks she conceptually has a small clue now... and is frightened as hell when she considers going for a CS degree if it involves that stuff.. she admits to being a wimp.
Julian|Work
lig, what is it, graphics sh*t?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 next »