From 9fed20c7e280f3af61d174a70e04273e470ed5e0 Mon Sep 17 00:00:00 2001 From: Lawrence Paul Okoth-Odida Date: Wed, 15 Jul 2015 12:53:17 +0100 Subject: [PATCH] Fix permissions issue #2 --- .gitignore | 1 + custom_menu/php/class.php | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/custom_menu/php/class.php b/custom_menu/php/class.php index 975e47b..c966252 100644 --- a/custom_menu/php/class.php +++ b/custom_menu/php/class.php @@ -5,7 +5,7 @@ class CustomMenu { const FILE = 'custom_menu'; const VERSION = '0.5'; const AUTHOR = 'Lawrence Okoth-Odida'; - const URL = 'http://lokida.co.uk'; + const URL = 'http://github.com/lokothodida'; const PAGE = 'pages'; /* properties */ @@ -38,12 +38,14 @@ private function makeFiles() { // paths foreach ($paths as $path) { - if (!file_exists(GSDATAOTHERPATH.$path)) { - $return[$path][] = mkdir(GSDATAOTHERPATH.$path, '0755'); - + $fullPath = GSDATAOTHERPATH . $path; + + if (!file_exists($fullPath)) { + $return[$path][] = mkdir($fullPath, 0755); + // writeable permissions final check - if (!is_writable (GSDATAOTHERPATH.$path)) { - $return[$path][] = chmod(GSDATAOTHERPATH.$path, 0755); + if (!is_writable ($fullPath)) { + $return[$path][] = chmod($fullPath, 0755); } } } @@ -571,4 +573,4 @@ public function displayMenu() { } } -?> \ No newline at end of file +?>