Permalink
Browse files

Adjust this to use $HOME instead of "/home/$user" as well.

  • Loading branch information...
1 parent 8033533 commit fdf7c642e1d967f3fe9844e9c30b76c128f6bf18 @sofar committed Oct 12, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 album-watch.php
View
@@ -89,7 +89,9 @@ function do_file($path, $album, $user)
# setup watches
for ($x = 0; $x < count($users); $x++) {
- $d = "/home/" . $users[$x] . "/album";
+ $pw = posix_getpwnam($users[$x]);
+ $home = $pw['dir'];
+ $d = $home . "/album";
if (!is_dir($d))
continue;
@@ -119,7 +121,9 @@ function do_file($path, $album, $user)
# scan for files that need preprocessing and run those first
for ($x = 0; $x < count($users); $x++) {
- $d = "/home/" . $users[$x] . "/album";
+ $pw = posix_getpwnam($users[$x]);
+ $home = $pw['dir'];
+ $d = $home . "/album";
if (!is_dir($d))
continue;
$ah = opendir($d);

0 comments on commit fdf7c64

Please sign in to comment.