Announcement

Collapse
No announcement yet.

Disable auto-log out for Admin

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

  • [Forum] Disable auto-log out for Admin

    I want to disable the admin logout feature temporarily on my vBulletin forum,
    so that I can work on my forum, without having to login every time again.
    where can I set this ?
    vBulletin version 4.1.12

  • #2
    (Edit: Mark.B's post details an option to increase the timeout to one hour, post #5 in this thread.)

    It'd require code changes to do this. Code changes aren't supported, but I think this will do what you are asking for.

    In includes/functions_login.php, change this:
    PHP Code:
    vbsetcookie('cpsession'$cpsessionfalsetruetrue); 
    to this:
    PHP Code:
    vbsetcookie('cpsession'$cpsessiontruetruetrue); 
    I haven't tested this, but it should make the cpsession not expire like it usually does. Upload a clean version of that file when you are done.
    Last edited by Matthew Gordon; Tue 5 Jun '12, 4:37am.

    Comment


    • #3
      Hi Matthew

      Thanks for your comment.
      I looked in functions_login.php,
      but I found two items with these values.
      Should I change them both ?


      PHP Code:
              $admindm->set('cssprefs'$vbulletin->GPC['cssprefs']);
                          
      $admindm->save();
                      }
                  }

                  
      $cpsession $vbulletin->session->fetch_sessionhash();
                  
      /*insert query*/
                  
      $vbulletin->db->query_write("INSERT INTO " TABLE_PREFIX "cpsession (userid, hash, dateline) VALUES (" $vbulletin->userinfo['userid'] . ", '" $vbulletin->db->escape_string($cpsession) . "', " TIMENOW ")");
                  
      vbsetcookie('cpsession'$cpsessionfalsetruetrue);

                  if (!
      $cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX 'userid']))
                  {
                      
      vbsetcookie('userid'$vbulletin->userinfo['userid'], falsetruetrue);
                      
      vbsetcookie('password'md5($vbulletin->userinfo['password'] . COOKIE_SALT), falsetruetrue);
                  }
              }
          }

          
      // moderator control panel login
          
      if ($logintype === 'modcplogin')
          {
              
      $permissions cache_permissions($vbulletin->userinfofalse);
              
      $vbulletin->userinfo['permissions'] =& $permissions;

              require_once(
      DIR '/includes/functions_calendar.php');
              if (
      can_moderate() OR can_moderate_calendar())
              {
                  
      $cpsession $vbulletin->session->fetch_sessionhash();
                  
      /*insert query*/
                  
      $vbulletin->db->query_write("INSERT INTO " TABLE_PREFIX "cpsession (userid, hash, dateline) VALUES (" $vbulletin->userinfo['userid'] . ", '" $vbulletin->db->escape_string($cpsession) . "', " TIMENOW ")");
                  
      vbsetcookie('cpsession'$cpsessionfalsetruetrue);

                  if (!
      $cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX 'userid'])) 
      Thanks
      Toka

      (vBulletin Version 4.1.12)
      vBulletin version 4.1.12

      Comment


      • #4
        The first one is for the admincp login, the second one is for the modcp login.

        Comment


        • #5
          Can't this setting be used at AdminCP > Settings> Options > Admin Control Panel Options?

          Timeout Admin Login
          After a period of inactivity, Administrators are logged out of the Admin Control Panel. If this option is set to yes, the inactivity period will be the same as the Cookie Timeout setting found in vBulletin Options -> Help Cookies and HTTP Header Options (defaults to 15 minutes). If this option is disabled, then the period will be one hour.
          Logins to the admincp are more secure with this enabled.
          MARK.B | vBULLETIN SUPPORT

          TalkNewsUK - My vBulletin 5.6.4 Demo
          AdminAmmo - My Cloud Demo

          Comment


          • #6
            Originally posted by Mark.B View Post
            Can't this setting be used at AdminCP > Settings> Options > Admin Control Panel Options?

            Timeout Admin Login
            After a period of inactivity, Administrators are logged out of the Admin Control Panel. If this option is set to yes, the inactivity period will be the same as the Cookie Timeout setting found in vBulletin Options -> Help Cookies and HTTP Header Options (defaults to 15 minutes). If this option is disabled, then the period will be one hour.
            Logins to the admincp are more secure with this enabled.
            Wow, I can't believe I've never noticed that. Good catch, Mark.

            Comment


            • #7
              Hi both

              @ Mark, thanks for your help, but I had already tried this setting in the past without the desired effect.
              But thank you for spending your time wanting to help me, it is highly appreciated.

              @ Matthew
              I've changed the setting for Admin to :
              vbsetcookie (cpsession ', $ cpsession, true, true, true);
              Unfortunately, that didn't have the desired result, I'm getting logged out again.

              I now have changed the values for moderator also to:
              vbsetcookie (cpsession ', $ cpsession, true, true, true);

              I will also combine (in different ways) the two settings (Timeout Admin Login & vbsetcookie),
              to see if I will get what I'm looking for.
              I'll keep you posted.

              Kind regards
              Toka
              (vBulletin Version 4.1.12)
              vBulletin version 4.1.12

              Comment


              • #8
                Hi

                Nope, does not work.
                Even if I have both the values (admin & moderator) set to true,
                and in Cookies and HTTP Header Options the expiration time is set to 1 year, I'm still logged out.
                Any other suggestions ?

                Toka
                vBulletin version 4.1.12

                Comment


                • #9
                  I'm not sure that there is a good way to do this, then, really. You can try asking over at vBulletin.org.

                  Comment


                  • #10
                    Hello all

                    Hurrah... success !
                    Well, I just logged into the admin panel,
                    and guess what, I was logged in without having to enter my name or password.

                    My settings are :

                    Both values (admin & moderator) set to : vbsetcookie('cpsession', $cpsession, true, true, true); (in functions_login.php (path : ForumDirectory/includes/functions_login.php)) ( Thanks to Matthew )

                    In Cookies and HTTP Header Options ( Settings -> Options -> Cookies and HTTP Header Options -> Session Timeout ) increase the Session Timeout ( in my case 31536000 seconds, which is 1 year )

                    And, in Admin Control Panel Options ( Settings -> Options -> Admin Control Panel Options -> Timeout Admin Login ),
                    set the Timeout Admin Login to Yes.

                    That seems to do the trick.

                    Thank you Matthew and Mark for your input and help

                    Kind regards
                    Toka
                    vBulletin version 4.1.12

                    Comment


                    • #11
                      You need lastpass in your life. Then don't type or remember another password.

                      Comment


                      • #12
                        I never do...
                        vBulletin version 4.1.12

                        Comment


                        • #13
                          Hello again,

                          After working with this for awhile, I find myself logged out frequently despite the settings.
                          Yesterday I was logged out 3 times in less than a minute.
                          Sometimes I stay logged in for several days, other times i get logged out after a short time.
                          While working on the Forum, this is really annoying.
                          Is there no stable way to disable this logout function for ever.
                          I do not now why this would be a securety-problem,
                          my forums are disabled, and I used a .htaccess file to give only permission to my own IP address to enter the forums.
                          It is impossible to view my forum at this moment for anyone else.
                          Why does vBulletin does not give the option to disable this annoying option to the user if he decide to disable it.
                          I think it should be our choice to decide whether we disable this function or not, and not the decision of the programmer.
                          This is not a user friendly option.

                          Toka
                          vBulletin version 4.1.12

                          Comment


                          • #14
                            I have admin set to logout automatically but I have never actually been logged out. I'll say the same thing I tell my users that complain of frequent logouts: You must have something on your computer doing it, like an overzealous antivirus or internet security app.

                            Comment


                            • #15
                              I also never get logged out from the ACP and my settings are the default settings. I use 4.1.12.
                              BrainTalk is a support group for friends, family, caregivers, and patients with neurological disorders and other health related diagnosis.

                              BrainTalk Communities Inc
                              sigpic

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X