Browse Source

Added function to check permissions

Tobias Reich 11 years ago
parent
commit
edca6c088a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      php/modules/misc.php

+ 7 - 0
php/modules/misc.php

@@ -108,6 +108,13 @@ function get_hashed_password($password) {
 
 }
 
+function hasPermissions($path, $permissions = '0777') {
+
+	if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false;
+	else return true;
+
+}
+
 function fastimagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 4) {
 
 	###