From: <cod...@go...> - 2008-09-01 17:06:34
|
Author: uelsk8s Date: Mon Sep 1 10:05:33 2008 New Revision: 159 Added: branches/iVL/FrmUserAdd.class branches/iVL/FrmUserAdd.form Modified: branches/iVL/FMain.class branches/iVL/FrmRootPass.class branches/iVL/FrmZoneSet.form branches/iVL/MdlConfLilo.module branches/iVL/MdlCore.module branches/iVL/MdlZoneSet.module branches/iVL/installer.gambas Log: added useradd module Modified: branches/iVL/FMain.class ============================================================================== --- branches/iVL/FMain.class (original) +++ branches/iVL/FMain.class Mon Sep 1 10:05:33 2008 @@ -33,6 +33,7 @@ MdlCore.LOCK_GUI 'MdlCore.LOCK_GUI() ClsGlobal.sBackNav = NEW Object[] +ClsGlobal.sSourceMnt = "/mnt/cdrom" 'ClsGlobal.sSourceMnt = "/mnt" &/ "source" 'FOR TESTING ONLY '/ THE FOLLOWING LINES HAVE BEEN COMMENTED FOR TESTING ONLY @@ -260,7 +261,11 @@ CASE "FrmRootPass" - frmNext = FrmRootPass + frmNext = FrmUserAdd + + CASE "FrmUserAdd" + + frmNext = FrmLilo END SELECT Modified: branches/iVL/FrmRootPass.class ============================================================================== --- branches/iVL/FrmRootPass.class (original) +++ branches/iVL/FrmRootPass.class Mon Sep 1 10:05:33 2008 @@ -10,7 +10,8 @@ Message("Enter a Password for root.") ELSE IF ME.tbPasswd1.Text = ME.tbPasswd2.Text THEN - SHELL "chroot /mnt/target /sbin/passwdx root " & ME.tbPasswd1.Text + 'Message("chroot /mnt/target /sbin/passwdx root " & ME.tbPasswd1.Text) + SHELL "chroot /mnt/target /sbin/passwdx root " & ME.tbPasswd1.Text WAIT Message("Root password Set.") ME.tbPasswd1.Clear ME.tbPasswd2.Clear Added: branches/iVL/FrmUserAdd.class ============================================================================== --- (empty file) +++ branches/iVL/FrmUserAdd.class Mon Sep 1 10:05:33 2008 @@ -0,0 +1,57 @@ +' Gambas class file +PUBLIC iUID AS Integer = 1000 + +PUBLIC SUB Form_Open() + Fmain.frmcurr = ME +END + + +PUBLIC SUB Button1_Click() + 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" + + + IF ME.tbUsername.Text = "" THEN + Message("Enter a UserName") + ELSE + SHELL "echo " & ME.tbUsername.Text & "| grep -e \'[A-Z]\'" TO sCAPS + 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") + ELSE IF sLogE <> "" THEN + Message("Username already exists") + ELSE + IF ME.tbPasswd1.Text = "" THEN + Message("Enter a Password.") + ELSE + IF ME.tbPasswd1.Text = ME.tbPasswd2.Text THEN + IF IsDir(sPicdir) THEN + SHELL "ln -s " & sPicdir & "/default3.png " & sPicdir &/ ME.tbUsername.Text & ".face.icon" + ENDIF + 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) + SHELL "chroot /mnt/target /usr/sbin/useradd -m -s /bin/bash -u " & iUID & " -g " & ME.tbUsername.Text & " -G " & sGroups & Space(1) & ME.tbUsername.Text WAIT + '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 + INC iUID + ELSE + Message("Passwords do not match") + ME.tbPasswd1.Clear + ME.tbPasswd2.Clear + ENDIF + ENDIF + ENDIF + ENDIF +END + Added: branches/iVL/FrmUserAdd.form ============================================================================== --- (empty file) +++ branches/iVL/FrmUserAdd.form Mon Sep 1 10:05:33 2008 @@ -0,0 +1,44 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,64,64) + Text = ("") + { Frame1 Frame + MoveScaled(1,1,62,37) + Text = ("Add Users") + { TextLabel1 TextLabel + MoveScaled(2,2,29,18) + Text = ("Choose a unique name for each user. Enter the password for twice for accuracy. You can make as many users as you want, and when you are finished click next to continue.") + } + { TextLabel2 TextLabel + MoveScaled(36,2,12,2) + Text = ("Username") + } + { tbUsername TextBox + MoveScaled(36,5,15,2) + Text = ("") + } + { TextLabel3 TextLabel + MoveScaled(36,10,16,2) + Text = ("Enter Password") + } + { tbPasswd1 TextBox + MoveScaled(36,14,16,2) + Text = ("") + Password = True + } + { TextLabel4 TextLabel + MoveScaled(36,18,14,2) + Text = ("ReEnter Password") + } + { tbPasswd2 TextBox + MoveScaled(36,21,16,2) + Text = ("") + Password = True + } + { Button1 Button + MoveScaled(38,27,14,1) + Text = ("Create User") + } + } +} Modified: branches/iVL/FrmZoneSet.form ============================================================================== --- branches/iVL/FrmZoneSet.form (original) +++ branches/iVL/FrmZoneSet.form Mon Sep 1 10:05:33 2008 @@ -1,10 +1,10 @@ # Gambas Form File 2.0 { Form Form - MoveScaled(0,0,64,55) + MoveScaled(0,0,81,55) Text = ("") { Frame1 Frame - MoveScaled(1,1,62,53) + MoveScaled(1,1,79,53) Text = ("Set Hardware Clock and TimeZone") } { TextLabel1 TextLabel Modified: branches/iVL/MdlConfLilo.module ============================================================================== --- branches/iVL/MdlConfLilo.module (original) +++ branches/iVL/MdlConfLilo.module Mon Sep 1 10:05:33 2008 @@ -97,8 +97,8 @@ ELSE Message("Boot loader has been setup successfully") END IF - SHELL "umount " & ClsGlobal.sTargetMnt &/ "dev" WAIT - SHELL "umount " & ClsGlobal.sTargetMnt &/ "proc" WAIT + 'SHELL "umount " & ClsGlobal.sTargetMnt &/ "dev" WAIT + 'SHELL "umount " & ClsGlobal.sTargetMnt &/ "proc" WAIT SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "var/log/setup/init" WAIT SHELL "chmod 700 " & ClsGlobal.sTargetMnt &/ "var/log/setup/init" WAIT 'SHELL "touch " & ClsGlobal.sTargetMnt &/ "var/log/setup/init/config-stage2" Modified: branches/iVL/MdlCore.module ============================================================================== --- branches/iVL/MdlCore.module (original) +++ branches/iVL/MdlCore.module Mon Sep 1 10:05:33 2008 @@ -129,7 +129,7 @@ DIM i AS Integer - ClsGlobal.sSourceMnt = "/mnt/source" + 'ClsGlobal.sSourceMnt = "/mnt/source" sMountPoint = ClsGlobal.sSourceMnt sCmd = "cat /proc/sys/dev/cdrom/info | grep \"drive name\" |cut -f 2 -d\':\'|xargs -n 2" Modified: branches/iVL/MdlZoneSet.module ============================================================================== --- branches/iVL/MdlZoneSet.module (original) +++ branches/iVL/MdlZoneSet.module Mon Sep 1 10:05:33 2008 @@ -47,9 +47,9 @@ PUBLIC SUB SET_ZONE(sZone AS String) - SHELL "cd " & ClsGlobal.sTargetMnt & "/etc;rm " & sTimeLink & ";ln -s /usr/share/zoneinfo/" & sZone & Space(1) & sTimeLink + SHELL "cd " & ClsGlobal.sTargetMnt & "/etc;rm " & sTimeLink & ";ln -s /usr/share/zoneinfo/" & Trim(sZone) & Space(1) & sTimeLink PRINT "linking /usr/share/zoneinfo/" & sZone & " to /etc/" & sTimeLink - SHELL "cd " & ClsGlobal.sTargetMnt & "/etc;rm " & sTimeZone & ";cp /usr/share/zoneinfo/" & sZone & Space(1) & sTimeZone + SHELL "cd " & ClsGlobal.sTargetMnt & "/etc;rm " & sTimeZone & ";cp /usr/share/zoneinfo/" & Trim(sZone) & Space(1) & sTimeZone PRINT "copying /usr/share/zoneinfo/" & sZone & " to /etc/" & sTimeZone END @@ -64,4 +64,4 @@ File.Save(ClsGlobal.sTargetMnt & sTZConf, SConv(sConf)) END - \ No newline at end of file + Modified: branches/iVL/installer.gambas ============================================================================== Binary files. No diff available. |