.htpasswd Prob

Discussion in 'Setting-up protection' started by ben, Aug 6, 2003.

  1. ben

    ben Guest

    I have a problem my htpasswd and htgroup look so
    [​IMG]

    which can I do

    sorry for my english i 11 from germany
  2. ben

    ben Guest

    Win"nr" linux "n"

    now it work :D
    Code:
     }
    
        $f = @fopen($fn = "$config[data_dir]/.htpasswd", 'w');
        if (!$f) fatal_error("Cannot open $fn for write. Make directory $config[data_dir] and this file writeable for PHP scripts.");
        foreach ($users as $l => $p) {
            if ($plugin_config['protect']['htpasswd']['use_plain_text'])
                $pw = $p;
            else
                $pw = crypt($p, md5(rand()));
            fwrite($f, "$l:$pw nr");
        }
        fclose($f);    
    
        $f = @fopen($fn = "$config[data_dir]/.htgroup", 'w');
        if (!$f) fatal_error("Cannot open $fn for write. Make directory $config[data_dir] and this file writeable for PHP scripts.");
        foreach ($ul as $product_id => $user){
            fwrite($f, "PRODUCT_$product_id: ");
            foreach ($user as $l => $p)
                fwrite($f, $l . " ");
            fwrite($f, "nr");
        }
        fclose($f);    
    }

Share This Page