File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -266,19 +266,21 @@ public static bool HackComputer(Hacknet.OS os, string[] args)
266
266
267
267
return false ;
268
268
}
269
- public static bool ChangeAdminPassword ( Hacknet . OS os , string [ ] args )
269
+ public static bool ChangeUserDetails ( Hacknet . OS os , string [ ] args )
270
270
{
271
271
Computer computer = os . connectedComp ;
272
- string newPass = args [ 1 ] ;
272
+ string oldUser = args [ 1 ] ;
273
+ string newUser = args [ 2 ] ;
274
+ string newPass = args [ 3 ] ;
273
275
if ( args . Length < 0 )
274
276
{
275
277
os . write ( "Usage: changeAdminPassword (NewPassword)" ) ;
276
278
return false ;
277
279
}
278
280
for ( int index = 0 ; index < computer . users . Count ; ++ index )
279
281
{
280
- if ( computer . users [ index ] . name . ToLower ( ) . Equals ( "admin" ) )
281
- computer . users [ index ] = new UserDetail ( "admin" , newPass , ( byte ) 0 ) ;
282
+ if ( computer . users [ index ] . name . ToLower ( ) . Equals ( oldUser ) )
283
+ computer . users [ index ] = new UserDetail ( newUser , newPass , ( byte ) 0 ) ;
282
284
}
283
285
return false ;
284
286
}
You can’t perform that action at this time.
0 commit comments