|
313 | 313 | } |
314 | 314 | }, |
315 | 315 |
|
| 316 | + linktoldap: { |
| 317 | + label: 'label.link.domain.to.ldap', |
| 318 | + |
| 319 | + action: function(args) { |
| 320 | + var data = { |
| 321 | + domainid: args.context.domains[0].id, |
| 322 | + type: args.data.type, |
| 323 | + name: args.data.name, |
| 324 | + accounttype: args.data.accounttype |
| 325 | + }; |
| 326 | + |
| 327 | + if (args.data.admin != null && args.data.admin.length > 0) { |
| 328 | + $.extend(data, { |
| 329 | + admin: args.data.admin |
| 330 | + }); |
| 331 | + } |
| 332 | + |
| 333 | + $.ajax({ |
| 334 | + url: createURL('linkDomainToLdap'), |
| 335 | + data: data, |
| 336 | + success: function(json) { |
| 337 | + var item = json.linkdomaintoldapresponse.LinkDomainToLdap.domainid; |
| 338 | + args.response.success({ |
| 339 | + data: item |
| 340 | + }); |
| 341 | + }, |
| 342 | + error: function(XMLHttpResponse) { |
| 343 | + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); |
| 344 | + args.response.error(errorMsg); |
| 345 | + } |
| 346 | + }); |
| 347 | + }, |
| 348 | + |
| 349 | + messages: { |
| 350 | + notification: function(args) { |
| 351 | + return 'label.link.domain.to.ldap'; |
| 352 | + } |
| 353 | + }, |
| 354 | + |
| 355 | + createForm: { |
| 356 | + title: 'label.link.domain.to.ldap', |
| 357 | + desc: 'message.link.domain.to.ldap', |
| 358 | + fields: { |
| 359 | + type: { |
| 360 | + label: 'label.ldap.link.type', |
| 361 | + docID: 'helpLdapGroupType', |
| 362 | + validation: { |
| 363 | + required: true |
| 364 | + }, |
| 365 | + select: function(args) { |
| 366 | + var items = []; |
| 367 | + items.push({ |
| 368 | + id: "GROUP", |
| 369 | + description: "GROUP" |
| 370 | + }); //regular-user |
| 371 | + items.push({ |
| 372 | + id: "OU", |
| 373 | + description: "OU" |
| 374 | + }); //root-admin |
| 375 | + args.response.success({ |
| 376 | + data: items |
| 377 | + }); |
| 378 | + } |
| 379 | + }, |
| 380 | + name: { |
| 381 | + label: 'label.name', |
| 382 | + docID: 'helpLdapGroupName', |
| 383 | + validation: { |
| 384 | + required: true |
| 385 | + } |
| 386 | + }, |
| 387 | + accounttype: { |
| 388 | + label: 'label.account.type', |
| 389 | + docID: 'helpAccountType', |
| 390 | + validation: { |
| 391 | + required: true |
| 392 | + }, |
| 393 | + select: function(args) { |
| 394 | + var items = []; |
| 395 | + items.push({ |
| 396 | + id: 0, |
| 397 | + description: "Normal User" |
| 398 | + }); //regular-user |
| 399 | + items.push({ |
| 400 | + id: 2, |
| 401 | + description: "Domain Admin" |
| 402 | + }); //root-admin |
| 403 | + args.response.success({ |
| 404 | + data: items |
| 405 | + }); |
| 406 | + } |
| 407 | + }, |
| 408 | + admin: { |
| 409 | + label: 'label.domain.admin', |
| 410 | + docID: 'helpLdapLinkDomainAdmin', |
| 411 | + validation: { |
| 412 | + required: false |
| 413 | + } |
| 414 | + } |
| 415 | + } |
| 416 | + } |
| 417 | + }, |
| 418 | + |
316 | 419 | updateResourceCount: { |
317 | 420 | label: 'label.action.update.resource.count', |
318 | 421 | messages: { |
|
652 | 755 | if (jsonObj.level != 0) { //ROOT domain (whose level is 0) is not allowed to delete |
653 | 756 | allowedActions.push("delete"); |
654 | 757 | } |
| 758 | + if(isLdapEnabled()) { |
| 759 | + allowedActions.push("linktoldap") |
| 760 | + } |
655 | 761 | } else if (isDomainAdmin()) { |
656 | 762 | if (args.context.domains[0].id != g_domainid) { |
657 | 763 | allowedActions.push("edit"); //merge updateResourceLimit into edit |
|
0 commit comments