Example #1
0
  /**
   * Gets the Registration Type (i.e. the code that determines if the ks script needs to generate a
   * reactivation key or not)
   *
   * @param user the user object needed to load the profile from cobbler
   * @return the registration type
   */
  public RegistrationType getRegistrationType(User user) {
    Profile prof = getCobblerObject(null);
    if (prof == null) {
      return RegistrationType.getDefault();
    }

    return RegistrationType.find((String) prof.getKsMeta().get(RegistrationType.COBBLER_VAR));
  }
Example #2
0
 /**
  * Sets the registration type
  *
  * @param type the refgistration type
  * @param user the user needed to load the profile form cobbler
  */
 public void setRegistrationType(RegistrationType type, User user) {
   Profile prof = getCobblerObject(user);
   Map<String, Object> meta = prof.getKsMeta();
   meta.put(RegistrationType.COBBLER_VAR, type.getType());
   prof.setKsMeta(meta);
   prof.save();
 }