Menu

How to create a public status page

2016-03-13
2024-02-19
  • routeserver

    routeserver - 2016-03-13

    Hi,

    I would like to offer some server on a public status page. Ist there a comfortable way?
    One way could be to create a user "public" and to create a url inclusive autologin. But it need to be a readonly user (incl. passwort changes).
    Do you know another / better way?

    thanks
    Joerg

     
  • David Field

    David Field - 2016-03-14

    I'd also love to do this, i'm using screenly to display information within our office, it doens't support password entry directly into the web interface, so i'd like to be able to create a public read only interface, if that means providing a URL based login thats fine. If theres anyone who can advise how to action this i'd be very appreciative.

     
  • Robby

    Robby - 2017-04-18

    Have anyone of you guy foudn a solution yet?

     
  • Tommy Grignon

    Tommy Grignon - 2017-05-24

    Yes there is my modifications :

    1. Create a Public user, give access to servers you want
    2. Memorize the ID it gives to you

    \src\psm\Service\User.php
    Line 98 (after $this->session = $session;)

      global $_GET;
    
      if ($_GET["kl"] == "public"){
         $user_id = 2;
         $this->setUserLoggedIn($user_id, true);
         $user = $this->getUser($user_id);
         $this->newRememberMeCookie();
      }
    

    When you will tap the URL http:/server/servermonitor/?kl=public it will take the Public account

    This method use a particular userid so even if somebody change the password, the script will never use it anyway.

    I changed something else to cut some menu items
    \psm\Module\AbstractController.php

    Line 271 : erase the server_update function, I think this is only the crontab need to make a status update and I seen some troubles when I make it manually.

    $items = array('server_status', 'server', 'server_log', 'user', 'config');

    Line 274 : comment the entire items line, when you are only User (Public account) you don't want to have other things to see other then the servers status page

    //$items = array('server_status', 'server', 'server_log', 'server_update');

     

    Last edit: Tommy Grignon 2017-05-25
    • Tyler

      Tyler - 2018-12-27

      Thank you for this! Is there a way to remove the "Welcome, %username%" and the dropdown menu that goes along with it and have this unique to the public user id? I don't think it's necessary for the public to logout or view profile of the public profile account.

       

      Last edit: Tyler 2018-12-27
  • Patrick Hofmann

    Patrick Hofmann - 2017-07-08

    Works for me :) thank you!
    Would be great if there would be a public option in the next release. for now i have to find out hot to hide the header for this specific user. I dont want them to see the menu at all. So they can not ad a phonenumber or change the e-mail for this "public" user.

     

    Last edit: Patrick Hofmann 2017-07-08
  • sean vreeland

    sean vreeland - 2017-08-12

    FYI on the line 274:

    It's better just to remove the items you don't want exposed to the public profile instead of commenting out the entire line, for example, if you want the public page to have access to everything BUT the server config page, you would just remove the term "server" so the line would look like this:

    $items = array('server_status', 'server_log', 'server_update');

     
  • RAFd3v

    RAFd3v - 2018-04-05

    Is there a way to fix the info line:
    Notice: Undefined index: kl in: \src\psm\Service\User.php on Line 100

     
  • Andrew Paternoster

    Try This code to get rid of the Notice: Undefined index: kl in: \src\psm\Service\User.php on Line 100
    $kl = "";
    $kl = isset($_GET["kl"]) ? $_GET["kl"] : '';
    if ($kl == "public"){
    $user_id = 3;
    $this->setUserLoggedIn($user_id, true);
    $user = $this->getUser($user_id);
    $this->newRememberMeCookie();
    }

     
  • nawa oooo

    nawa oooo - 2019-06-21

    PLease can some one provide more details on how this can be done.

    i want the php server mon to skip the log in page and go straight to the server. is this possible?

     
  • Kied

    Kied - 2021-03-14

    any news? has already built in maybe in new release?

     
  • Natter Andaman

    Natter Andaman - 2024-02-19

    Hi

    if ($_GET["kl"] == "public"){
    $user_id = 2;
    $this->setUserLoggedIn($user_id, true);
    $user = $this->getUser($user_id);
    $this->newRememberMeCookie();
    }

    This code works but I would like an user_id can work more than id=2 like I want to let it work from id 2 to id 50 how to do that

     

Log in to post a comment.