Kernel::System::Registration

NAME

Kernel::System::Registration – Registration lib

DESCRIPTION

All Registration functions.

The Registration API contains calls needed to communicate with the OTRS Group Portal. The steps to register are:

 - Validate OTRS-ID (this results in a token)
 - Register the system - this requires the token.

This assures that all registered systems are registered against an existing OTRS-ID.

After registration a registration key is stored in the OTRS System. This key is, along with system attributes such as OTRS version and Perl version, sent to OTRS in a weekly update. This ensures the OTRS Group Portal contains up-to-date information on the current state of the OTRS System.

In order to make sure that registration keys are not used on multiple systems – something that can happen quite easily when copying a database to a different system – every update will retrieve a new UpdateID from the OTRS Group Portal. This is used when communicating the next update; if the received update would not contain the correct UpdateID the Portal refuses the update and an updated registration is required.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

    my $RegistrationObject = $Kernel::OM->Get('Kernel::System::Registration');

TokenGet()

Get a token needed for system registration. To obtain this token, you need to pass a valid OTRS ID and password.

    my %Result = $RegistrationObject->TokenGet(
        OTRSID   => 'myname@example.com',
        Password => 'mysecretpass',
    );

    returns:

    %Result = (
        Success => 1,
        Token   => 'ase1zfa234asfd234afsd1243',
    );

    or, on failure:

    %Result = (
        Success => 0,
        Reason  => "Can't connect to server",
    );

    or

    %Result = (
        Success => 0,
        Reason  => "Username unknown or password incorrect.",
    );

Register()

Register the system;

    my $Success = $RegistrationObject->Register(
        Token       => '8a85ad4c-e5ff-4b91-a4b3-0b9ea8e2a3dc'
        OTRSID      => 'myname@example.com'
        Type        => 'production',
        Description => 'Main ticketing system',  # optional
    );

RegistrationDataGet()

Get the registration data from the system.

    my %RegistrationInfo = $RegistrationObject->RegistrationDataGet(
        Extended => 1,              # optional, to also get basic system data
    );

RegistrationUpdateSend()

Register the system as Active. This also updates any information on Database, OTRS Version and Perl version that might have changed.

If you provide Type and Description, these will be sent to the registration server.

    my %Result = $RegistrationObject->RegistrationUpdateSend();

    my %Result = $RegistrationObject->RegistrationUpdateSend(
        Type        => 'test',
        Description => 'new test system',
        Debug       => 1,                 # optional
    );

returns

    %Result = (
        Success => 1,
    );

or

    %Result = (
        Success => 0,
        Reason  => 'Could not reach server',  # or other
    );

Deregister()

Deregister the system. Deregistering also stops any update jobs.

    my $Success = $RegistrationObject->Deregister(
        Token  => '8a85ad4c-e5ff-4b91-a4b3-0b9ea8e2a3dc',
        OTRSID => 'myname@example.com',
    );

    returns '1' for success or a description if there was no success

RegistrationDateCheck()

checks for the warning period before the registration grace period expires

    my $Result = $RegistrationObject->RegistrationDateCheck();

returns

    $Result = undef;            # everything is OK, no warning
    $Result = 'on-grace-period';  # grace registration period is about to expire, issue warning
    $Result = 'expired';        # grace period expired, disable system
Scroll to Top