1058 |
function safe_rename($fromdir,$fromfile,$tofile) { |
function safe_rename($fromdir,$fromfile,$tofile) { |
1059 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1060 |
print "$from -> $to\n"; |
print "$from -> $to\n"; |
1061 |
if (file_exists($from) && is_writable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1062 |
rename($from,$to); |
rename($from,$to); |
1063 |
} |
} |
1064 |
} |
} |
1166 |
|
|
1167 |
$htusers_file=dirname($SCRIPT_FILENAME)."/.htusers"; |
$htusers_file=dirname($SCRIPT_FILENAME)."/.htusers"; |
1168 |
if (! file_exists($htusers_file)) { |
if (! file_exists($htusers_file)) { |
1169 |
if (is_writable(dirname($SCRIPT_FILENAME))) { |
if (is_writeable(dirname($SCRIPT_FILENAME))) { |
1170 |
$htusers=fopen($htusers_file,"a+"); |
$htusers=fopen($htusers_file,"a+"); |
1171 |
fputs($htusers,"# Change owner of $htusers_file to root !!\n"); |
fputs($htusers,"# Change owner of $htusers_file to root !!\n"); |
1172 |
fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n"); |
fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n"); |
1321 |
// this functionality is doubled in DetailView(). |
// this functionality is doubled in DetailView(). |
1322 |
// better keep it here altogether |
// better keep it here altogether |
1323 |
// chmod perms to $gblFilePerms |
// chmod perms to $gblFilePerms |
1324 |
if ( file_exists($path) && !is_writable($path) ) |
if ( file_exists($path) && !is_writeable($path) ) |
1325 |
Error("File not writable", $relPath) ; |
Error("File not writable", $relPath) ; |
1326 |
$fh = fopen($path, "w+") ; |
$fh = fopen($path, "w+") ; |
1327 |
if ($fh) { |
if ($fh) { |