Example #1
0
 static function getLxStat($__username_o, $root, $path, $numlines = null, $duflag = null)
 {
     dprint("{$path}\n");
     self::check_for_break($root, $path);
     dprint("In getLxstat {$path} {$duflag}\n");
     $stat = lxfile_stat($path, $duflag);
     $stat = self::createFfileVariables($stat);
     if ($numlines === 'download') {
         $ret = cp_fileserv($path);
         $stat['serverfile_data'] = $ret;
     }
     $stat['duflag'] = $duflag;
     return $stat;
 }
Example #2
0
function check_file_if_owned_by($file, $user)
{
    if (!lxfile_exists($file)) {
        return true;
    }
    if (csa($user, ":")) {
        $ruser = strtil($user, ":");
    } else {
        $ruser = $user;
    }
    $stat = lxfile_stat($file, false);
    $uid = $stat['uid'];
    $name = os_get_user_from_uid($uid);
    if ($name === $ruser) {
        return true;
    }
    log_log("file_check", "{$file} not owned by {$ruser}");
    return false;
}