Hi Jonathan,
I am not writing the script for you but at least some code I used
to something similar.
-----------
$entry = `ypmatch $userid passwd 2>/dev/null`;
@entry = split /:/, $entry;
$encrypted = "$entry[1]";
$pwuser = "$entry[0]";
chomp($pwuser);
chomp($userid);
if (!($userid)) {
open(FH, "< $userfile");
while(<FH>) {
($userid, $password, $group) = split(/:/, $_);
if (!("$pwuser" eq "$userid" )) {shift;}
}
}
if (crypt($password, $encrypted) ne $encrypted) {
#Do something
}
------------
mkdir $newic, 0750 || die "Problem creating directory $directory: $!\n";
-------------
open(FH, ">$base/.htacces");
print FH me;
print FH and;
print FH someonelse;
close FH;
With 4 and 5 I can only wish you good luck !!
Regs David
---------------------
>
> I am wanting to write a script to handle a few things
> 1. decrypt an encrypted password
> 2. create new directory
> 3. put .htaccess file into the new directory
> 4. allow file upload and subsequent unzip of files into the new directory
> 5. email to admin of the creation and subsequent events
>
> The password I want to use is a power-user pw (almost root priviledges) so I
> want to have the thing entered into the form in an encrypted version, and
> the script would call another script (not a sub) to handle the decryption
> and pass back the argument to the system call to login as the user and
> create the directory.
> ie: enter user: bear
> enter pw: r4t4
> dir to create: fred
> file to upload: freddies_pics.zip
> user for logins: friends
> pass for logins: guest
>
> script does:
> system login: bear
> password: yada
>
> login successful
> mkdir fred
> cd fred
> upload successful
> unzip freddies_pics.zip
> touch .htaccess
> encrypt guest
> put friends:erisy > .htaccess
> cat ../.root.priviledges > .htaccess
> output to screen:
> Directory created successfully
> http://server/fred/
> please login to verify
>
> mail to admin:
> subject: New directory and files done for $user
> system login: bear
> password: yada
>
> login successful
> mkdir fred
> cd fred
> upload successful
> unzip freddies_pics.zip
> touch .htaccess
> encrypt guest
> put friends:erisy > .htaccess
> system is locked down to them and the other codes per settings.
>
> That's the design of the flow, now I just need to get the stuff written.
> Any suggestions on an easy way to do this?
>
> Thanks,
> Robert
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]