Announcement

Collapse
No announcement yet.

Password Expiry

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

  • Password Expiry

    I'd like a username and password to expire at a certain time. How do we add this feature in Blue Voda?
    www.CEA-ca.com

  • #2
    Re: Password Expiry

    Since this is not built in the Login tools, you will need to create your own custom code.

    Tip: set an extra $_SESSION variable which contains the time (UNIX time) of each authentication (each time the user tries to reach a protected page, he gets authenticated). Then add in the authentication script a line of code that checks the time since last authentication.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment


    • #3
      Re: Password Expiry

      Originally posted by navaldesign View Post
      Since this is not built in the Login tools, you will need to create your own custom code.

      Tip: set an extra $_SESSION variable which contains the time (UNIX time) of each authentication (each time the user tries to reach a protected page, he gets authenticated). Then add in the authentication script a line of code that checks the time since last authentication.

      To be honest I don't think I can do this. I guess this code has to be inserted in the login form under the object/general html section. Can you help further with the code please?
      www.CEA-ca.com

      Comment


      • #4
        Re: Password Expiry

        Insert the "Protect Page" object in the pages that you need to protect.

        Right click it and select "Convert to Form". The object will be converted to a HTML box. Double click it and you will see its code that will be looking like this:

        <?php
        session_start();
        if (!isset($_SESSION['username']))
        {
        header('Location: error.php');
        exit;
        }
        ?>


        Insert the following code just AFTER the line session_start();

        if(!isset($_SESSION['logintime'])){
        $_SESSION['logintime'] = time();
        }else {
        if(time() > $_SESSION['logintime'] + 15 * 60){
        unset($_SESSION['username']);
        }else{
        $_SESSION['logintime'] = time();
        }
        }

        15 is the session expiry in minutes. You can change it to whatever you need.

        Please note that as is, the code, will renew the session expiry for 15 minutes after each page load. So if the user keeps on moving on the site, his session is renewed. Otherwise it expires after 15 minutes.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment


        • #5
          Re: Password Expiry

          Thanks for the help.
          1. I checked the Protect Page object box it does not have the option 'Convert to Form' . It has options to Cut, Copy, Move the box forward/back/etc./, Properties and HTML when I clicked on the HTML option the box was empty. Am I doing something wrong?
          2. Do I have to put 15 in the time bracket i.e. time(15)

          Thanks
          www.CEA-ca.com

          Comment


          • #6
            Re: Password Expiry

            1. This is only available in BV version 12. If you have BV 11 this is not available.
            1.A. If you wnat to continue working with BV 11, then:

            Add a small HTML box in your page. Paste the entire code, that is

            <?php
            session_start();
            if(!isset($_SESSION['logintime'])){
            $_SESSION['logintime'] = time();
            }else {
            if(time() > $_SESSION['logintime'] + 15 * 60){
            unset($_SESSION['username']);
            }else{
            $_SESSION['logintime'] = time();
            }
            }
            if (!isset($_SESSION['username']))
            {
            header('Location: error.php');
            exit;
            }
            ?>

            Remove the standard Protect Page object.
            2. No, time() should remain as is.

            Using a HTML box, you will have to manually type the "Access denied Page" (which I supposed to be the "error.php" page but you can have any page you like.)

            If you want to restrict access to specific users, you should further modify the code.
            Navaldesign
            Logger Lite: Low Cost, Customizable, multifeatured Login script
            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

            Comment


            • #7
              Re: Password Expiry

              I'm not sure if something is missing in the code because when I preview it the code appears on the screen. I guess it might be missing a bracket or something.

              Thanks,
              www.CEA-ca.com

              Comment


              • #8
                Re: Password Expiry

                PHP pages can't be previewed, as the PHP code needs to be executed on a server that supports PHP (your own computer doesn't)

                In other words, you need to publish the page in order to test it.
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment


                • #9
                  Re: Password Expiry

                  Are you sure your publishing your page as a PHP file format? If you put code on a page and publish it as a HTML you will see the code at the top of the page as you indicated has/is happening.

                  Comment


                  • #10
                    Re: Password Expiry

                    To JRPC : alphilan is previewing ! he didn't publish. So even if the page is the correct format (that is, .php) he will have this issue anyway.
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment


                    • #11
                      Re: Password Expiry

                      I followed your instructions after I downloaded BV ver. 12. I get this after publishing the page with the code.

                      If I remove the code the page publishes okay.
                      www.CEA-ca.com

                      Comment


                      • #12
                        Re: Password Expiry

                        Originally posted by alphilan View Post
                        I followed your instructions after I downloaded BV ver. 12. I get this after publishing the page with the code.

                        If I remove the code the page publishes okay.
                        I think it works okay now. Thanks.
                        1. I was wondering is there a way I can let a user know through a customized message that their session is over?
                        2. As far as the the admin log can we add some extra fields to verify the authensity later if clients forget their username and password?
                        www.CEA-ca.com

                        Comment


                        • #13
                          Re: Password Expiry

                          Expiry is set in seconds. 60*6 means 6 minutes, not 60 (60 secs/min * 6 mins)

                          To add additional fields, you need to customize the code. This is something you need to do yourself.
                          The same goes for the custom message.
                          Navaldesign
                          Logger Lite: Low Cost, Customizable, multifeatured Login script
                          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                          Comment

                          Working...
                          X