|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: @ F T
Length: 4775 (0x12a7)
Types: TextFile
Notes: @(#)Form.modusr2 13.3 (RC International) 91/11/26
Names: »Form.modusr2«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/sadm/sysadm/menu/usermgmt/modify/Form.modusr2«
# @(#)Form.modusr2 13.3 (RC International) 91/11/26
#ident "@(#)oamintf:usermgmt/Form.modusr2 1.2.1.4"
#
# @(#) Form.modusr2 Version 1.2 (90/05/03)
#
# Portions of this source code were provided by International
# Computers Limited (ICL) under a development agreement with AT&T.
#
################################################################################
# Module Name: Form.modusr2
#
################################################################################
form="Modify a User Login"
`set -l LIFE=longterm`
lifetime=$LIFE
framemsg=`readfile $INTFBASE/form.msg`
`logins -oxl $ARG1 | set -l LOGIN`
help=OPEN TEXT $INTFBASE/Text.itemhelp $LININFO
wrap=false
done=`message -w "Modifying user $ARG1.";
set -l UMODERR=/tmp/$VPID.mue;
rm -f/tmp/sgrp;
set -l COPT="-c";
if [ $F3 ];
then
set -l UOPT="-u";
fi;
if [ $F4 ];
then
set -l GOPT="-g";
fi;
set -l SGOPT="-G";
if [ $F6 ];
then
set -l DOPT="-d";
set -l MOPT="-m";
fi;
if [ $F8 ];
then
set -l SOPT="-s";
fi;
if [ $F2 ];
then
set -l LOPT="-l";
fi;
set -l FOPT="-f";
set -l EOPT="-e";
usermod $COPT "$F1" $UOPT $F3 $GOPT $F4 $SGOPT "$F5" $DOPT $F6 $MOPT $SOPT $F8 $LOPT $F2 $FOPT "$F9" $EOPT "$F10" $ARG1 2> $UMODERR;
message -w "";
if [ $RET -eq 0 ];
then
set -l LIFE=shortterm;
set -l CMD="OPEN TEXT $OBJ_DIR/Text.musrok $ARG1";
else
set -l CMD="OPEN TEXT $OBJ_DIR/Text.musrnok $ARG1";
fi`$CMD
# $F1
name=Comments:
lininfo=Form.modusr2:comments
nrow=1
ncol=3
frow=1
fcol=13
rows=1
columns=64
scroll=true
`echo $LOGIN | fmlcut -d: -f1 | set -l LNAM`
value=const `fmlgrep "^$LNAM:" /etc/passwd | fmlcut -d: -f 5`
valid=`valstr -r '^[ -9;-z]*$' $F1`
invalidmsg=const "ERROR: Please enter a character string, cannot include a (:)."
# $F2
name=Login:
lininfo=Form.modusr2:login
nrow=2
ncol=3
frow=2
fcol=10
rows=1
columns=8
`echo $LOGIN | fmlcut -d: -f1 | set -l LNAM`
value=const $LNAM
valid=`valstr -r '^[ -9;-z]\{0,8\}$' $F2 && uniq_lnam $F2 $LNAM`
invalidmsg=`if [$RET -eq 2 ];
then
echo "ERROR: Login Id must be unique.";
else
echo "ERROR: Please enter a character string 1-8 characters, cannot include a (:).";
fi`
# $F3
name=User ID:
lininfo=Form.modusr2:usrid
nrow=3
ncol=3
frow=3
fcol=12
rows=1
columns=5
`getmaxuid | set -l MAXUID;
echo $LOGIN | fmlcut -d: -f 2 | set -l UID`
value=const $UID
valid=`valrange -l100 -u$MAXUID $F3 && uniq_uid $F3 $UID`
invalidmsg=`if [ $RET -eq 2 ];
then
echo "ERROR: User ID must be unique.";
else
errange -l100 -u$MAXUID;
fi`
# $F4
name=Primary group:
lininfo=Form.modusr2:prigrp
nrow=4
ncol=3
frow=4
fcol=18
rows=1
columns=8
value=const `echo $LOGIN | fmlcut -d: -f 3`
rmenu=OPEN MENU $OBJ_DIR/Menu.pgrp
valid=`chk_pgrp $F4`
invalidmsg=const "ERROR: Please enter an existing group name or group id."
# $F5
name=Supplementary group(s):
lininfo=Form.modusr2:supgrp
nrow=5
ncol=3
frow=5
fcol=27
rows=1
columns=50
scroll=true
value=const `fmlgrep "[;,]$ARG1" /etc/group | fmlcut -d: -f1`
rmenu=OPEN MENU $OBJ_DIR/Menu.sgrp $F4
valid=`chk_sgrp $F4 $F5`
`readfile /tmp/sgrp | set -l BSG`
invalidmsg=`if [ $RET -eq 1 ];
then
echo "ERROR: Cannot enter same group name or group id as Primary group";
else
echo "ERROR: Cannot find group $BSG";
fi`
# $F6
name=Home directory:
lininfo=Form.modusr2:homdire
nrow=6
ncol=3
frow=6
fcol=19
rows=1
columns=58
scroll=true
`echo $LOGIN | fmlcut -d: -f6 | set -l HD`
value=$HD
#valid=`[ $HD = $F6 ] || valpath -na $F6`
valid=`[ $HD = $F6 ] || valpath -a $F6`
#invalidmsg=const `errpath -e "It must be a unique directory."`
invalidmsg=const `errpath -e "It must be a full pathname."`
# $F7
name=Home directory exists. Do you wish to reuse it?
lininfo=Form.modusr2:exists
nrow=7
ncol=3
frow=7
fcol=51
rows=1
columns=3
value=no
rmenu={ yes no }
valid=menuonly
show=`[ "$F6" != "$HD" -a -d "$F6" ]`
invalidmsg=const "You must enter yes or no"
# $F8
name=Shell:
lininfo=Form.modusr2:shell
nrow=8
ncol=3
frow=8
fcol=10
rows=1
columns=67
scroll=true
value=const `echo $LOGIN | fmlcut -d: -f7`
valid=`valpath -aox $F8`
invalidmsg="ERROR: Shell entered must exist and be executable."
# $F9
name=Login inactivity:
lininfo=Form.modusr2:inact
nrow=9
ncol=3
frow=9
fcol=21
rows=1
columns=7
value=const `fmlgrep "^$ARG1:" /etc/shadow | fmlcut -d: -f7`
valid=`valint $F9`
invalidmsg=const `errint $F9`
# $F10
name=Login expiration date:
lininfo=Form.modusr2:expire
nrow=10
ncol=3
frow=10
fcol=26
rows=1
columns=18
`fmlgrep "^$ARG1:" /etc/shadow | fmlcut -d: -f8 | set -l EXP`
value=const `convdate $EXP`
valid=`expdate $F10 || [ ! $F10 ]`
invalidmsg="Must be a future date."
name=RESET
button=8
action=RESET