]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_select.c
Keep the same keywords as in previous version
[bacula/bacula] / bacula / src / dird / ua_select.c
index d048861f00ec2ec62a69d7ee3d7806f741cdc64e..1ff4f27fb420dc5e75dca34ec19881ab0cf6522f 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -31,7 +31,6 @@
  *
  *     Kern Sibbald, October MMI
  *
- *   Version  $Id$
  */
 
 #include "bacula.h"
@@ -244,6 +243,33 @@ CAT *get_catalog_resource(UAContext *ua)
 }
 
 
+/*
+ * Select a job to enable or disable   
+ */
+JOB *select_enable_disable_job_resource(UAContext *ua, bool enable)
+{
+   char name[MAX_NAME_LENGTH];
+   JOB *job;
+
+   LockRes();
+   start_prompt(ua, _("The defined Job resources are:\n"));
+   foreach_res(job, R_JOB) {
+      if (!acl_access_ok(ua, Job_ACL, job->name())) {
+         continue;
+      }
+      if (job->enabled == enable) {   /* Already enabled/disabled? */
+         continue;                    /* yes, skip */
+      }
+      add_prompt(ua, job->name());
+   }
+   UnlockRes();
+   if (do_prompt(ua, _("Job"), _("Select Job resource"), name, sizeof(name)) < 0) {
+      return NULL;
+   }
+   job = (JOB *)GetResWithName(R_JOB, name);
+   return job;
+}
+
 /*
  * Select a Job resource from prompt list
  */