delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

Can I do this from with a perl script (e.g. I want to create an admin interface).


I'm running perl on a unix server, and i want to use htpasswd to protect some directories. Can I do this from with a perl script (e.g. I want to create an admin interface).

TOP

Thanks, didn't mean to cross post.
I've already created a number of admin interfaces, and used htaccess before. The interfaces set up new accounts for various services on a server. Each account needs it's own passwd and username. At the moment these have to be created manually via telnet. I just wanted to make the whole process dummy proof.

TOP

Thanks, I'm not asking for ne1 to write my scripts for me, I just thought that I would ask for a little advice.
I don't need to be lectured to in a patronising manner in the process.

TOP

OK, I am asking something specific:
1) I know that I can get away with a system() call to htpasswd command to add another user, but I think this is not that elegant. I am looking for some way to crypt the password so it would be stored in a .htpasswd file. Any suggestions or tutorials??
2) Is the split() function a good way to search for a username in the .htpasswd file?? Something like:
foreach $line (<FILE> ){
   ($user, $pass) = split(/:/,$line);
   if ($user == $q->param("username")){
      $found=1;
      last;
   }else{
      $found = 0;
   }
}
Hoping for an answer...  

TOP

abstract:

Can I do this from with a perl script (e.g. I want to create an admin interface).


Just a few questions:
1) Why are you using $username to retrieve the salt characters??? Is this the username the suer submited to the script, or the one that is extracted from the .htpasswd file??
2) Thanks for the tips, shortened the code a bit and showed me some cool coding...   But I a mglad I was on theright track at least...

TOP

Yes, I know about salt cahracters, and that the standard DES encryption scheme starts with two random characters. What got me confused, was that freebsd used the first 2 characters out of the username. But just now I figured that it was done probably because the username is "there" i.e. it is handy, and Apache doesn't care as long as the passwords are encrypted as they should be.
Am I on the right track here???  

TOP

Thanks a million guys!!! I havent't tried it yet (still caught up in some ohter wok, not computer related) but I will try it as soon as I can muster some serious time.
Thanks again!! No beating this forum!  

TOP


本届世界杯,“章鱼哥”保罗凭借八次成功预测成为这个夏天最受欢迎动物明星。随着章鱼的走红,关于它的小道消息也开始满天飞。北京时间7月12日,据德国《图片报》报道,德国的两个水族馆对保罗的身世发生了争执。章鱼哥现在的东家奥博豪森水族馆说,保罗现年2岁半,由于章鱼的寿命一般不超过3岁,它很难赶上2年后的欧洲杯。而德国拜仁州科尔堡水族馆却坚持声称,保罗仅仅4个月大,肯定能预测两年后的欧洲杯。章鱼哥的身世突然出现了两个版本,一时让人真假难辨。
                     

保罗现在处于奥博豪森水族馆,该水族馆称,保罗出生在英国的海边小镇韦茅斯,现在的年龄是两岁半。不过,德国拜仁州科尔堡水族馆的饲养员巴尔齐却表示,奥博豪森水族馆在说谎。巴尔齐表示,他曾经是保罗的饲养员,并对保罗进行过训练。最令人感到不可思议是,保罗是今年四月份他从一名渔民手中买下的。此前,一直在科尔堡水族馆生活。今年六月世界杯开赛前,保罗才来到了奥博豪森水族馆,并开始了神奇的预测。
巴尔齐说,今年四月,他亲自从地中海的一名渔民中买了包括保罗在内的五条章鱼当时,保罗最多一个月大,只有10厘米长。奥博豪森水族馆曾经宣传保罗已经2岁半,实际上他现在最多4个月大。按照巴尔齐的说法,章鱼哥肯定能够赶上预测两年后的欧洲杯。此外,巴尔齐还透露了一个惊人的消息:今年六月初,科尔堡向奥博豪森水族馆出售过一条章鱼,售价179欧元,折合人民币1533元,而保罗是奥博豪森水族馆唯一的章鱼。
巴尔齐的话,立即引起了轩然大波。奥博豪森水族馆回应说,今年六月,该水族馆确实从科尔堡购买过一条章鱼,但马上转卖给了施派尔市的水族馆。科尔堡水族馆随即作出了回应,他们说:“上周四,我们还去奥博豪森看望过保罗,保罗和我们卖给奥博豪森的章鱼非常像,大小完全一样。而且,它还会一些科尔堡时巴尔奇教给它的小技巧。”
有道是人怕出名猪怕壮,这章鱼出名了麻烦事情也不少。章鱼哥到底多大,究竟来自何方,现在看已经成了一个谜。



Can I do this from with a perl script (e.g. I want to create an admin interface).

TOP

Back Forum