Revision 1759
Added by Dietmar about 12 years ago
functions.php | ||
---|---|---|
410 | 410 |
$retVal = false; |
411 | 411 |
if(!is_dir($dir_name)) |
412 | 412 |
{ |
413 |
// To create the folder with 0777 permissions, we need to set umask to zero. |
|
414 |
$oldumask = umask(0) ; |
|
413 | 415 |
$retVal = mkdir($dir_name, $dir_mode,$recursive); |
416 |
umask( $oldumask ) ; |
|
414 | 417 |
} |
415 | 418 |
return $retVal; |
416 | 419 |
} |
... | ... | |
425 | 428 |
function change_mode($sName, $iMode = 0) |
426 | 429 |
{ |
427 | 430 |
$bRetval = true; |
431 |
$iErrorReporting = error_reporting(0); |
|
428 | 432 |
$iMode = intval($iMode) & 0777; // sanitize value |
429 | 433 |
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') |
430 | 434 |
{ // Only chmod if os is not windows |
... | ... | |
437 | 441 |
$bRetval = chmod($sName, $iMode); |
438 | 442 |
} |
439 | 443 |
} |
444 |
error_reporting($iErrorReporting); |
|
440 | 445 |
return $bRetval; |
441 | 446 |
} |
442 | 447 |
|
... | ... | |
480 | 485 |
$sql = 'SELECT `parent`, `level` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$page_id; |
481 | 486 |
|
482 | 487 |
$query_page = $database->query($sql); |
483 |
$fetch_page = $query_page->fetchRow(); |
|
488 |
$fetch_page = $query_page->fetchRow(MYSQL_ASSOC);
|
|
484 | 489 |
$parent = $fetch_page['parent']; |
485 | 490 |
$level = $fetch_page['level']; |
486 | 491 |
if($level == 1) { |
... | ... | |
549 | 554 |
// Get id's |
550 | 555 |
$sql = 'SELECT `page_id` FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent; |
551 | 556 |
if( ($query = $database->query($sql)) ) { |
552 |
while($fetch = $query->fetchRow()) { |
|
557 |
while($fetch = $query->fetchRow(MYSQL_ASSOC)) {
|
|
553 | 558 |
$subs[] = $fetch['page_id']; |
554 | 559 |
// Get subs of this sub recursive |
555 | 560 |
$subs = get_subs($fetch['page_id'], $subs); |
... | ... | |
735 | 740 |
// can only be dirs |
736 | 741 |
if(!file_exists($acces_file)) { |
737 | 742 |
if(!make_dir($acces_file)) { |
738 |
$admin->print_error($MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE_FOLDER']);
|
|
743 |
$admin->print_error($MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE_FOLDER']);
|
|
739 | 744 |
} |
740 | 745 |
} |
741 | 746 |
} |
... | ... | |
765 | 770 |
// Chmod the file |
766 | 771 |
change_mode($filename); |
767 | 772 |
} else { |
768 |
$admin->print_error($MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE']);
|
|
773 |
$admin->print_error($MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE']);
|
|
769 | 774 |
} |
770 | 775 |
return; |
771 | 776 |
} |
... | ... | |
944 | 949 |
$sql .= 'FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.$page_id; |
945 | 950 |
$results = $database->query($sql); |
946 | 951 |
if($database->is_error()) { $admin->print_error($database->get_error()); } |
947 |
if($results->numRows() == 0) { $admin->print_error($MESSAGE['PAGES']['NOT_FOUND']); }
|
|
948 |
$results_array = $results->fetchRow(); |
|
952 |
if($results->numRows() == 0) { $admin->print_error($MESSAGE['PAGES_NOT_FOUND']); }
|
|
953 |
$results_array = $results->fetchRow(MYSQL_ASSOC);
|
|
949 | 954 |
$parent = $results_array['parent']; |
950 | 955 |
$level = $results_array['level']; |
951 | 956 |
$link = $results_array['link']; |
... | ... | |
989 | 994 |
if(file_exists($filename)) |
990 | 995 |
{ |
991 | 996 |
if(!is_writable(WB_PATH.PAGES_DIRECTORY.'/')) { |
992 |
$admin->print_error($MESSAGE['PAGES']['CANNOT_DELETE_ACCESS_FILE']);
|
|
997 |
$admin->print_error($MESSAGE['PAGES_CANNOT_DELETE_ACCESS_FILE']);
|
|
993 | 998 |
}else { |
994 | 999 |
unlink($filename); |
995 | 1000 |
if( file_exists($directory) && |
Also available in: Unified diff
! during Reformat/rebuild all existing access files in upgrade-script
root_parent will be set to page_id
! change multi-dimensional arrays (variables) to similar arrays in framework/functions.php