From: <cod...@go...> - 2008-10-07 19:23:30
|
Author: m0e.lnx Date: Tue Oct 7 12:22:12 2008 New Revision: 216 Modified: branches/iVL/.lang/FMain.pot branches/iVL/.project branches/iVL/DevLog branches/iVL/FMain.class branches/iVL/FrmRootPass.form branches/iVL/FrmUserAdd.class branches/iVL/FrmUserAdd.form branches/iVL/FrmZoneSet.class branches/iVL/FrmZoneSet.form branches/iVL/MdlUsrAdd.module Log: - User add window is ready for testing Modified: branches/iVL/.lang/FMain.pot ============================================================================== --- branches/iVL/.lang/FMain.pot (original) +++ branches/iVL/.lang/FMain.pot Tue Oct 7 12:22:12 2008 @@ -34,23 +34,23 @@ msgid "Skipping lilo setup" msgstr "" -#: FMain.class:405 +#: FMain.class:406 msgid "Process Overview" msgstr "" -#: FMain.class:425 +#: FMain.class:426 msgid "Next" msgstr "" -#: FMain.class:431 +#: FMain.class:432 msgid "Back" msgstr "" -#: FMain.class:437 +#: FMain.class:438 msgid "Exit Installation" msgstr "" -#: FMain.class:453 +#: FMain.class:454 msgid "Button1" msgstr "" Modified: branches/iVL/.project ============================================================================== --- branches/iVL/.project (original) +++ branches/iVL/.project Tue Oct 7 12:22:12 2008 @@ -1,7 +1,7 @@ # Gambas Project File 2.0 # Compiled with Gambas 2.9.0 Title=VectorLinux Installer -Startup=FrmUserAdd +Startup=MdlCore Version=0.0.102 Library=gb.gtk Library=gb.form Modified: branches/iVL/DevLog ============================================================================== --- branches/iVL/DevLog (original) +++ branches/iVL/DevLog Tue Oct 7 12:22:12 2008 @@ -1 +1 @@ -- User Add window is designed \ No newline at end of file +- User add window is ready for testing \ No newline at end of file Modified: branches/iVL/FMain.class ============================================================================== --- branches/iVL/FMain.class (original) +++ branches/iVL/FMain.class Tue Oct 7 12:22:12 2008 @@ -312,12 +312,13 @@ CASE "FrmRootPass" FrmRootPass.Button1_Click() - frmNext = FrmEmbUsrAdd + frmNext = FrmUserAdd - CASE "FrmEmbUsrAdd" + CASE "FrmUserAdd" frmNext = FrmNetConf + CASE "FrmNetConf" MdlNetConf.SET_HOSTNAME Modified: branches/iVL/FrmRootPass.form ============================================================================== --- branches/iVL/FrmRootPass.form (original) +++ branches/iVL/FrmRootPass.form Tue Oct 7 12:22:12 2008 @@ -20,14 +20,14 @@ Text = ("") Password = True } - { tlPass2 TextLabel - MoveScaled(2,37,22,4) - Text = ("Re-Enter Password") - } { tbPasswd1 TextBox MoveScaled(29,31,21,3.1667) Text = ("") Password = True + } + { tlPass2 TextLabel + MoveScaled(2,37,22,4) + Text = ("Re-Enter Password") } { tlPass1 TextLabel MoveScaled(2,32,22,4) Modified: branches/iVL/FrmUserAdd.class ============================================================================== --- branches/iVL/FrmUserAdd.class (original) +++ branches/iVL/FrmUserAdd.class Tue Oct 7 12:22:12 2008 @@ -21,10 +21,19 @@ PUBLIC SUB Form_Open() Fmain.frmcurr = ME + + WITH FMain + .FrmCurr = ME + .tvPlan["Conf2"].Picture = MdlCore.sDonePic + .tvPlan["Conf3"].picture = MdlCore.sNowPic + .tvPlan["Conf3"].Selected = TRUE + END WITH WITH ME .tlBanner.Text = "<h3>" & ("Create User Accounts") & "</h3>" END WITH - WAIT 1 + 'WAIT 3 + + MdlUsrAdd.DISPLAY_USER_GROUP_OPTIONS() END @@ -33,31 +42,63 @@ DIM sCAPS AS String DIM sCHAR AS String DIM sLogE AS String - DIM sPicdir AS String = "/mnt/target/usr/share/apps/kdm/pics/users/" - DIM sGroups AS String = "plugdev,disk,cdrom,floppy,lp,scanner,audio,video,games" + DIM sPicdir AS String = ClsGlobal.sTargetMnt &/ "usr/share/apps/kdm/pics/users/" + DIM sGroups AS String '= '"plugdev,disk,cdrom,floppy,lp,scanner,audio,video,games" + DIM cb AS CheckBox + + IF ME.tbUsername.Text = "" THEN - Message("Enter a UserName") + Message(("Enter the login name that this user will use to login to this system.")) ELSE - SHELL "echo " & ME.tbUsername.Text & "| grep -e \'[A-Z]\'" TO sCAPS + 'SHELL "echo " & ME.tbUsername.Text & "| grep -e \'[A-Z]\'" TO sCAPS + IF ME.tbUsername.text LIKE "*[A-Z]*" THEN + 'IF ME.tbUsername.textNOT LIKE "*[a-z0-9_-]*" THEN + Message.Error(("Login name field contains illegal characters. Please use only lowercase letters and numbers")) + STOP EVENT + 'ELSE IF ME.tbUsernameNOT LIKE "*[a-z0-9_-]*" THEN + + + END IF + SHELL "echo " & ME.tbUsername.Text & "| grep -e \'[^a-z0-9_-]\'" TO sCHAR SHELL "grep -e ^" & ME.tbUsername.Text & " /mnt/target/etc/passwd" TO sLogE - IF sCAPS <> "" THEN - Message("Username contains illegal characters (CAPITAL)") - ELSE IF sCHAR <> "" THEN - Message("Username contains illegal characters") + + IF sCHAR <> "" THEN + Message(("Username contains illegal characters")) + STOP EVENT ELSE IF sLogE <> "" THEN - Message("Username already exists") + Message(("Username already exists")) + STOP EVENT ELSE IF ME.tbPasswd1.Text = "" THEN - Message("Enter a Password.") + Message(("Enter a Password.")) + STOP EVENT ELSE IF ME.tbPasswd1.Text = ME.tbPasswd2.Text THEN - IF IsDir(sPicdir) THEN - SHELL "cd " & sPicdir & " && ln -s root1.png root.face.icon" - SHELL "cd " & sPicdir & " && ln -s default3.png " & ME.tbUsername.Text & ".face.icon" + + 'IF IsDir(sPicdir) THEN + IF bUsePic.Value = TRUE THEN + 'SHELL "cd " & sPicdir & " && ln -s root1.png root.face.icon" ' This needs to go somewhere else + + 'SHELL "cd " & sPicdir & " ; ln -s default3.png " & ME.tbUsername.Text & ".face.icon" + SHELL "cd " & sPicdir & "; ln -s " & tbPicPath.Text & Space(1) & tbUsername.Text & ".face.icon" WAIT + ENDIF + + 'COMPILE LIST OF GROUPS THIS USER WILL BELONG TO + FOR EACH cb IN MdlUsrAdd.objGrps + IF cb.Value = TRUE THEN + sGroups = sGroups & "," & cb.Text + END IF + NEXT + sGroups = Right(sGroups, Len(sGroups) - 1) + Message(sGroups) + + + + SHELL "chroot /mnt/target groupdel " & ME.tbUsername.Text WAIT SHELL "chroot /mnt/target groupadd -g " & iUID & Space(1) & ME.tbUsername.Text WAIT 'Message("chroot /mnt/target /usr/sbin/useradd -m -s /bin/bash -u " & iUID & " -g " & ME.tbUsername.Text & " -G " & sGroups & ME.tbUsername.Text) @@ -65,9 +106,7 @@ 'Message("chroot /mnt/target /sbin/passwdx " & ME.tbUsername.Text & Space(1) & ME.tbPasswd1.Text) SHELL "chroot /mnt/target /sbin/passwdx " & ME.tbUsername.Text & Space(1) & ME.tbPasswd1.Text WAIT Message("user " & ME.tbUsername.Text & " was created.") - ME.tbUsername.Clear - ME.tbPasswd1.Clear - ME.tbPasswd2.Clear + btClrFrm_Click() ' clear the form INC iUID ELSE Message("Passwords do not match") @@ -80,7 +119,7 @@ SHELL "umount " & ClsGlobal.sTargetMnt &/ "dev" WAIT SHELL "umount " & ClsGlobal.sTargetMnt &/ "proc" WAIT Message("Vectorlinux has been installed click OK to reboot") - SHELL "reboot" + 'SHELL "reboot" END @@ -95,7 +134,7 @@ .tlBanner.Move(4, 4, .ClientWidth - (.tlBanner.left * 2)) .hrSep.Move(4, .tlBanner.top + .tlBanner.Height, .tlBanner.Width) .tlExp.Move(4, .hrSep.top + .hrSep.Height + 12, .hrSep.Width) - .TextLabel2.Move(4, .tlExp.top + .tlExp.Height + 8, MdlObjSizer.get_object_width(.TextLabel2.text) * 2) + .TextLabel2.Move(4, .tlExp.top + .tlExp.Height + 8, MdlObjSizer.get_object_width(.TextLabel2.text) * 2.5) .tbUsername.Move(.TextLabel2.Left + .TextLabel2.Width + 4, .TextLabel2.top, .TextLabel2.Width * 1.75) iboxleft = .tbUsername.Left @@ -106,10 +145,12 @@ .tbPasswd1.Move(iboxleft, .TextLabel3.top, iboxwidth) .TextLabel4.Move(4, .TextLabel3.top + .TextLabel3.height + 2, .TextLabel2.Width) .tbPasswd2.Move(iboxleft, .TextLabel4.top, iboxwidth) - .tlUserID.Move(4, .TextLabel4.top + .TextLabel4.Height + 2, .TextLabel2.Width) - .cbUserID.Move(iboxleft, .tlUserID.top, iboxwidth * 0.45) - .tbUsrID.Move(.cbUserID.Left + .cbUserID.Width + 4, .cbUserID.top, iboxwidth - (.cbUserID.Width + 4)) - .bUsePic.Move(4, .tbUsrID.top + .tbUsrID.Height + 8, MdlObjSizer.get_object_width(.bUsePic.Text) + 36) + '.tlUserID.Move(4, .TextLabel4.top + .TextLabel4.Height + 2, .TextLabel2.Width) + '.cbUserID.Move(iboxleft, .tlUserID.top, iboxwidth * 0.45) + '.tbUsrID.Move(.cbUserID.Left + .cbUserID.Width + 4, .cbUserID.top, iboxwidth - (.cbUserID.Width + 4)) + .bUsePic.Move(4, .tbPasswd2.top + .tbPasswd2.Height + 4, MdlObjSizer.get_object_width(.bUsePic.Text) + 36) + '.tbPicPath.Move(4,.tb + '.bUsePic.Move(4, .tbUsrID.top + .tbUsrID.Height + 8, MdlObjSizer.get_object_width(.bUsePic.Text) + 36) .tbPicPath.Move(4, .bUsePic.top + .bUsePic.Height + 2, .TextLabel2.Width + iboxwidth + 8) '.tbPicPath.Move(4, .bUsePic.top + .bUsePic.height + 2, .tlBanner.Width - (.btBrowse.Width + 4)) .btBrowse.Move(.tbPicPath.Left + .tbPicPath.Width + 4, .tbPicPath.top, MdlObjSizer.get_object_width(.btBrowse.text) + 36) @@ -118,21 +159,7 @@ .btClrFrm.Move(.Button1.Left + .Button1.Width + 4, .Button1.top, MdlObjSizer.get_object_width(.btClrFrm.text) + 36) '.pbUsrPic.Move(.tbUsername.Left + (.tbUsername.Width + 2), .tbUsername.top) .pbUsrPic.Move(.btBrowse.Left + .btBrowse.Width, tbUsername.top) - - - - - - '.Frame1.Move(4, 4, .ClientWidth - (.Frame1.left * 2), .ClientHeight - (.Frame1.Height * 2)) -' .TextLabel1.Move(4, 12, .Frame1.Width - (.TextLabel1.Left * 2)) - - ' .TextLabel2.Move(4, .TextLabel1.top + .TextLabel1.Height + 16, 130) - ' .tbUsername.Move(.TextLabel2.left + .TextLabel2.Width + 4, .TextLabel2.top, 150) - ' .TextLabel3.Move(4, .TextLabel2.top + .TextLabel2.Height + 4, 130) - ' .tbPasswd1.Move(.TextLabel3.left + .TextLabel3.Width + 4, .TextLabel3.top, 150) - ' .TextLabel4.Move(4, .TextLabel3.top + .TextLabel3.Height + 4, 130) - ' .tbPasswd2.Move(.TextLabel4.left + .TextLabel4.Width + 4, .TextLabel4.top, 150) - ' .Button1.Move(.TextLabel4.left, .TextLabel4.top + .TextLabel4.Height + 8, MdlObjSizer.get_object_width(.button1.text) + 24) + .btgrpHelp.Move(.fGroupSel.Width - (.btgrpHelp.Width + 4), 12) @@ -146,15 +173,7 @@ END -PUBLIC SUB cbUserID_Click() - IF Trim(cbUserID.text) = ("Auto") THEN - ME.tbUsrID.Visible = FALSE - ELSE - ME.tbUsrID.Visible = TRUE -END IF - -END PUBLIC SUB bUsePic_Click() @@ -199,5 +218,39 @@ cb.Delete NEXT MdlUsrAdd.DISPLAY_USER_GROUP_OPTIONS + +END + +PUBLIC SUB tbPasswd2_LostFocus() + + ' run a test here to see if passwords match + IF tbPasswd1.Text <> tbPasswd2.Text THEN + Message.Error(("Your password selections do not match. Please enter the same password twice")) + END IF + STOP EVENT + +END + +PUBLIC SUB tbUsername_KeyRelease() + + IF Key.text = Space(1) THEN + tbUsername.Text = Replace(tbUsername.text, Space(1), "") + END IF + +END + +PUBLIC SUB btBrowse_Enter() + + 'Balloon.Info("Test message in a ballooon control here", fGroupSel) + +END + +PUBLIC SUB btgrpHelp_Click() + + DIM sMsg AS String = "<h3>" & fGroupSel.Text & "</h3>" & "<br><br>" & + ("Groups are a way of administering permissions for your users. You grant the user") & "<br>" & + ("permission to do certain things by adding them to certain groups.") & "<br><br>" & + ("Select which groups you want this user to be a part of here") + Message(sMsg, ("OK")) END Modified: branches/iVL/FrmUserAdd.form ============================================================================== --- branches/iVL/FrmUserAdd.form (original) +++ branches/iVL/FrmUserAdd.form Tue Oct 7 12:22:12 2008 @@ -25,20 +25,9 @@ Text = ("") Password = True } - { cbUserID ComboBox - MoveScaled(16,31,16,3) - Text = ("") - ReadOnly = True - List = [("Auto"), ("Manual")] - } - { tbUsrID TextBox - MoveScaled(34,31,13,3) - Visible = False - Text = ("") - } { bUsePic CheckBox MoveScaled(2,35,45,3) - Text = ("User Picture ID for Login greeting") + Text = ("Use Picture ID for Login greeting") } { tbPicPath TextBox MoveScaled(2,39,55,3) @@ -54,6 +43,11 @@ { fGroupSel Frame MoveScaled(2,44,69,17) Text = ("User Rights Management") + { btgrpHelp Button + MoveScaled(58,2,9,3) + Text = ("Help") + Picture = Picture["icon:/16/help"] + } } { Button1 Button MoveScaled(1,63,14,3) @@ -67,7 +61,7 @@ } { TextLabel2 TextLabel MoveScaled(2,18,12,3) - Text = ("Username") + Text = ("Login Name") Alignment = Align.Normal } { TextLabel3 TextLabel @@ -86,11 +80,6 @@ } { hrSep Separator MoveScaled(30,8,12,1) - } - { tlUserID TextLabel - MoveScaled(2,31,12,3) - Text = ("User ID") - Alignment = Align.BottomLeft } { pbUsrPic PictureBox MoveScaled(58,21,8,8) Modified: branches/iVL/FrmZoneSet.class ============================================================================== --- branches/iVL/FrmZoneSet.class (original) +++ branches/iVL/FrmZoneSet.class Tue Oct 7 12:22:12 2008 @@ -38,14 +38,14 @@ END -PUBLIC SUB Button1_Click() -' THis is not necessary, since the next button on the main window handles this - - MdlZoneSet.SET_ZONE(ME.lbTmZone.Text) - MdlZoneSet.WRITE_CONF() - 'Message("TimeZone " & ME.lbTmZone.Text & " Was set.") - -END +' ' ' PUBLIC SUB Button1_Click() +' ' ' ' THis is not necessary, since the next button on the main window handles this +' ' ' +' ' ' MdlZoneSet.SET_ZONE(ME.lbTmZone.Text) +' ' ' MdlZoneSet.WRITE_CONF() +' ' ' 'Message("TimeZone " & ME.lbTmZone.Text & " Was set.") +' ' ' +' ' ' END PUBLIC SUB Form_Resize() Modified: branches/iVL/FrmZoneSet.form ============================================================================== --- branches/iVL/FrmZoneSet.form (original) +++ branches/iVL/FrmZoneSet.form Tue Oct 7 12:22:12 2008 @@ -3,11 +3,6 @@ { Form Form MoveScaled(0,0,81,55) Text = ("") - { Button1 Button - MoveScaled(49,46,12,3) - Visible = False - Text = ("Set TimeZone") - } { lbTmZone ListBox MoveScaled(1,23,32,23) } @@ -16,7 +11,7 @@ Text = ("Choose the correct timezone for the area in which you live.") } { cbHwClock ComboBox - MoveScaled(1,15,34,3.4286) + MoveScaled(1,15,34,3.3333) Text = ("ComboBox1") ReadOnly = True List = [("LocalTime"), ("UTC")] @@ -26,7 +21,7 @@ Text = ("Choose how\nyour hardware clock is set up.\nChoose UTC if you know that the clock is set up to\nthe Coordinated Universal Time (UTC/GMT). Otherwise,\nChoose localtime since most PCs are setup this way.") } { tlbanner TextLabel - MoveScaled(2,1,27,3.4286) + MoveScaled(2,1,27,3.3333) Text = ("") } { hrsep Separator Modified: branches/iVL/MdlUsrAdd.module ============================================================================== --- branches/iVL/MdlUsrAdd.module (original) +++ branches/iVL/MdlUsrAdd.module Tue Oct 7 12:22:12 2008 @@ -17,7 +17,7 @@ PUBLIC objGrps AS Object[] PUBLIC SUB DISPLAY_USER_GROUP_OPTIONS() -DIM sGrpList AS String = "cdrom,floppy,lp,scanner,audio,video,game,adm,sys,wheel" +DIM sGrpList AS String = "cdrom,floppy,lp,scanner,audio,video,game,adm,sys,wheel,plugdev,disk" DIM sGrpArr AS String[] DIM i AS Integer DIM sLabel, sComment, sToolTip AS String @@ -63,6 +63,12 @@ CASE "wheel" sComment = ("Elite user") bdefval = FALSE + CASE "plugdev" + sComment = ("Allow user to mount / un-mount Pendrive (USB Sticks)") + bdefval = TRUE + CASE "disk" + sComment = ("Allow user to mount / un-mount Removable HD Storage Devices") + bdefval = TRUE END SELECT 'x = 4 IF htotal > FrmUserAdd.width THEN @@ -90,3 +96,10 @@ END + +PUBLIC FUNCTION CREATE_NEW_ACCOUNT() + + + +END + |