Skip to content

Commit

Permalink
rename tep_writeable() to tep_is_writable()
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldpdl committed May 5, 2010
1 parent 322b751 commit f204d6a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion catalog/admin/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
// check if the backup directory exists
$dir_ok = false;
if (is_dir(DIR_FS_BACKUP)) {
if (is_writeable(DIR_FS_BACKUP)) {
if (tep_is_writable(DIR_FS_BACKUP)) {
$dir_ok = true;
} else {
$messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
Expand Down
12 changes: 6 additions & 6 deletions catalog/admin/banner_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
$banner = tep_db_fetch_array($banner_query);

if (is_file(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
if (is_writeable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
if (tep_is_writable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
unlink(DIR_FS_CATALOG_IMAGES . $banner['banners_image']);
} else {
$messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
Expand All @@ -140,25 +140,25 @@

if (function_exists('imagecreate') && tep_not_null($banner_extensio)) {
if (is_file(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
unlink(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension);
}
}

if (is_file(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
unlink(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension);
}
}

if (is_file(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
unlink(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension);
}
}

if (is_file(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
unlink(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension);
}
}
Expand All @@ -175,7 +175,7 @@
$dir_ok = false;
if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
if (is_dir(DIR_WS_IMAGES . 'graphs')) {
if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs')) {
$dir_ok = true;
} else {
$messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/banner_statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$dir_ok = false;
if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
if (is_dir(DIR_WS_IMAGES . 'graphs')) {
if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
if (tep_is_writable(DIR_WS_IMAGES . 'graphs')) {
$dir_ok = true;
} else {
$messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// check if the cache directory exists
if (is_dir(DIR_FS_CACHE)) {
if (!is_writeable(DIR_FS_CACHE)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
if (!tep_is_writable(DIR_FS_CACHE)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
} else {
$messageStack->add(ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@

// check if the catalog image directory exists
if (is_dir(DIR_FS_CATALOG_IMAGES)) {
if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
if (!tep_is_writable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
} else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/includes/classes/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function set_extensions($extensions) {
function check_destination() {
global $messageStack;

if (!is_writeable($this->destination)) {
if (!tep_is_writable($this->destination)) {
if (is_dir($this->destination)) {
if ($this->message_location == 'direct') {
$messageStack->add(sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination), 'error');
Expand Down
6 changes: 3 additions & 3 deletions catalog/admin/includes/functions/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ function tep_remove($source) {
$dir = dir($source);
while ($file = $dir->read()) {
if ( ($file != '.') && ($file != '..') ) {
if (is_writeable($source . '/' . $file)) {
if (tep_is_writable($source . '/' . $file)) {
tep_remove($source . '/' . $file);
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source . '/' . $file), 'error');
Expand All @@ -1032,14 +1032,14 @@ function tep_remove($source) {
}
$dir->close();

if (is_writeable($source)) {
if (tep_is_writable($source)) {
rmdir($source);
} else {
$messageStack->add(sprintf(ERROR_DIRECTORY_NOT_REMOVEABLE, $source), 'error');
$tep_remove_error = true;
}
} else {
if (is_writeable($source)) {
if (tep_is_writable($source)) {
unlink($source);
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source), 'error');
Expand Down
8 changes: 4 additions & 4 deletions catalog/install/templates/pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@
<?php
$configfile_array = array();

if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !is_writeable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
@chmod(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php', 0777);
}

if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !is_writeable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
@chmod(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php', 0777);
}

if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !is_writeable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
$configfile_array[] = osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php';
}

if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !is_writeable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
$configfile_array[] = osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php';
}

Expand Down

0 comments on commit f204d6a

Please sign in to comment.