BUG 15670 Validate the Role Name from the web and Plugins Creation SOLVED
- Missing validation when the rol name is empty - When the rol name is empty use the rol code
This commit is contained in:
@@ -64,7 +64,7 @@ class Roles extends BaseRoles {
|
|||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
$this->getRolName();
|
$this->getRolName();
|
||||||
$aFields['ROL_NAME'] = $this->rol_name;
|
$aFields['ROL_NAME'] = ($this->rol_name != '' ? $this->rol_name: $this->getRolCode());
|
||||||
|
|
||||||
return $aFields;
|
return $aFields;
|
||||||
} else {
|
} else {
|
||||||
@@ -87,6 +87,9 @@ class Roles extends BaseRoles {
|
|||||||
$roles = new Roles();
|
$roles = new Roles();
|
||||||
$roles->load($aRow['ROL_UID']);
|
$roles->load($aRow['ROL_UID']);
|
||||||
$aRow['ROL_NAME'] = $roles->getRolName();
|
$aRow['ROL_NAME'] = $roles->getRolName();
|
||||||
|
if ($aRow['ROL_NAME'] == '') {
|
||||||
|
$aRow['ROL_NAME'] = $roles->getRolCode();
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($aRow)) {
|
if (is_array($aRow)) {
|
||||||
return $aRow;
|
return $aRow;
|
||||||
@@ -183,6 +186,9 @@ class Roles extends BaseRoles {
|
|||||||
$o = new Roles();
|
$o = new Roles();
|
||||||
$o->load($row['ROL_UID']);
|
$o->load($row['ROL_UID']);
|
||||||
$row['ROL_NAME'] = $o->getRolName();
|
$row['ROL_NAME'] = $o->getRolName();
|
||||||
|
if ($row['ROL_NAME'] == '') {
|
||||||
|
$row['ROL_NAME'] = $o->getRolCode();
|
||||||
|
}
|
||||||
$aRows[] = $row;
|
$aRows[] = $row;
|
||||||
}
|
}
|
||||||
return $aRows;
|
return $aRows;
|
||||||
@@ -320,6 +326,9 @@ class Roles extends BaseRoles {
|
|||||||
if (is_array($row)) {
|
if (is_array($row)) {
|
||||||
$o = RolesPeer::retrieveByPK($row['ROL_UID']);
|
$o = RolesPeer::retrieveByPK($row['ROL_UID']);
|
||||||
$row['ROL_NAME'] = $o->getRolName();
|
$row['ROL_NAME'] = $o->getRolName();
|
||||||
|
if ($row['ROL_NAME'] == '') {
|
||||||
|
$row['ROL_NAME'] = $o->getRolCode();
|
||||||
|
}
|
||||||
return $row;
|
return $row;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$row['USR_ROLE_ID'] = $row['USR_ROLE'];
|
$row['USR_ROLE_ID'] = $row['USR_ROLE'];
|
||||||
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE'];
|
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['ROL_CODE']) : $uRole['ROL_CODE'];
|
||||||
|
|
||||||
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
|
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
|
||||||
$row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';
|
$row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';
|
||||||
|
|||||||
Reference in New Issue
Block a user