more code updates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CSN NewsBot

    #1

    more code updates

    Member registration now works correctly.[break]I tried to revamp our users system (for PHP guys: switching to $_SESSION while still using globals). Well the globals fell flat on their face and basically the entire user system was ghetto until earlier today. At that time I rewrote the log in and log out routines. I set default values for username and password which conflicted with registration, loss password, and, I believe, the prefs page. Everything should work correctly.



    Because of the re-write, "new" items should be more reliable even if technically less accurate. It now shows items that are new since the last time you first loaded up the site in a new browser thread/session/window/blah. I've also added security to the admin and preferences page, you must manually log in (read: know the password) to access these pages. Cookies are unreliable, but will let you pass with post comments, voting in polls, and other things that can't really screw you over.



    In my last post I forgot to inform you that shortened headlines can be viewed via a tooltip if you hover your mouse over their headline to the right (they end in a .. because they're too long to display normally). The point of this post is to inform users that registering now worked. I just added a lot of useless meat, sorry.



    Or, perhaps, this was just a ploy to introduce more users to the hidden text thing.
  • rizzuh

    #2
    I'm getting back into the groove of coding again. Mostly boring stuff that affects the admins more than the users, but I do enjoy coding in general so it's all fun and well for me.



    Don't bother asking about forums, I'm not going to discuss them. Sorry guys.

    Comment

    • gorktic

      #3
      Does this mean that I won't have to sign-in every other day now? I like your dedication.

      Comment

      • rizzuh

        #4
        Cookies for admins are now stored longer since their access is heavily limited without the password. In either case you're not longer an admin, thanks for reminding me D:

        Comment

        • -Dice

          #5
          "Getting back into the groove?"



          Dear Lord, rizzuh's going to dance! Ah, ah, ah, ah, stayin' alive...



          I think you should take CSN down for a day and recode it in Turtle.

          Added @ [time="1024983703"]

          Rizzuh: I closed this IE window, opened it up again, went to CSN, and it still shows this news item as 'new'. Is this what you were refering to? I can't tell.

          Added @ [time="1024983782"]

          Oh, hey, I tried it again, and it only shows the comments as being new.

          Comment

          • Exo

            #6
            Really if the cookie exists you should check not only if the username cookie is legit, but the password as well. I don't exactly know how it would help, but you could also set all the cookies as one, $cookiename[#]. Although, with that way you'd probably have to go through and change everything dealing with login and registration, which I know is a hassle.



            Today my clan beat a cal-m clan!!

            Comment

            • gorktic

              #7
              my clan beat homelan in assault one year ago. we are still proud, we as in i.

              Comment

              • rizzuh

                #8
                Exo what you just wrote made no sense.



                Thanks for the security tip, however.

                Comment

                • Exo

                  #9
                  I worded that completly horrible. I'll let the manual do it in it's simple manner.



                  http://www.php.net/manual/en/features.cookies.php
                  If you wish to assign multiple values to a single cookie, just add [] to the cookie name.
                  For example, I used this code for my login:



                  setcookie ("user_pass[1]", $username, time() + 60*60*24*7);

                  setcookie ("user_pass[2]", $password_crypt, time() + 60*60*24*7);



                  It really doesn't help, but if you had done that when you began coding csn, you could say you used 1 cookie instead of 3. Yes I have no life.

                  Comment

                  • popcorn

                    #10
                    Edited by [user="34571"] @ [time="1025003805"]

                    [offtopic]

                    I have a little offtopic question. When I use a custom weapon model skin, it shows up on the left handed side of the screen. The normal weapons are still on the right side. Is there a way to fix this, cuz it doesn't shoot very nice :)

                    Sorry for the offtopicness :)

                    [/offtopic]

                    Comment

                    • -Dice

                      #11
                      Popcorn: you v_x.mdl file for your custom models is a left-handed one. Currently, there is only a need for one weapon model, a right-handed one named v_x.mdl, as HL flips it if you want to be a southpaw.



                      To correct this, go to your cstrike/weapons folder, delete your v_x.mdl file, find your v_x_r.file, and rename it v_x.mdl.

                      Comment

                      • street

                        #12
                        I think I'm going to cry - sessions, global variables and cookies! I've heard them all used with regard to authentication but I really haven't got my head around it. A resource to help me anyone?

                        Comment

                        • gorktic

                          #13
                          Edited by [user="232"] @ [time="1025026131"]

                          quite honestly, sessions are nice, but i've used cookies; without the worry that someone has them disabled. Neither are horribly hard to implement and I'd always store user info (i.e. pw, usrnm) in seperate files. Also, i never encrypt in any way other than the good ol' md5( )



                          beyond that, exo, why would you have to have numbered elements? It's not required, this is php, not fortran.

                          Comment

                          • rizzuh

                            #14
                            That doesn't make anything more or less secure exo. Like everything on computers, cookies can be faked. What can't be faked is knowing the password, thus the prefs and admin sections are now secure.

                            Comment

                            • Eagle25

                              #15
                              i like the 13 yr old rule....but riz....how can u tell?



                              o right i forgot you are the fishy of magic with superpowers

                              [sarcasm]

                              Comment

                              Working...