Ejemplo n.º 1
0
static bool filesetscmd(UAContext *ua, const char *cmd)
{
   FILESETRES *fs;
   LockRes();
   foreach_res(fs, R_FILESET) {
      if (acl_access_ok(ua, FileSet_ACL, fs->name())) {
         ua->send_msg("%s\n", fs->name());
      }
   }
   UnlockRes();
   return true;
}
Ejemplo n.º 2
0
bool dot_filesets_cmd(UAContext *ua, const char *cmd)
{
   FILESETRES *fs;

   LockRes();
   ua->send->array_start("filesets");
   foreach_res(fs, R_FILESET) {
      if (acl_access_ok(ua, FileSet_ACL, fs->name())) {
         ua->send->object_start();
         ua->send->object_key_value("name", fs->name(), "%s\n");
         ua->send->object_end();
      }
   }
   ua->send->array_end("filesets");
   UnlockRes();

   return true;
}
Ejemplo n.º 3
0
/*
 * Select a FileSet resource from prompt list
 */
FILESETRES *select_fileset_resource(UAContext *ua)
{
   FILESETRES *fs;
   char name[MAX_NAME_LENGTH];

   start_prompt(ua, _("The defined FileSet resources are:\n"));

   LockRes();
   foreach_res(fs, R_FILESET) {
      if (acl_access_ok(ua, FileSet_ACL, fs->name())) {
         add_prompt(ua, fs->name());
      }
   }
   UnlockRes();

   if (do_prompt(ua, _("FileSet"), _("Select FileSet resource"), name, sizeof(name)) < 0) {
      return NULL;
   }

   fs = (FILESETRES *)GetResWithName(R_FILESET, name);

   return fs;
}