3.15. webtool

3.15.1. NAME

webtool - Guardian Digital WebTool module interface to... itself!

3.15.2. SYNOPSIS

use webtool;
my $webtool   = new webtool;

3.15.3. DESCRIPTION

This Guardian Digital WebTool module provides an interface to manipulating the Guardian Digital WebTool. This module allows you to manage WebTool users, their language, and their access rights.

3.15.4. METHODS

encrypt_password($)

This function is used to encrypt a password string. It receives password string as an argument, it returns encrypted password.

Example Usage:

$encrypted_password = $webtool->encrypt_password($password);

enumerate_languages()

This function returns an array of the translations currently defined in the WebTool, suitable for use in a $page->input_select().

Example Usage:

my @languages  = $webtool->enumerate_languages();

read_acl_files()

Essentially this function reads .acl files located under each module directory and returns a hash reference containing values of major,minor and description for each file under that directory.

Example Usage:

my $acls = $webtool->read_acl_files();

read_acl_major_minor($)

Essentially this function reads values of major, minor and description, It receives file(.acl) as argument and returns result in array form.

Example Usage:

my $tmp = $webtool->read_acl_major_minor($acl);

restart()

This function is used to restart the webtool service.

Example Usage:

$webtool->restart();

account_create($)

This function is used to create/update webtool account. It receives hash reference as account details which contains username, language, password etc.

Example Usage:

my $a = {
      'username'      => $in{'username'},
      'password'      => $in{'password1'},
      'language'      => $in{'language'},
   };

$webtool->account_create($a);

account_delete($)

This function is used to delete webtool account. It receives webtool accountname as argument.

Example Usage:

$webtool->account_delete($accountname);

account_get($)

This function is used to get information of webtool account. It receives username(webtool account name) as an argument.It returns account detail in hash reference(username, password, language).

Example Usage:

my $accountdetail = $webtool->account_get($accountname);

list_accounts()

This function is used to get a list of all listed users in /etc/webtool/miniserv.users file and returns details(username, password, language) in hash reference.

Example Usage:

my $accounts  = $self->list_accounts();
foreach my $u (sort keys %{$accounts}) {
   my $user    = $accounts->{$u}->{'username'};
   my $pass    = $accounts->{$u}->{'password'};
   my $lang    = $accounts->{$u}->{'language'};
}

3.15.5. AUTHORS

Ryan W. Maple <ryan@guardiandigital.com>

3.15.6. COPYRIGHT AND LICENSE

Copyright Guardian Digital, Inc., All Rights Reserved