Ad Widget

Collapse

[code] remember hostid & groupid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • globifrosch
    Member
    • Sep 2005
    • 74

    #1

    [code] remember hostid & groupid

    add this to config.inc.php and your browser remembers the hostid or groupid (everywhere in the webfrontend).

    Code:
    session_start();
    
    if ($_GET['groupid'] != "") // group id changed
    {
        $_SESSION['groupid'] = $_GET['groupid'];
    }
    else // set groupid by rememberd value
    { 
        $_GET['groupid'] = $_SESSION['groupid']; 
    }
    
    
    
    if ($_GET['hostid'] != "") // host id changed
    { 
        $_SESSION['hostid'] = $_GET['hostid']; 
    }
    else // set host id by rememberd value
    { 
        $_GET['hostid'] = $_SESSION['hostid']; 
    }
    cheers'
    thomas
    Last edited by globifrosch; 02-09-2005, 16:57.
  • mlevin
    Junior Member
    • Nov 2004
    • 19

    #2
    IFAIK, Alexei is still closed for contributions, is he not?

    But that patch works like a charm!

    Comment

    • mlevin
      Junior Member
      • Nov 2004
      • 19

      #3
      Except, that id doesn't work with Host Configuration. May be somewhere else too.

      So, it is up to Alexei, to officially provide some sort of that functionality in the product.

      Comment

      • globifrosch
        Member
        • Sep 2005
        • 74

        #4
        there's something like that in cvs

        just checked out the cvs version of the php frontend. there's something like that. it remeber hostid,groupid (probably more...) per page.

        Comment

        • globifrosch
          Member
          • Sep 2005
          • 74

          #5
          no more errors in hosts.php...


          Code:
          if (! preg_match('/hosts\.php/',$_SERVER["SCRIPT_NAME"]))
          {
                  session_start();
          
                  if ($_GET['groupid'] != "")
                  {
                          $_SESSION['groupid'] = $_GET['groupid'];
                  }
                  else
                  {
                          $_GET['groupid'] = $_SESSION['groupid'];
          
                  }
          
          
                  if ($_GET['hostid'] != "")
                  {
                          $_SESSION['hostid'] = $_GET['hostid'];
                  }
                  else
                  {
                          $_GET['hostid'] = $_SESSION['hostid'];
                  }
          
                  if ($_GET['screenid'] != "")
                  {
                          $_SESSION['screenid'] = $_GET['screenid'];
                  }
                  else
                  {
                          $_GET['screenid'] = $_SESSION['screenid'];
                  }
          }

          Comment

          • marc
            Senior Member
            • Oct 2004
            • 146

            #6
            this is a nice feature..

            unfortunately i didnt see something like that in cvs code yet.

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              It is there since 1st of September or something.
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              • marc
                Senior Member
                • Oct 2004
                • 146

                #8
                ok, got it.. sorry for being blind.

                Comment

                Working...