Beispiel #1
0
    def __init__(self, jobs_ctx, claimer, user_email):
        super().__init__()
        self.setupUi(self)
        self.jobs_ctx = jobs_ctx
        self.claimer = claimer
        self.claim_job = None
        self.new_device = None
        self.line_edit_user_full_name.setFocus()
        self.line_edit_user_full_name.set_validator(
            validators.NotEmptyValidator())
        self.line_edit_user_full_name.validity_changed.connect(
            self.check_infos)

        self.line_edit_user_email.setText(user_email)
        self.line_edit_user_email.set_validator(validators.EmailValidator())
        self.line_edit_user_email.validity_changed.connect(self.check_infos)

        self.line_edit_device.setText(get_default_device())
        self.line_edit_device.set_validator(validators.DeviceLabelValidator())
        self.line_edit_device.validity_changed.connect(self.check_infos)

        self.claim_success.connect(self._on_claim_success)
        self.claim_error.connect(self._on_claim_error)
        self.label_wait.hide()
        self.button_ok.clicked.connect(self._on_claim_clicked)
        self.check_infos()
    def __init__(self, jobs_ctx, config,
                 addr: BackendOrganizationBootstrapAddr):
        super().__init__()
        self.setupUi(self)
        self.dialog = None
        self.jobs_ctx = jobs_ctx
        self.config = config
        self.addr = addr
        self.label_instructions.setText(
            _("TEXT_BOOTSTRAP_ORG_INSTRUCTIONS_url-organization").format(
                url=self.addr.to_url(),
                organization=self.addr.organization_id))
        self.bootstrap_job = None
        self.button_bootstrap.clicked.connect(self.bootstrap_clicked)
        pwd_str_widget = PasswordStrengthWidget()
        self.layout_password_strength.addWidget(pwd_str_widget)
        self.line_edit_password.textChanged.connect(
            pwd_str_widget.on_password_change)
        self.line_edit_login.textChanged.connect(self.check_infos)
        self.line_edit_device.textChanged.connect(self.check_infos)
        self.line_edit_password.textChanged.connect(self.check_infos)
        self.line_edit_password_check.textChanged.connect(self.check_infos)
        self.line_edit_login.setValidator(validators.UserIDValidator())
        self.line_edit_device.setValidator(validators.DeviceNameValidator())
        self.bootstrap_success.connect(self.on_bootstrap_success)
        self.bootstrap_error.connect(self.on_bootstrap_error)

        self.line_edit_device.setText(get_default_device())

        self.status = None

        self.check_infos()
 def __init__(self):
     super().__init__()
     self.setupUi(self)
     self.widget_password.info_changed.connect(self.check_infos)
     self.line_edit_device.setText(get_default_device())
     self.line_edit_device.validity_changed.connect(self.check_infos)
     self.line_edit_device.set_validator(validators.DeviceNameValidator())
Beispiel #4
0
    def __init__(self, jobs_ctx, config,
                 addr: BackendOrganizationClaimUserAddr):
        super().__init__()
        self.setupUi(self)
        self.jobs_ctx = jobs_ctx
        self.config = config
        self.claim_user_job = None
        self.dialog = None
        self.addr = addr
        self.label_instructions.setText(
            _("TEXT_CLAIM_USER_INSTRUCTIONS_user-url-organization").format(
                user=self.addr.user_id,
                url=self.addr.to_url(),
                organization=self.addr.organization_id,
            ))
        pwd_str_widget = PasswordStrengthWidget()
        self.layout_password_strength.addWidget(pwd_str_widget)
        self.button_claim.clicked.connect(self.claim_clicked)
        self.line_edit_device.textChanged.connect(self.check_infos)
        self.line_edit_token.textChanged.connect(self.check_infos)
        self.line_edit_password.textChanged.connect(
            pwd_str_widget.on_password_change)
        self.line_edit_password.textChanged.connect(self.check_infos)
        self.line_edit_password_check.textChanged.connect(self.check_infos)
        self.claim_success.connect(self.on_claim_success)
        self.claim_error.connect(self.on_claim_error)
        self.line_edit_device.setValidator(validators.DeviceNameValidator())

        self.status = None

        if addr.token:
            self.line_edit_token.setText(addr.token)
        self.line_edit_device.setText(get_default_device())

        self.check_infos()
Beispiel #5
0
 async def prepare_enrollment_request(self):
     try:
         self.context = await PkiEnrollmentSubmitterInitialCtx.new(self.addr
                                                                   )
         self.widget_user_info.setVisible(True)
         self.label_cert_error.setVisible(False)
         self.line_edit_user_name.setText(
             self.context.x509_certificate.subject_common_name)
         self.line_edit_user_email.setText(
             self.context.x509_certificate.subject_email_address)
         self.line_edit_device.setText(desktop.get_default_device())
         self.button_select_cert.setText(
             str(self.context.x509_certificate.certificate_id))
     except PkiEnrollmentCertificateNotFoundError:
         # User did not provide a certificate (cancelled the prompt). We do nothing.
         pass
     except PkiEnrollmentCertificatePinCodeUnavailableError:
         # User did not provide a pin code (cancelled the prompt). We do nothing.
         pass
     except Exception as exc:
         show_error(self,
                    translate("TEXT_ENROLLMENT_ERROR_LOADING_CERTIFICATE"),
                    exception=exc)
         self.widget_user_info.setVisible(False)
         self.label_cert_error.setText(
             translate("TEXT_ENROLLMENT_ERROR_LOADING_CERTIFICATE"))
         self.label_cert_error.setVisible(True)
         self.button_ask_to_join.setEnabled(False)
 def __init__(self, parent=None):
     super().__init__(parent)
     self.setupUi(self)
     self.button_import_key.clicked.connect(self._on_import_key_clicked)
     self.label_passphrase_error.hide()
     self.line_edit_device.setText(get_default_device())
     self.line_edit_device.validity_changed.connect(self._check_infos)
     self.line_edit_device.set_validator(validators.DeviceLabelValidator())
     self.edit_passphrase.textChanged.connect(
         self._on_passphrase_text_changed)
Beispiel #7
0
 def __init__(self, jobs_ctx, claimer, device_email):
     super().__init__()
     self.setupUi(self)
     self.jobs_ctx = jobs_ctx
     self.claimer = claimer
     self.claim_job = None
     self.line_edit_device.setFocus()
     self.line_edit_device.set_validator(validators.DeviceNameValidator())
     self.line_edit_device.setText(get_default_device())
     self.line_edit_device.validity_changed.connect(self.check_infos)
     self.widget_password.info_changed.connect(self.check_infos)
     self.button_ok.setDisabled(True)
     self.claim_success.connect(self._on_claim_success)
     self.claim_error.connect(self._on_claim_error)
     self.label_wait.hide()
     self.button_ok.clicked.connect(self._on_claim_clicked)
 def reset(self):
     self.line_edit_login.setText("")
     self.line_edit_password.setText("")
     self.line_edit_password_check.setText("")
     self.line_edit_url.setText("")
     self.line_edit_device.setText(get_default_device())
     self.line_edit_token.setText("")
     self.check_box_use_pkcs11.setCheckState(Qt.Unchecked)
     self.line_edit_password.setDisabled(False)
     self.line_edit_password_check.setDisabled(False)
     self.combo_pkcs11_key.clear()
     self.combo_pkcs11_key.addItem("0")
     self.combo_pkcs11_token.clear()
     self.combo_pkcs11_token.addItem("0")
     self.button_cancel.hide()
     self.widget_pkcs11.hide()
     self.label_password_strength.hide()
Beispiel #9
0
 def __init__(self, jobs_ctx, claimer):
     super().__init__()
     self.setupUi(self)
     self.jobs_ctx = jobs_ctx
     self.claimer = claimer
     self.claim_job = None
     self.new_device = None
     self.line_edit_device.setFocus()
     self.line_edit_device.set_validator(validators.DeviceLabelValidator())
     self.line_edit_device.setText(get_default_device())
     self.line_edit_device.textChanged.connect(self._on_device_text_changed)
     self.line_edit_device.validity_changed.connect(self.check_infos)
     self.widget_auth.authentication_state_changed.connect(self.check_infos)
     self.button_ok.setDisabled(True)
     self.claim_success.connect(self._on_claim_success)
     self.claim_error.connect(self._on_claim_error)
     self.label_wait.hide()
     self.button_ok.clicked.connect(self._on_claim_clicked)
Beispiel #10
0
 def __init__(self):
     super().__init__()
     self.setupUi(self)
     self.line_edit_user_email.validity_changed.connect(self.check_infos)
     self.line_edit_user_email.set_validator(validators.EmailValidator())
     self.line_edit_user_full_name.textChanged.connect(self.check_infos)
     self.line_edit_org_name.validity_changed.connect(self.check_infos)
     self.line_edit_device.setText(get_default_device())
     self.line_edit_device.validity_changed.connect(self.check_infos)
     self.line_edit_device.set_validator(validators.DeviceLabelValidator())
     self.line_edit_org_name.set_validator(
         validators.OrganizationIDValidator())
     self.line_edit_backend_addr.set_validator(
         validators.BackendAddrValidator())
     self.line_edit_backend_addr.validity_changed.connect(self.check_infos)
     self.check_accept_contract.clicked.connect(self.check_infos)
     self.radio_use_commercial.toggled.connect(self._switch_server)
     self.radio_use_custom.toggled.connect(self._switch_server)
     self.radio_use_commercial.setChecked(True)