Package DE_EPAGES::Flex::API::ConfigureEpages
This package contains response functions that return a response for a request received by the ConfigurationServer. The ConfigurationServer receives requests of the following format: REQUEST_NUMBER PASSWD REQUEST_LINE Example: 3 qwert6 newpasswd=qwert7 DE_EPAGES::Flex::API::Constants defines constants for each REQUEST_NUMBER and the $RESPONSE_FUNCTION hash that maps the REQUEST_NUMBER to a response function. Each response function defined here must be mentioned in $RESPONSE_FUNCTION. Each response function has 1 input argument: the REQUEST_LINE, and 1 output argument: the RESPONSE_LINE. A response has this format: 0|1 RESPONSE_LINE\r\n 0 means success, 1 failure. If a response function was executed successfully, the RESPONSE_LINE returned must be a (maybe empty) string. If a response function fails it must return undef.
@EXPORT_OK |
Functions
configureepages
This function is called whenever the ConfigurationServer gets the request REQUEST_CONFIGURE (1). It reconfigures the epages configuration files and restarts the epages service if necessary.
Syntax |
$Result = configureepages($RequestLine); |
Input |
|
Return |
|
getinfoepages
This function is called whenever the ConfigurationServer gets the request REQUEST_GET_INFO (2). It collects epages installation information and returns it as a string.
Syntax |
$Result = getinfoepages(); |
Return |
|
getpatchlog
This function is called whenever the ConfigurationServer gets the request REQUEST_GET_PATCH_LOG (4). It returns the content of $EPAGES_LOG/FlexPatch-[Store]-[Version].log where [Store] and [Version] are derived from $RequestLine.
Syntax |
$FileContent = getpatchlog($RequestLine); |
Input |
|
Return |
|
runpatch
This function is called whenever the ConfigurationServer gets the request REQUEST_RUN_PATCH (5). It executes each file in patch directory with arguments [Store] and [Version] where [Store] and [Version] are derived from $RequestLine.
Syntax |
$Result = runpatch($RequestLine); |
Input |
|
Return |
|
setpassword
This function is called whenever the ConfigurationServer gets the request REQUEST_SET_PASSWD (3). It sets a new password and/or a new allowedfrom list for the configuration server. If allowedfrom list is changed, the server is restarted.
Syntax |
$CryptedPasswd = setpassword($RequestLine); |
Input |
|
Return |
|
testpassword
This function is called whenever the ConfigurationServer gets a request. It compares the password in the request with the password in "$ENV{EPAGES_CONFIG}/Flex/ConfigServer.conf"->get( 'GLOBAL', 'Password');
Syntax |
$Result = testpassword($Passwd,$ConfigPasswd); $Result = testpassword('qwert6','34252574676545345672352...'); |
Input |
|
Return |
|