$Web LogMsg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
(Automatically generated page update)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_LogMsg}}
{{DISPLAYTITLE:$Web_LogMsg}}
<span class="pageSubtitle"><section begin="desc" />Get saved logon message<section end="desc" /></span>
<span class="pageSubtitle">Get saved logon message</span>
 


<var>$Web_LogMsg</var> retrieves a saved logon messages.


<var>$Web_LogMsg</var> retrieves a saved logon messages.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%MSG = $Web_LogMsg( num )
<p class="syntax"><span class="term">%msg</span> = <span class="literal">$Web_LogMsg</span>( <span class="term">num</span> )
<section end="syntax" /></p>
</p>


===Syntax terms===
<table class="syntaxTable">
<tr><th>%msg</th>
<td>A string variable to contain the returned value, which is null if there is an error condition.</td></tr>


<var>$Web_LogMsg</var> takes one argument and returns a string, or null for any error condition.
<table class="syntaxTable">
<tr><th>num</th>
<tr><th>num</th>
<td>The saved message number. This is a required argument.
<td>The saved message number. This is a required argument.</td></tr>
</td></tr></table>
</table>
 
==Usage notes==
<ul>
<li>If the port definition contains a <var>[[LOGMSGI (JANUS DEFINE parameter)|LOGMSGI]]</var> parameter, <var>$Web_LogMsg</var> will always return a null.


<li>If an invalid message number is specified (less than or equal to 0 or greater than the number of saved messages) <var>$Web_LogMsg</var> will return a null.


If the port definition contains a <var>[[LOGMSGI (JANUS DEFINE parameter)|LOGMSGI]]</var> parameter, <var>$Web_LogMsg</var> will always return a null. If an invalid message number is specified (less than or equal to 0 or greater than the number of saved messages) <var>$Web_LogMsg</var> will return a null.
<li><var>$Web_Num_LogMsg</var> and <var>$Web_LogMsg</var> are probably most useful in a JANUS WEB ON LOGONERR routine, but they can be used in any JANUS WEB ON routine.
</ul>


<var>$Web_Num_LogMsg</var> and <var>$Web_LogMsg</var> are probably most useful in a JANUS WEB ON LOGONERR routine, but they can be used in any JANUS WEB ON routine.
==Example==
This is an example of how <var>$Web_LogMsg</var> can be used to scan logon messages looking for an ACF2 message that perhaps indicates the reason for a logon failure. Depending on the reason (incorrect password, expired password, suspended account) appropriate action can be taken.  
<p class="code">FOR %I FROM 1 TO $Web_Num_LogMsg
<p class="code">FOR %I FROM 1 TO $Web_Num_LogMsg
%MSG = $Web_LogMsg(%I)
%MSG = $Web_LogMsg(%I)
Line 28: Line 36:
</p>
</p>


This type of loop is highly recommended rather than depending on a particular message number containing the required message. By requesting a hard-coded message number, an application might expose itself to <var class="product">Model 204</var> or external authorizer release dependencies. In the same way, analysis or parsing of the message should be made as flexible as reasonable to avoid release dependencies.


This is an example of how <var>$Web_LogMsg</var> can be used to scan logon messages looking for an ACF2 message that perhaps indicates the reason for a logon failure. Depending on the reason (incorrect password, expired password, suspended account) appropriate action can be taken. This type of loop is highly recommended rather than depending on a particular message number containing the required message. By requesting a hard-coded message number an application might expose itself to <var class="product">Model 204</var> or external authorizer release dependencies. In the same way, analysis or parsing of the message should be made as flexible as reasonable to avoid release dependencies.
==See also==
 
<ul>
See also [[$Web_Num_LogMsg]].
<li><var>[[$Web_Num_LogMsg]]</var>
</ul>


[[Category:Janus Web Server $functions|$Web_LogMsg]]
[[Category:Janus Web Server $functions|$Web_LogMsg]]

Latest revision as of 00:43, 16 April 2013

Get saved logon message

$Web_LogMsg retrieves a saved logon messages.

Syntax

%msg = $Web_LogMsg( num )

Syntax terms

%msg A string variable to contain the returned value, which is null if there is an error condition.
num The saved message number. This is a required argument.

Usage notes

  • If the port definition contains a LOGMSGI parameter, $Web_LogMsg will always return a null.
  • If an invalid message number is specified (less than or equal to 0 or greater than the number of saved messages) $Web_LogMsg will return a null.
  • $Web_Num_LogMsg and $Web_LogMsg are probably most useful in a JANUS WEB ON LOGONERR routine, but they can be used in any JANUS WEB ON routine.

Example

This is an example of how $Web_LogMsg can be used to scan logon messages looking for an ACF2 message that perhaps indicates the reason for a logon failure. Depending on the reason (incorrect password, expired password, suspended account) appropriate action can be taken.

FOR %I FROM 1 TO $Web_Num_LogMsg %MSG = $Web_LogMsg(%I) IF $SUBSTR(%MSG, 1, 10) EQ 'M204.1500:' THEN JUMP TO GOTACF2MSG END IF END FOR

This type of loop is highly recommended rather than depending on a particular message number containing the required message. By requesting a hard-coded message number, an application might expose itself to Model 204 or external authorizer release dependencies. In the same way, analysis or parsing of the message should be made as flexible as reasonable to avoid release dependencies.

See also