Automatically Authorize New Displays - CMS V3

Hello,

We are using Xibo V3 CMS. This is a manual installation.

We are unable to find the setting “Automatically Authorize New Displays” in V 3, however this setting was available in V 1.8.

Would request for assistance on how to activate auto authorize feature.

I have tried the usersee / useredit 0/1 solution, however I am not sure where this needs to be done in the database.

Thanks,

CMS Version

Specify the full CMS version you are using, including the revision number.

Player Type

Include the Player type you are using.

Player Version

Include the full version, including the revision number.

Issue

Please provide full details as to the issue you are experiencing, include screenshots where possible.

1 Like

While many users have turned to the Xibo API for automating display detection and authorization, this approach feels like a workaround.

Your post inspired me to look if this functionality could be executed as a custom task within the Xibo CMS itself.

I’ll try to keep you posted if I manage to make any progress with this approach.

2 Likes

Managed to put together a custom task that automates display authorization.
Gave it a try on Xibo 4.2.3, and so far, it’s doing what it should.

Implementation

Within your Xibo installation, create the following files in the /custom/ directory.


xibo-cms/custom/AuthorizeDisplays.task

{
  "name": "Authorize Displays",
  "class": "\\Xibo\\Custom\\AuthorizeDisplays",
  "options": {}
}

xibo-cms/custom/AuthorizeDisplays.php

<?php
namespace Xibo\Custom;

use Xibo\XTR\TaskInterface;
use Xibo\XTR\TaskTrait;

class AuthorizeDisplays implements TaskInterface {

    use TaskTrait;

    private $displayFactory;

    public function setFactories($container) {
        $this->displayFactory = $container->get('displayFactory');
        return $this;
    }

    public function run() {
        $unauthorizedDisplays = $this->displayFactory->query(null, ['licensed' => 0]);
        foreach ($unauthorizedDisplays as $display) {
            $display->licensed = 1;
            $display->save();
        }
    }
}

Make www-data the owner of the files you just created.
Important: Replace the file path with your actual file path.

sudo chown www-data:www-data xibo-cms/custom/AuthorizeDisplays.*

To configure the “Authorize Displays” task in Xibo CMS:

  1. Open Xibo in your browser. Click on Tasks inside of the navigation on the left.
  2. Click Add Task in the top right corner.
  3. In the Task selection dropdown, locate and select Authorize Displays (at the bottom).
  4. Assign a task name (e.g., “Authorize Displays”).
  5. Default CRON syntax * * * * * is set to execute the task every minute, no change needed.
  6. Click Save.

A new window will appear, make sure to check Active, and hit Save again.

Important: Make sure that XTR is properly configured and running.

1 Like