Changeset 569 for branches/guitools-1.0/smbusers/smbusers.VRX
- Timestamp:
- Mar 30, 2011, 11:41:45 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/guitools-1.0/smbusers/smbusers.VRX
r451 r569 375 375 */ 376 376 _GroupRecWriteBackToStems: 377 IF options.!debug == 1 THEN say '_GroupRecWriteBackToStems() started' 377 378 Cur = VRMethod("CN_Groups","GetFieldData", GRH, GNrFH) 378 379 Groupname.Cur = VRMethod("CN_Groups","GetFieldData", GRH, GroupnameFH) … … 380 381 GUsers.Cur = VRMethod("CN_Groups","GetFieldData", GRH, GusersFH) 381 382 if Gusers.Cur = "," then Gusers.Cur = "" 383 IF options.!debug == 1 THEN say '_GroupRecWriteBackToStems() done' 382 384 return 383 385 … … 392 394 call lineout newgroup, '# groupname:password:GID:user[,user,...,]' 393 395 do I = 1 to groupname.0 394 say "GUsers."I"="Gusers.I396 /* say "GUsers."I"="Gusers.I */ 395 397 if settings.!FixErrors then do 396 398 if Gusers.I = "," then Gusers.I = "" … … 534 536 if settings.!SyncPrimGID = "" then settings.!SyncPrimGID = 0 535 537 538 settings.!WriteMasterPwd = VRGetIni( "Settings", "WriteMasterPwd", OurINI) 539 if settings.!WriteMasterPwd = "" then settings.!WriteMasterPwd = 0 540 536 541 options.!debug = VRGetIni( "Options", "Debug", OurINI) 537 542 if options.!debug = "" then options.!debug = 0 … … 565 570 ok = VRSetIni( "Settings", "SyncFullName", settings.!SyncFullName, OurINI, 'NoClose' ) 566 571 ok = VRSetIni( "Settings", "SyncPrimGID" , settings.!SyncPrimGID , OurINI, 'NoClose' ) 572 ok = VRSetIni( "Settings", "WriteMasterPwd",settings.!WriteMasterPwd,OurINI, 'NoClose' ) 573 567 574 ok = VRSetIni( "Options", "Debug", options.!debug, OurINI, 'NoClose' ) 568 575 … … 845 852 CALL NLVSetText 'CB_SyncFullName', 'Caption', 26 846 853 CALL NLVSetText 'CB_SyncPrimGID', 'Caption', 27 847 854 CALL NLVSetText 'CB_WriteMasterPwd','Caption', 190 848 855 849 856 return … … 915 922 do until lines(samba.!error) = 0 916 923 PolLine = linein(samba.!error) 917 say polline 924 /* say polline */ 918 925 select 919 926 when pos(":",PolLine) > 0 then iterate … … 1617 1624 */ 1618 1625 _UserRecWriteBackToStems: 1619 if \VRIsValidObject( RH ) then return 1620 Cur = VRMethod("CN_Users","GetFieldData", RH, NrFH) 1621 Username.Cur = VRMethod("CN_Users","GetFieldData", RH, UsernameFH) 1622 UID.Cur = VRMethod("CN_Users","GetFieldData", RH, UIDFH) 1623 GID.Cur = VRMethod("CN_Users","GetFieldData", RH, GIDFH) 1624 GECOS.Cur = VRMethod("CN_Users","GetFieldData", RH, GECOSFH) 1625 Home.Cur = _PathStrkLIBC(VRMethod("CN_Users","GetFieldData", RH, HomeFH)) 1626 Shell.Cur = VRMethod("CN_Users","GetFieldData", RH, ShellFH) 1627 MapTo.Cur = VRMethod("CN_Users","GetFieldData", RH, MapToFH) 1628 1629 if Settings.!SyncFullName = 1 & flags.Cur <> "" then do 1630 call PB_Save_Click 1631 say samba.!pdbeditexe' --user='Username.Cur' --modify --fullname="'GECOS.Cur'" 'DebugLevel' 2>'samba.!error 1632 address cmd samba.!pdbeditexe' --user='Username.Cur' --modify --fullname="'GECOS.Cur'" 'DebugLevel' 2>'samba.!error 1633 if RC <> 0 then call _SambaShowError /* ; else call _SambaShowMsg */ 1634 end 1635 /* These are not editable/visible xpwFH, password.i,xlcFH,LoginClass.I,xcpwFH, pwchange.I,xDeactFH, deact.I, Status.I ) */ 1636 1637 /* smbpasswd fields */ 1638 /* we do not allow editing these 1639 FLagsFH, flags.I, LMHashFH, LMHash.I,NTHashFH, NTHash.I, LCTFH, LCT.I) 1640 */ 1626 IF options.!debug == 1 THEN say '_UserRecWriteBackToStems() started' 1627 1628 if VRMethod( "CN_Users", "ValidateRecord", RH ) then do 1629 Cur = VRMethod("CN_Users","GetFieldData", RH, NrFH) 1630 Username.Cur = VRMethod("CN_Users","GetFieldData", RH, UsernameFH) 1631 UID.Cur = VRMethod("CN_Users","GetFieldData", RH, UIDFH) 1632 GID.Cur = VRMethod("CN_Users","GetFieldData", RH, GIDFH) 1633 GECOS.Cur = VRMethod("CN_Users","GetFieldData", RH, GECOSFH) 1634 Home.Cur = _PathStrkLIBC(VRMethod("CN_Users","GetFieldData", RH, HomeFH)) 1635 Shell.Cur = VRMethod("CN_Users","GetFieldData", RH, ShellFH) 1636 MapTo.Cur = VRMethod("CN_Users","GetFieldData", RH, MapToFH) 1637 1638 if Settings.!SyncFullName = 1 & flags.Cur <> "" then do 1639 say " Sync is enabled, therefore we must save now!" 1640 call PB_Save_Click 1641 say samba.!pdbeditexe' --user='Username.Cur' --modify --fullname="'GECOS.Cur'" 'DebugLevel' 1>NUL 2>'samba.!error 1642 address cmd samba.!pdbeditexe' --user='Username.Cur' --modify --fullname="'GECOS.Cur'" 'DebugLevel' 1>NUL 2>'samba.!error 1643 if RC <> 0 then call _SambaShowError /* ; else call _SambaShowMsg */ 1644 end 1645 /* These are not editable/visible xpwFH, password.i,xlcFH,LoginClass.I,xcpwFH, pwchange.I,xDeactFH, deact.I, Status.I ) */ 1646 1647 /* smbpasswd fields */ 1648 /* we do not allow editing these 1649 FLagsFH, flags.I, LMHashFH, LMHash.I,NTHashFH, NTHash.I, LCTFH, LCT.I) 1650 */ 1651 end 1652 else say RH' is no valid record!' 1653 IF options.!debug == 1 THEN say '_UserRecWriteBackToStems() done' 1641 1654 return 1642 1655 … … 2077 2090 return 2078 2091 2092 /*:VRX CB_WriteMasterPwd_Click 2093 */ 2094 CB_WriteMasterPwd_Click: 2095 settings.!WriteMasterPwd = VRGet("CB_WriteMasterPwd","set") 2096 return 2097 2079 2098 /*:VRX CN_Groups_ContextMenu 2080 2099 */ … … 2164 2183 call beep 880, 20 2165 2184 RH = VRInfo("Record") 2185 say "RH="RH 2166 2186 2167 2187 /* write back all editable field to the stems */ … … 3442 3462 UID.nx = substr(VRGet("DT_UID","Caption"),6) 3443 3463 GID.nx = VRGet("DDCB_GID","Value") 3444 password.nx = "*" 3464 3465 if settings.!WriteMasterPwd = 1 then do 3466 call rxFuncAdd "Crypt", "RxCrypt", "RxCrypt" 3467 itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 3468 salt = "" 3469 do i = 1 to 8 3470 salt = salt || substr( itoa64, random( 0, 63 ) + 1, 1 ) 3471 end 3472 password.nx = Crypt(VRGet("EF_password","Value"), salt ) 3473 end 3474 else password.nx = "*" 3445 3475 loginclass.NX = '' /* dummy value */ 3446 3476 pwchange.NX = '0' /* dummy value */ … … 3732 3762 */ 3733 3763 PB_Save_Click: 3764 IF options.!debug == 1 THEN say 'PB_Save_Click() started' 3734 3765 call _MasterpasswdWrite 3735 3766 call _GroupWrite 3736 3767 call _PasswordDBRewrite 3737 3768 call _SmbUserMapWrite 3769 IF options.!debug == 1 THEN say 'PB_Save_Click() done' 3738 3770 return 3739 3771 … … 3803 3835 end 3804 3836 end 3837 if settings.!WriteMasterPwd = 1 then do 3838 call rxFuncAdd "Crypt", "RxCrypt", "RxCrypt" 3839 itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 3840 salt = "" 3841 do i = 1 to 8 3842 salt = salt || substr( itoa64, random( 0, 63 ) + 1, 1 ) 3843 end 3844 password.CurUserNr = Crypt(VRGet("EF_upPassword","Value"), salt ) 3845 call _UserRecWriteBackToStems 3846 call PB_Save_Click 3847 end 3805 3848 end 3806 3849 end
Note:
See TracChangeset
for help on using the changeset viewer.