?? NEWTITLE := '  NOS/VE Set Management ' ??
MODULE stm$misc_service_routines;
?? RIGHT := 110 ??

{
{ PURPOSE:
{   This module contains those procedures of common use by the user level  set
{   manager.   This  includes  routines  to  validate  access,  and  to verify
{   parameters.
{
{ DESIGN: These routines may be run anywhere.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc ste$error_condition_codes
*copyc ost$name
*copyc ost$status
*copyc ost$user_identification
*copyc rmt$recorded_vsn
*copyc stt$access_status
?? POP ??
*copyc avp$configuration_administrator
*copyc osp$set_status_abnormal
*copyc pmp$get_user_identification
*copyc clv$non_alphanumeric
*copyc osv$lower_to_upper
?? TITLE := '  [XDCL] stp$validate_owner ', EJECT ??

  PROCEDURE [XDCL] stp$validate_owner
    (    owner: ost$user_identification;
     VAR valid_owner: boolean);

{  PURPOSE:
{    This determines if the owner is validated to do a request.  A valid
{    requestor is either the same as requested owner, or a system administrator.

    VAR
      job_owner: ost$user_identification,
      status: ost$status;

    pmp$get_user_identification (job_owner, status);
    valid_owner := (avp$configuration_administrator ()) OR (job_owner = owner);

  PROCEND stp$validate_owner;

?? TITLE := '  [XDCL] stp$validate_recorded_vsn ', EJECT ??

  PROCEDURE [XDCL] stp$validate_recorded_vsn
    (    recorded_vsn: rmt$recorded_vsn;
     VAR cap_recorded_vsn: rmt$recorded_vsn;
     VAR status: ost$status);

{  PURPUSE:
{     This procedure capatilizes a recorded vsn, and verifies that the recorded
{ vsn does not contain any non alphanumeric characters.

    VAR
      scan_index: 1 .. osc$max_name_size + 1,
      scan_found_non_alphanumeric: boolean;

    status.normal := TRUE;
    #TRANSLATE (osv$lower_to_upper, recorded_vsn, cap_recorded_vsn);
    #SCAN (clv$non_alphanumeric, recorded_vsn, scan_index, scan_found_non_alphanumeric);
    IF recorded_vsn (scan_index, * ) <> '' THEN
      osp$set_status_abnormal (stc$set_management_id, ste$improper_recorded_vsn, '', status);
    IFEND;
{ see clp$validate_name for help

  PROCEND stp$validate_recorded_vsn;
?? TITLE := '  [XDCL] stp$validate_access_status', EJECT ??

  FUNCTION [XDCL] stp$valid_access_status
    (    access_status: stt$access_status): boolean;

{  PURPOSE:
{    This function indicates if the users chosen access action is a valid choice.

    stp$valid_access_status := (access_status = stc$allow_access) OR (access_status = stc$deny_access);

  FUNCEND stp$valid_access_status;
?? OLDTITLE ??
MODEND stm$misc_servive_routines;
