Bind command.
(self, *args)
| 297 | self.menu_view.entryconfig("Tree", state=tk.DISABLED) |
| 298 | |
| 299 | def bind(self, *args): |
| 300 | """ |
| 301 | Bind command. |
| 302 | """ |
| 303 | if not self.connected: |
| 304 | return |
| 305 | |
| 306 | if self.bound: |
| 307 | # We are re-binding ! |
| 308 | self.ssp = None |
| 309 | self.bound = False |
| 310 | |
| 311 | if self.ssp is not None or self.simple_username is not None: |
| 312 | # We have an SSP. Don't prompt |
| 313 | self.tprint("client.bind(%s, ssl=self.ssp)" % self.mech) |
| 314 | try: |
| 315 | self.client.bind( |
| 316 | self.mech, |
| 317 | ssp=self.ssp, |
| 318 | simple_username=self.simple_username, |
| 319 | simple_password=self.simple_password, |
| 320 | encrypt=self.encrypt, |
| 321 | ) |
| 322 | except LDAP_Exception as ex: |
| 323 | self.tprint( |
| 324 | ex.diagnosticMessage or "Error: %s" % ex.resultCode, |
| 325 | tags=["error"], |
| 326 | ) |
| 327 | return |
| 328 | except Exception as ex: |
| 329 | self.tprint(str(ex)) |
| 330 | raise |
| 331 | self.tprint("Authenticated.\n", tags=["bold"]) |
| 332 | self.bound = True |
| 333 | return |
| 334 | |
| 335 | # Get dialog |
| 336 | popup = BasePopup(self.root) |
| 337 | dlg = popup.dlg |
| 338 | |
| 339 | # Bind UI |
| 340 | userv = tk.StringVar() |
| 341 | ttk.Label(dlg, text="User").grid(row=0, column=0) |
| 342 | userf = tk.Entry(dlg, textvariable=userv) |
| 343 | userf.grid(row=0, column=1) |
| 344 | |
| 345 | passwordv = tk.StringVar() |
| 346 | ttk.Label(dlg, text="Password").grid(row=1, column=0) |
| 347 | tk.Entry(dlg, textvariable=passwordv).grid(row=1, column=1) |
| 348 | |
| 349 | domainv = tk.StringVar() |
| 350 | domainv.set(self.dns_domain_name) |
| 351 | ttk.Label(dlg, text="Domain").grid(row=2, column=0) |
| 352 | domentry = tk.Entry(dlg, textvariable=domainv) |
| 353 | domentry.grid(row=2, column=1) |
| 354 | |
| 355 | bindtypefrm = ttk.LabelFrame( |
| 356 | dlg, |
no test coverage detected