Project

General

Profile

Feature #14211 » 0000171-is_writable.diff

Administrator Admin, 2004-09-19 15:09

View differences:

/var/www/quickstart/typo3_src/ChangeLog 2004-09-19 15:04:28.000000000 +0200
2004-09-19 Michael Stucki <mundaun@gmx.ch>
* Replaced all (comments AND code!) occurences of "writeable" with "writable"
* Fixed bug #0000171: Displaying wrong filepermissions in filelist module
2004-09-19 Ingmar Schlecht <ingmars@web.de>
* Changed <meta name="generator" content="TYPO3 3.6 CMS" /> tag in class.tslib_pagegen.php to reflect version 3.7. Should be changed to something dynamic in the future! (see bug #0000318)
/var/www/quickstart/typo3_src/t3lib/class.t3lib_basicfilefunc.php 2004-09-19 14:47:51.000000000 +0200
$info['type'] = @filetype($wholePath);
$info['owner'] = @fileowner($wholePath);
$info['perms'] = @fileperms($wholePath);
$info['writeable'] = ($info['perms']&2 || ($theuser==$info['owner'] && $info['perms']&128));
$info['readable'] = ($info['perms']&4 || ($theuser==$info['owner'] && $info['perms']&256));
$info['writable'] = !@is_writable($wholePath);
$info['readable'] = !@is_readable($wholePath);
return $info;
}
/var/www/quickstart/typo3_src/t3lib/class.t3lib_extmgm.php 2004-09-19 14:50:13.000000000 +0200
* @internal
*/
function isLocalconfWritable() {
return is_writeable(PATH_typo3conf) && is_writeable(PATH_typo3conf.'localconf.php');
return is_writable(PATH_typo3conf) && is_writeable(PATH_typo3conf.'localconf.php');
}
/**
......
*/
function cannotCacheFilesWritable($cacheFilePrefix) {
$error=array();
if (!@is_writeable(PATH_typo3conf)) {
if (!@is_writable(PATH_typo3conf)) {
$error[]=PATH_typo3conf;
}
if (@is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php') &&
!@is_writeable(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php')) {
!@is_writable(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php')) {
$error[]=PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php';
}
if (@is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php') &&
!@is_writeable(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php')) {
!@is_writable(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php')) {
$error[]=PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php';
}
return implode(', ',$error);
/var/www/quickstart/typo3_src/t3lib/class.t3lib_install.php 2004-09-19 14:49:42.000000000 +0200
if (!$this->allowUpdateLocalConf) {
die("->allowUpdateLocalConf flag in the install object is not set and therefore 'localconf.php' cannot be altered.");
}
if (!@is_writeable($writeToLocalconf_dat['file'])) {
die($writeToLocalconf_dat['file'].' is not writeable!');
if (!@is_writable($writeToLocalconf_dat['file'])) {
die($writeToLocalconf_dat['file'].' is not writable!');
}
// Splitting localconf.php file into lines:
/var/www/quickstart/typo3_src/t3lib/class.t3lib_svbase.php 2004-09-19 14:49:26.000000000 +0200
define ('T3_ERR_SV_FILE_NOT_FOUND', -20); // File not found which the service should process
define ('T3_ERR_SV_FILE_READ', -21); // File not readable
define ('T3_ERR_SV_FILE_WRITE', -22); // File not writeable
define ('T3_ERR_SV_FILE_WRITE', -22); // File not writable
define ('T3_ERR_SV_PROG_NOT_FOUND', -40); // passed subtype is not possible with this service
define ('T3_ERR_SV_PROG_FAILED', -41); // passed subtype is not possible with this service
/var/www/quickstart/typo3_src/typo3/class.file_list.inc 2004-09-19 14:54:32.000000000 +0200
// $theData[$field]=t3lib_div::formatSize($theFile[$field]);
break;
case 'rw':
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writeable'])?'':'<span class="typo3-red"><b>W</b></span>');
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
break;
case 'fileext':
// $theData[$field]=strtoupper($theFile['fileext']);
......
$theData[$field]=t3lib_div::formatSize($theFile[$field]);
break;
case 'rw':
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writeable'])?'':'<span class="typo3-red"><b>W</b></span>');
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
break;
case 'fileext':
$theData[$field]=strtoupper($theFile[$field]);
/var/www/quickstart/typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.php 2004-09-19 14:50:22.000000000 +0200
if(!ereg("^/", $theLogFile)) $theLogFile = PATH_site.$theLogFile;
if ($this->config['config']['stat_apache'] && $this->config['config']['stat_apache_logfile'] && !strstr($this->config['config']['stat_apache_logfile'],'/')) {
if(t3lib_div::isAllowedAbsPath($theLogFile) && @is_file($theLogFile) && @is_writeable($theLogFile)) {
if(t3lib_div::isAllowedAbsPath($theLogFile) && @is_file($theLogFile) && @is_writable($theLogFile)) {
$this->config['stat_vars']['logFile'] = $theLogFile;
$shortTitle = substr(ereg_replace('[^\.[:alnum:]_-]','_',$this->page['title']),0,30);
$pageName = $this->config['config']['stat_apache_pagenames'] ? $this->config['config']['stat_apache_pagenames'] : '[path][title]--[uid].html';
/var/www/quickstart/typo3_src/typo3/sysext/install/mod/class.tx_install.php 2004-09-19 14:51:01.000000000 +0200
");
if (!$this->config_array["dir_typo3temp"]) {
$this->message("typo3temp/ directory","typo3temp/ not writeable!","
$this->message("typo3temp/ directory","typo3temp/ not writable!","
You must make typo3temp/ write enabled before you can proceed with this test.
",2);
echo $this->outputWrapper($this->printAll());
......
$uniqueName = md5(uniqid(microtime()));
// The requirement level (the integer value, ie. the second value of the value array) has the following meanings:
// -1 = not required, but if it exists may be writeable or not
// 0 = not required, if it exists the dir should be writeable
// 1 = required, don't has to be writeable
// 2 = required, has to be writeable
// -1 = not required, but if it exists may be writable or not
// 0 = not required, if it exists the dir should be writable
// 1 = required, don't has to be writable
// 2 = required, has to be writable
$checkWrite=array(
"typo3temp/" => array("The folder is used by both the frontend (FE) and backend interface (TBE) for image manipulated files.",2,"dir_typo3temp"),
......
if (@is_file($file)) {
unlink($file);
if ($descr[2]) { $this->config_array[$descr[2]]=1; }
$this->message($ext, $relpath." writeable","",-1);
$this->message($ext, $relpath." writable","",-1);
} else {
$severity = ($descr[1]==2 || $descr[1]==0) ? 3 : 2;
if ($descr[1] == 0 || $descr[1] == 2) {
......
} elseif ($descr[1] == -1 || $descr[1] == 1) {
$msg = "The directory ".$relpath." does not neccesarily have to be writable.";
}
$this->message($ext, $relpath." directory not writeable","
$this->message($ext, $relpath." directory not writable","
<em>Full path: ".$file."</em>
".$general_message."
......
return;
}
if (!$this->config_array["dir_typo3temp"]) {
$this->message("Image Processing","typo3temp/ not writeable!","
$this->message("Image Processing","typo3temp/ not writable!","
You must make typo3temp/ write enabled before you can proceed with this test.
",2);
echo $this->outputWrapper($this->printAll());
(1-1/2)