BUG 000 - correction form new Authentication Sources, IE format

This commit is contained in:
Marco Antonio Nina
2011-12-23 11:40:04 -04:00
parent ee22d188cd
commit b12b73627b
5 changed files with 90 additions and 83 deletions

View File

@@ -178,7 +178,6 @@ class RBAC
file_put_contents( $filePath, serialize ( $this->aUserInfo ) ); file_put_contents( $filePath, serialize ( $this->aUserInfo ) );
} }
} }
/** /**
* verification the register automatic * verification the register automatic
* *
@@ -889,7 +888,6 @@ class RBAC
function getAuthenticationSources($start,$limit,$filter='') { function getAuthenticationSources($start,$limit,$filter='') {
return $this->authSourcesObj->getAuthenticationSources($start,$limit,$filter); return $this->authSourcesObj->getAuthenticationSources($start,$limit,$filter);
} }
/** /**
* this function gets all authentication source * this function gets all authentication source
* Authentication Sources * Authentication Sources
@@ -900,9 +898,16 @@ class RBAC
* @return $this->authSourcesObj->load * @return $this->authSourcesObj->load
*/ */
function getAuthSource($sUID) { function getAuthSource($sUID) {
return $this->authSourcesObj->load($sUID); $data = $this->authSourcesObj->load($sUID);
$pass =explode("_",$data['AUTH_SOURCE_PASSWORD']);
foreach($pass as $index => $value) {
if($value == '2NnV3ujj3w'){
$data['AUTH_SOURCE_PASSWORD'] = G::decrypt($pass[0],$data['AUTH_SOURCE_SERVER_NAME']);
}
}
$this->authSourcesObj->Fields = $data;
return $this->authSourcesObj->Fields;
} }
/** /**
* this function creates an authentication source * this function creates an authentication source
* Authentication Sources * Authentication Sources
@@ -913,6 +918,7 @@ class RBAC
* @return $this->authSourcesObj->create * @return $this->authSourcesObj->create
*/ */
function createAuthSource($aData) { function createAuthSource($aData) {
$aData['AUTH_SOURCE_PASSWORD'] = G::encrypt($aData['AUTH_SOURCE_PASSWORD'],$aData['AUTH_SOURCE_SERVER_NAME'])."_2NnV3ujj3w";
$this->authSourcesObj->create($aData); $this->authSourcesObj->create($aData);
} }
@@ -927,6 +933,7 @@ class RBAC
* @return $this->authSourcesObj->create * @return $this->authSourcesObj->create
*/ */
function updateAuthSource($aData) { function updateAuthSource($aData) {
$aData['AUTH_SOURCE_PASSWORD'] = G::encrypt($aData['AUTH_SOURCE_PASSWORD'],$aData['AUTH_SOURCE_SERVER_NAME'])."_2NnV3ujj3w";
$this->authSourcesObj->update($aData); $this->authSourcesObj->update($aData);
} }

View File

@@ -118,6 +118,12 @@ class LDAP
$sKeyword = trim($sKeyword); $sKeyword = trim($sKeyword);
$RBAC = RBAC::getSingleton(); $RBAC = RBAC::getSingleton();
$aAuthSource = $RBAC->authSourcesObj->load($this->sAuthSource); $aAuthSource = $RBAC->authSourcesObj->load($this->sAuthSource);
$pass =explode("_",$aAuthSource['AUTH_SOURCE_PASSWORD']);
foreach($pass as $index => $value) {
if($value == '2NnV3ujj3w'){
$aAuthSource['AUTH_SOURCE_PASSWORD'] = G::decrypt($pass[0],$aAuthSource['AUTH_SOURCE_SERVER_NAME']);
}
}
$oLink = @ldap_connect($aAuthSource['AUTH_SOURCE_SERVER_NAME'], $aAuthSource['AUTH_SOURCE_PORT']); $oLink = @ldap_connect($aAuthSource['AUTH_SOURCE_SERVER_NAME'], $aAuthSource['AUTH_SOURCE_PORT']);
@ldap_set_option($oLink, LDAP_OPT_PROTOCOL_VERSION, $aAuthSource['AUTH_SOURCE_VERSION']); @ldap_set_option($oLink, LDAP_OPT_PROTOCOL_VERSION, $aAuthSource['AUTH_SOURCE_VERSION']);
@ldap_set_option($oLink, LDAP_OPT_REFERRALS, 0); @ldap_set_option($oLink, LDAP_OPT_REFERRALS, 0);

View File

@@ -9,10 +9,10 @@ Ext.onReady(function(){
id: 'AUTH_SOURCE_UID', id: 'AUTH_SOURCE_UID',
fieldLabel: 'krlos', fieldLabel: 'krlos',
xtype:'textfield', xtype:'textfield',
value:sUID, value: sUID,
width: 200, width: 200,
hideLabel: true, hideLabel: true,
hidden : true, hidden: true
}); });
var txtName=new Ext.form.TextField({ var txtName=new Ext.form.TextField({
@@ -49,8 +49,10 @@ Ext.onReady(function(){
select: function(c,d,i){ select: function(c,d,i){
if(i){ if(i){
formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber'); formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber');
formAuthSourceE.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('samaccountname');
} else { } else {
formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile'); formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile');
formAuthSourceE.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('uid');
} }
} }
} }
@@ -205,10 +207,10 @@ Ext.onReady(function(){
//Identifier for an imported user //Identifier for an imported user
var txtIdentifier=new Ext.form.TextField({ var txtIdentifier=new Ext.form.TextField({
id: 'AS_INDENTIFIER', id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'),
xtype:'textfield', xtype:'textfield',
value:'uid', value:'',
width: 200, width: 200,
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '50'}, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '50'},
allowBlank: false, allowBlank: false,
@@ -242,7 +244,7 @@ Ext.onReady(function(){
value:'', value:'',
width: 200, width: 200,
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'}, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'},
allowBlank: false, allowBlank: true,
listeners: { listeners: {
'render': function(c) { 'render': function(c) {
c.getEl().on('keyup', function() { c.getEl().on('keyup', function() {
@@ -378,7 +380,6 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){
success: function(r,o){ success: function(r,o){
var data = Ext.util.JSON.decode(r.responseText); var data = Ext.util.JSON.decode(r.responseText);
if (!data.sources.AUTH_ANONYMOUS){ if (!data.sources.AUTH_ANONYMOUS){
Ext.getCmp("AUTH_SOURCE_SEARCH_USER").enable(); Ext.getCmp("AUTH_SOURCE_SEARCH_USER").enable();
Ext.getCmp("AUTH_SOURCE_SEARCH_USER").show(); Ext.getCmp("AUTH_SOURCE_SEARCH_USER").show();
@@ -395,8 +396,6 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){
txtPassword.getEl().up('.x-form-item').setDisplayed(false); txtPassword.getEl().up('.x-form-item').setDisplayed(false);
} }
Ext.getCmp('formAuthSourceE').getForm().setValues({ Ext.getCmp('formAuthSourceE').getForm().setValues({
AUTH_SOURCE_UID: data.sources.AUTH_SOURCE_UID, AUTH_SOURCE_UID: data.sources.AUTH_SOURCE_UID,
@@ -408,6 +407,7 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){
AUTH_ANONYMOUS: (data.sources.AUTH_ANONYMOUS)?'yes':'no', AUTH_ANONYMOUS: (data.sources.AUTH_ANONYMOUS)?'yes':'no',
AUTH_SOURCE_SEARCH_USER: data.sources.AUTH_SOURCE_SEARCH_USER, AUTH_SOURCE_SEARCH_USER: data.sources.AUTH_SOURCE_SEARCH_USER,
AUTH_SOURCE_PASSWORD: data.sources.AUTH_SOURCE_PASSWORD, AUTH_SOURCE_PASSWORD: data.sources.AUTH_SOURCE_PASSWORD,
AUTH_SOURCE_IDENTIFIER_FOR_USER: data.sources.AUTH_SOURCE_IDENTIFIER_FOR_USER,
AUTH_SOURCE_VERSION: data.sources.AUTH_SOURCE_VERSION, AUTH_SOURCE_VERSION: data.sources.AUTH_SOURCE_VERSION,
AUTH_SOURCE_BASE_DN: data.sources.AUTH_SOURCE_BASE_DN, AUTH_SOURCE_BASE_DN: data.sources.AUTH_SOURCE_BASE_DN,
AUTH_SOURCE_OBJECT_CLASSES: data.sources.AUTH_SOURCE_OBJECT_CLASSES, AUTH_SOURCE_OBJECT_CLASSES: data.sources.AUTH_SOURCE_OBJECT_CLASSES,
@@ -415,11 +415,8 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){
AUTH_SOURCE_ADDITIONAL_FILTER:data.sources.AUTH_SOURCE_ADDITIONAL_FILTER AUTH_SOURCE_ADDITIONAL_FILTER:data.sources.AUTH_SOURCE_ADDITIONAL_FILTER
}) })
}, },
failure:function(r,o){ failure:function(r,o){
//viewport.getEl().unmask(); //viewport.getEl().unmask();
} }
}); });
} }

View File

@@ -9,7 +9,7 @@ var storeAuthSources = new Ext.data.GroupingStore({
proxy : new Ext.data.HttpProxy({ proxy : new Ext.data.HttpProxy({
url: 'authSources_Ajax?action=authSourcesNew&cmb=yes' url: 'authSources_Ajax?action=authSourcesNew&cmb=yes'
}), }),
reader : new Ext.data.JsonReader( { reader : new Ext.data.JsonReader({
root: 'sources', root: 'sources',
fields: [ fields: [
{name: 'sType'}, {name: 'sType'},
@@ -28,7 +28,7 @@ var cboxAuthSourse = new Ext.form.ComboBox({
mode: 'local', mode: 'local',
triggerAction: 'all', triggerAction: 'all',
store: storeAuthSources, store: storeAuthSources,
valueField : 'sType', valueField: 'sType',
displayField: 'sLabel', displayField: 'sLabel',
emptyText: 'Choose an option...', emptyText: 'Choose an option...',
width: 160, width: 160,
@@ -48,16 +48,15 @@ var cboxAuthSourse = new Ext.form.ComboBox({
] ]
}); });
formAuthSourceOptoins = new Ext.FormPanel({ formAuthSourceOptoins = new Ext.FormPanel({
id:'formAuthSourceOptoins', id:'formAuthSourceOptoins',
labelWidth: 250, labelWidth: 250,
labelAlign:'right', labelAlign: 'right',
autoScroll: true, autoScroll: true,
fileUpload: true, fileUpload: true,
width:800, width:800,
bodyStyle:'padding:10px', bodyStyle:'padding:10px',
waitMsgTarget : true, waitMsgTarget: true,
frame: true, frame: true,
defaults: { defaults: {
anchor: '100%', anchor: '100%',
@@ -67,7 +66,7 @@ var cboxAuthSourse = new Ext.form.ComboBox({
align:'center' align:'center'
}, },
items:[ items:[
componAuthSourse, componAuthSourse
], ],
buttons: [ buttons: [
{ {
@@ -126,8 +125,3 @@ var cboxAuthSourse = new Ext.form.ComboBox({
} }
}); });
} }

View File

@@ -5,32 +5,31 @@
Ext.onReady(function(){ Ext.onReady(function(){
var txtSourceId=new Ext.form.TextField({ var txtSourceId=new Ext.form.TextField({
id: 'AUTH_SOURCE_UID', id: 'AUTH_SOURCE_UID',
fieldLabel: 'krlos', fieldLabel: 'krlos',
xtype:'textfield', xtype: 'textfield',
value:'', value: '',
width: 200, width: 200,
hideLabel: true, hideLabel: true,
hidden : true, hidden: true
}); });
var txtSourceProvider=new Ext.form.TextField({ var txtSourceProvider=new Ext.form.TextField({
id: 'AUTH_SOURCE_PROVIDER', id: 'AUTH_SOURCE_PROVIDER',
fieldLabel: 'krlos', fieldLabel: 'krlos',
xtype:'textfield', xtype: 'textfield',
value:sprovider, value: sprovider,
width: 200, width: 200,
hideLabel: true, hideLabel: true,
hidden : true, hidden: true
}); });
var txtName=new Ext.form.TextField({ var txtName=new Ext.form.TextField({
id: 'AUTH_SOURCE_NAME', id: 'AUTH_SOURCE_NAME',
fieldLabel: _('ID_NAME'), fieldLabel: _('ID_NAME'),
xtype:'textfield', xtype: 'textfield',
value:'', value: '',
width: 200, width: 200,
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '50'}, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '50'},
allowBlank: false, allowBlank: false,
@@ -60,8 +59,10 @@ Ext.onReady(function(){
select: function(c,d,i){ select: function(c,d,i){
if(i){ if(i){
formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber'); formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber');
formAuthSource.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('samaccountname');
} else { } else {
formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile'); formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile');
formAuthSource.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('uid');
} }
} }
} }
@@ -107,12 +108,14 @@ Ext.onReady(function(){
data : my_valuesTLS data : my_valuesTLS
}), }),
displayField: 'no', displayField: 'no',
allowBlank: false,
typeAhead: true, typeAhead: true,
mode: 'local', mode: 'local',
triggerAction: 'all', triggerAction: 'all',
emptyText:'Choose an option...', emptyText:'Choose an option...',
selectOnFocus:true selectOnFocus:true
}); });
//cboxTLS.setValue('no');
var my_values_version= [['2'],['3']]; var my_values_version= [['2'],['3']];
var cboxVersion = new Ext.form.ComboBox({ var cboxVersion = new Ext.form.ComboBox({
@@ -122,6 +125,7 @@ Ext.onReady(function(){
fields: ['two','three'], fields: ['two','three'],
data : my_values_version data : my_values_version
}), }),
allowBlank: false,
displayField: 'two', displayField: 'two',
typeAhead: true, typeAhead: true,
mode: 'local', mode: 'local',
@@ -158,6 +162,7 @@ Ext.onReady(function(){
displayField: '0', displayField: '0',
typeAhead: true, typeAhead: true,
mode: 'local', mode: 'local',
allowBlank: false,
triggerAction: 'all', triggerAction: 'all',
emptyText:'Choose an option...', emptyText:'Choose an option...',
selectOnFocus:true, selectOnFocus:true,
@@ -216,7 +221,7 @@ Ext.onReady(function(){
//Identifier for an imported user //Identifier for an imported user
var txtIdentifier=new Ext.form.TextField({ var txtIdentifier=new Ext.form.TextField({
id: 'AS_INDENTIFIER', id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'),
xtype:'textfield', xtype:'textfield',
value:'uid', value:'uid',
@@ -253,7 +258,7 @@ Ext.onReady(function(){
value:'', value:'',
width: 200, width: 200,
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'}, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'},
allowBlank: false, allowBlank: true,
listeners: { listeners: {
'render': function(c) { 'render': function(c) {
c.getEl().on('keyup', function() { c.getEl().on('keyup', function() {
@@ -382,5 +387,3 @@ Ext.onReady(function(){
} }
}); });
} }