Example #1
0
    Usage4Options($upload, $item);
    print $Usage;
    return 1;
}
account_check($user, $passwd);
// check username/password
$return_value = read_permission($upload, $user);
// check if the user has the permission to read this upload
if (empty($return_value)) {
    $text = _("The user '{$user}' has no permission to read the information of upload {$upload}\n");
    echo $text;
    return 1;
}
require_once "{$MODDIR}/lib/php/common.php";
/** get bucket information for this uploadtree */
GetBucketList($bucket, $bucket_agent, $nomos_agent, $item, $upload);
return 0;
/**
 * \brief get bucket list of one specified upload or all uploads
 *
 * \pamam $upload_pk - upload id
 * \param $bucket_pk - bucket id
 * \param $bucket_agent - bucket agent ID
 * \param $nomos_agent - nomos agent ID
 * \prram $uploadtree_pk - uploadtree ID
 */
function GetBucketList($bucket_pk, $bucket_agent, $nomos_agent, $uploadtree_pk, $upload_pk = 0)
{
    global $PG_CONN;
    global $excluding;
    /** get bucket name */
    print "Upload ID or Uploadtree ID is not digital number\n";
    print $Usage;
    return 1;
}
account_check($user, $passwd);
// check username/password
$return_value = read_permission($upload, $user);
// check if the user has the permission to read this upload
if (empty($return_value)) {
    $text = _("The user '{$user}' has no permission to read the information of upload {$upload}\n");
    echo $text;
    return 1;
}
require_once "{$MODDIR}/lib/php/common.php";
/** get bucket information for this uploadtree */
GetBucketList($bucket, $upload);
return 0;
/**
 * \brief get bucket list of one specified upload or all uploads
 *
 * \pamam $upload_pk - upload id
 * \param $bucket_pk - bucket id
 */
function GetBucketList($bucket_pk, $upload_pk = 0)
{
    global $PG_CONN;
    $sql = "SELECT bucket_name from  bucket_def where bucket_pk = {$bucket_pk};";
    $result = pg_query($PG_CONN, $sql);
    DBCheckResult($result, $sql, __FILE__, __LINE__);
    $row = pg_fetch_assoc($result);
    pg_free_result($result);