home *** CD-ROM | disk | FTP | other *** search
- {***************************************************************************}
- {** Program : CHANPASS **}
- {***************************************************************************}
- {** Version : 1.0 ** Started : ** Ended : **}
- {***************************************************************************}
- {******************************** Description ******************************}
- {***************************************************************************}
- {** Program to change a users password. **}
- {** **}
- {** **}
- {** **}
- {** **}
- {** **}
- {** **}
- {** **}
- {***************************************************************************}
- {******************************** Information ******************************}
- {***************************************************************************}
- {** **}
- {** **}
- {** **}
- {** **}
- {** **}
- {** **}
- {***************************************************************************}
-
- {$X+}
-
- program CHANPASS;
-
- uses
-
- nwvar,
- nwerror,
- nwbindry,
- nwmisc
- ;
-
- var
-
- BS : BinderyOBJ;
- MNW : MiscFuncOBJ;
- OldPW,
- NewPW : TPassword;
-
- procedure Initialise;
-
- begin
-
- if paramcount < 2 then
- begin
-
- writeln;
- writeln ('USAGE : [oldpassword] [newpassword]');
- writeln;
- halt;
-
- end;
-
- BS.Init (true);
- MNW.Init (true);
- OldPW := paramstr (1);
- NewPW := paramstr (2);
-
- end; {Initialise}
-
- {***}
-
- procedure Done;
-
- begin
-
- BS.Done;
- MNW.Done;
-
- end; {Done}
-
- {***}
-
- procedure ChangePassword;
-
- var
-
- ObjectName : TObjectName;
- ObjectType : OT_BinderyType;
- ObjectID : OT_BinderyID;
-
- begin
-
- WITH MNW DO
- GetObjectNameID (GetDefaultFileServerName, ObjectName, ObjectType, ObjectID);
- writeln ('Changing password for user : ', ObjectName);
- write ('Status code : ');
- writeln (GetBinderyServicesError (BS.ChangeBinderyObjectPassword (ObjectName, ObjectType,
- OldPW, NewPW)));
-
- end; {ChangePassword}
-
- {***}
-
- begin
-
- Initialise;
- ChangePassword;
- Done;
-
- end.