Skip to content

Commit

Permalink
Fix permissions issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
lokothodida committed Jul 15, 2015
1 parent b5f79d7 commit 9fed20c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
16 changes: 9 additions & 7 deletions custom_menu/php/class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -571,4 +573,4 @@ public function displayMenu() {
}
}

?>
?>

0 comments on commit 9fed20c

Please sign in to comment.