DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b225311be⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Build_Training_Users, seg_029011

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Archive;
with Debug_Tools;
with Directory_Tools;
with Log;
with Operator;
with Profile;
with String_Utilities;

procedure Build_Training_Users (First_User_Number : in Positive := 1;
                                Last_User_Number : in Positive;
                                Username_Prefix : in String := "Pdm";
                                Response : in String := "<PROFILE>") is

    package Naming renames Directory_Tools.Naming;
    package Object renames Directory_Tools.Object;

    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    Current_Response_Profile : Profile.Response_Profile :=
       Profile.Value (Response);

    function Capitalize (A_String : String) return String
        renames String_Utilities.Capitalize;

    procedure Closing_Message_For_Errors is
    begin
        Log.Put_Line
           ("[Finished building training users -- Error(s) detected]");
        Profile.Set (Old_Response_Profile);
    end Closing_Message_For_Errors;

    function Current_Library (Of_Object : String) return String is
        All_Objects : Object.Iterator := Naming.Resolution (Of_Object);
        An_Object : Object.Handle;
    begin
        An_Object := Object.Value (All_Objects);
        return Naming.Unique_Full_Name (An_Object);
    end Current_Library;

begin
    -- set up the response profile and log the command line
    --
    Profile.Set (Current_Response_Profile);
    Log.Put_Line ("[Build_Training_Users (First_User_Number => " &
                  String_Utilities.Number_To_String (First_User_Number) &
                  ", Last_User_Number => " &
                  String_Utilities.Number_To_String (Last_User_Number) &
                  ", Username_Prefix => """ & Username_Prefix &
                  """, Response => """ & Response & """);]",
                  Profile.Auxiliary_Msg);

    declare
        Context : constant String := Capitalize (Current_Library ("$"));
        Course : constant String :=
           Capitalize (Naming.Simple_Name (Naming.Prefix (Context)));
        Master_Full_Pathname : constant String :=
           Capitalize ("!Users." & Course & "_Master");

    begin
        Operator.Enable_Privileges (Enable => True);

        if Operator.Privileged_Mode /= True then
            Log.Put_Line
               ("You must have operator capability to create training users",
                Profile.Error_Msg);
            Closing_Message_For_Errors;
            return;
        end if;

        if First_User_Number > Last_User_Number then
            Log.Put_Line
               ("The First_User_Number must be 'less than' or 'equal to' the Last_User_Number",
                Profile.Error_Msg);
            Closing_Message_For_Errors;
            return;
        end if;

        for User_Count in First_User_Number .. Last_User_Number loop
            declare  
                User_Number : constant String :=
                   String_Utilities.Number_To_String (User_Count);
                User_Name : constant String :=  
                   Username_Prefix & "_" & User_Number;
                Users_Full_Pathname : constant String :=
                   Capitalize ("!Users." & User_Name);
            begin  
                Operator.Create_User (User => User_Name,
                                      Password => User_Name,
                                      Volume => 0,
                                      Response => "<PROFILE>");
                Archive.Restore
                   (Objects => "?",
                    Use_Prefix => Users_Full_Pathname,
                    For_Prefix => Master_Full_Pathname,
                    Options =>  
                       "R1000, PROMOTE, PRIMARY, BECOME_OWNER, WORLD_ACL=(Network_Public => RWCOD), DEFAULT_ACL=(Network_Public => RW), OBJECT_ACL=(Network_Public => RW)",
                    Device => Context,
                    Response => "<PROFILE>");
                Log.Put_Line ("Completed building training user " & User_Name,
                              Profile.Positive_Msg);
            end;  
        end loop;

        Log.Put_Line ("[Finished building training users -- Examine the log]");
        Profile.Set (Old_Response_Profile);
    end;

exception
    when others =>
        Log.Put_Line ("Encountered an unexpected exception: " &
                      Debug_Tools.Get_Exception_Name, Profile.Exception_Msg);
        Closing_Message_For_Errors;

end Build_Training_Users;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=1e rec1=00 rec2=01 rec3=00a
        [0x01] rec0=17 rec1=00 rec2=02 rec3=090
        [0x02] rec0=1b rec1=00 rec2=03 rec3=05a
        [0x03] rec0=12 rec1=00 rec2=04 rec3=022
        [0x04] rec0=11 rec1=00 rec2=05 rec3=000
    tail 0x217226d1483c56fa97f63 0x42a00088462060003