function getUserDirs($user)
 {
     global $fakeroot;
     $arr = ZFile::getAllDirs($fakeroot . '/home/' . $user);
     if (!$arr) {
         $arr = array();
     }
     array_unshift($arr, '~/');
     foreach ($arr as $k => $v) {
         $arr[$k] = str_replace('\\', '/', str_replace(realpath($fakeroot . '/home/' . $user), '~', $v));
     }
     return $arr;
 }
function getAllDirs($in_dir, $max_levels = 3, $ignore = array('.', '..', '.svn', 'CVS', 'logs'))
{
    return ZFile::getAllDirs($in_dir, $max_levels, $ignore);
}