\n"; if ($op == "xml") { // Get XML describing the image or folder $path // Top-level result is or tag. // // All and tags have path and title attributes. // Each can have a display image: width, height, and src attributes. // tag additionally has raw attribute, for the raw image's URL, // size attribute and optional date and exposure attributes. // Top-level and tags additionally have // next, prev, skip attributes. // // Top-level and tags have child tags, // describing the folder's or photo's ancestry. // // Top-level tag has and child tags, // describing the folder's immediate contents. It also has a // first attribute, giving the first image in the folder or its // sub-folders. // // Top-level tag has no children. // // tags have path and title attributes. if (is_dir($path)) { $next = findNextDir($path, true); $prev = findPrevDir($path); $skipNext = findNextDir($path, false); $firstImage = findFirst($path); $entries = getEntries($path); ?> starLevelNotUsed="0" dirs as $entry) { $thisPath = "$path/$entry"; $firstImage = findFirst($thisPath); if (!is_null($firstImage)) { ?> > images as $entry) { $thisPath = "$path/$entry"; ?> raw=""> raw=""> tag with path, title and status attributes // We authenticate by HMAC-MD5 on the arguments, keyed by user's pwd. // There's no freshness, so we allow replays. Easy to fix if we cared. require("md5-php.txt"); $pwd = getPwd($user); $nowSec = time(); $authenticated = (!is_null($pwd) && $hmac == md5HmacHex("AndrewAlbumApp\x00xmlSave\x00$user\x00" . "$time\x00" . rawurlencode($argPath) . "\x00$title", getPwd($user))); if (!$authenticated) { $status = "incorrect name or password"; } else if ($time > $nowSec + 120) { $status = "your computer has the wrong time"; } else if ($time < $nowSec - 300) { $status = "request has expired"; } else { writeFileTitle($path, $title); $status = "ok"; } ?> tag, with op attribute and text message ?> Unknown operator ""