Merge pull request #2161 from Jennydmz/BUG-13425
BUG-13425 Cambiar el tamanio del campo PASSWORD, tabla AUTHENTICATION_SOURCE en la bd RBAC.
This commit is contained in:
@@ -199,7 +199,7 @@
|
|||||||
<column name="AUTH_SOURCE_BASE_DN" type="VARCHAR" size="128" required="true" default="" />
|
<column name="AUTH_SOURCE_BASE_DN" type="VARCHAR" size="128" required="true" default="" />
|
||||||
<column name="AUTH_ANONYMOUS" type="INTEGER" default="0" />
|
<column name="AUTH_ANONYMOUS" type="INTEGER" default="0" />
|
||||||
<column name="AUTH_SOURCE_SEARCH_USER" type="VARCHAR" size="128" required="true" default="" />
|
<column name="AUTH_SOURCE_SEARCH_USER" type="VARCHAR" size="128" required="true" default="" />
|
||||||
<column name="AUTH_SOURCE_PASSWORD" type="VARCHAR" size="32" required="true" default="" />
|
<column name="AUTH_SOURCE_PASSWORD" type="VARCHAR" size="150" required="true" default="" />
|
||||||
<column name="AUTH_SOURCE_ATTRIBUTES" type="VARCHAR" size="255" required="true" default="" />
|
<column name="AUTH_SOURCE_ATTRIBUTES" type="VARCHAR" size="255" required="true" default="" />
|
||||||
<column name="AUTH_SOURCE_OBJECT_CLASSES" type="VARCHAR" size="255" required="true" default="" />
|
<column name="AUTH_SOURCE_OBJECT_CLASSES" type="VARCHAR" size="255" required="true" default="" />
|
||||||
<column name="AUTH_SOURCE_DATA" type="LONGVARCHAR" />
|
<column name="AUTH_SOURCE_DATA" type="LONGVARCHAR" />
|
||||||
|
|||||||
@@ -682,6 +682,16 @@ class System
|
|||||||
return System::getSchema( PATH_TRUNK . "workflow/engine/config/schema.xml" );
|
return System::getSchema( PATH_TRUNK . "workflow/engine/config/schema.xml" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the system schema rbac.
|
||||||
|
*
|
||||||
|
* @return schema content in an array
|
||||||
|
*/
|
||||||
|
public static function getSystemSchemaRbac ()
|
||||||
|
{
|
||||||
|
return System::getSchema( PATH_TRUNK . "rbac/engine/config/schema.xml" );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the schema for a plugin.
|
* Retrieves the schema for a plugin.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -134,6 +134,12 @@ class workspaceTools
|
|||||||
$this->dbHost = $values["DB_HOST"];
|
$this->dbHost = $values["DB_HOST"];
|
||||||
$this->dbUser = $values["DB_USER"];
|
$this->dbUser = $values["DB_USER"];
|
||||||
$this->dbPass = $values["DB_PASS"];
|
$this->dbPass = $values["DB_PASS"];
|
||||||
|
|
||||||
|
$this->dbRbacHost = $values["DB_RBAC_HOST"];
|
||||||
|
$this->dbRbacName = $values["DB_RBAC_NAME"];
|
||||||
|
$this->dbRbacUser = $values["DB_RBAC_USER"];
|
||||||
|
$this->dbRbacPass = $values["DB_RBAC_PASS"];
|
||||||
|
|
||||||
return $this->dbInfo = $values;
|
return $this->dbInfo = $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,13 +336,18 @@ class workspaceTools
|
|||||||
*
|
*
|
||||||
* @return database connection
|
* @return database connection
|
||||||
*/
|
*/
|
||||||
private function getDatabase()
|
private function getDatabase($rbac = false)
|
||||||
{
|
{
|
||||||
if (isset($this->db) && $this->db->isConnected()) {
|
if (isset($this->db) && $this->db->isConnected()) {
|
||||||
return $this->db;
|
return $this->db;
|
||||||
}
|
}
|
||||||
|
|
||||||
G::LoadSystem('database_' . strtolower($this->dbAdapter));
|
G::LoadSystem('database_' . strtolower($this->dbAdapter));
|
||||||
$this->db = new database($this->dbAdapter, $this->dbHost, $this->dbUser, $this->dbPass, $this->dbName);
|
if ($rbac = true){
|
||||||
|
$this->db = new database($this->dbAdapter, $this->dbRbacHost, $this->dbRbacUser, $this->dbRbacPass, $this->dbRbacName);
|
||||||
|
} else {
|
||||||
|
$this->db = new database($this->dbAdapter, $this->dbHost, $this->dbUser, $this->dbPass, $this->dbName);
|
||||||
|
}
|
||||||
if (!$this->db->isConnected()) {
|
if (!$this->db->isConnected()) {
|
||||||
$this->db->logQuery('No available connection to database!');
|
$this->db->logQuery('No available connection to database!');
|
||||||
throw new Exception("Could not connect to database");
|
throw new Exception("Could not connect to database");
|
||||||
@@ -370,9 +381,9 @@ class workspaceTools
|
|||||||
*
|
*
|
||||||
* @return array with the database schema
|
* @return array with the database schema
|
||||||
*/
|
*/
|
||||||
public function getSchema()
|
public function getSchema($rbac = false)
|
||||||
{
|
{
|
||||||
$oDataBase = $this->getDatabase();
|
$oDataBase = $this->getDatabase($rbac);
|
||||||
|
|
||||||
$aOldSchema = array();
|
$aOldSchema = array();
|
||||||
|
|
||||||
@@ -632,7 +643,9 @@ class workspaceTools
|
|||||||
$this->initPropel( true );
|
$this->initPropel( true );
|
||||||
p11835::isApplicable();
|
p11835::isApplicable();
|
||||||
$systemSchema = System::getSystemSchema();
|
$systemSchema = System::getSystemSchema();
|
||||||
|
$systemSchemaRbac = System::getSystemSchemaRbac();// obtiene el Schema de Rbac
|
||||||
$this->upgradeSchema( $systemSchema );
|
$this->upgradeSchema( $systemSchema );
|
||||||
|
$this->upgradeSchema( $systemSchemaRbac, false, true );// Hace Upgrade de Rbac
|
||||||
$this->upgradeData();
|
$this->upgradeData();
|
||||||
p11835::execute();
|
p11835::execute();
|
||||||
return true;
|
return true;
|
||||||
@@ -646,7 +659,7 @@ class workspaceTools
|
|||||||
* @return array bool the changes if checkOnly is true, else return
|
* @return array bool the changes if checkOnly is true, else return
|
||||||
* true on success
|
* true on success
|
||||||
*/
|
*/
|
||||||
public function upgradeSchema($schema, $checkOnly = false)
|
public function upgradeSchema($schema, $checkOnly = false, $rbac = false)
|
||||||
{
|
{
|
||||||
$dbInfo = $this->getDBInfo();
|
$dbInfo = $this->getDBInfo();
|
||||||
|
|
||||||
@@ -654,9 +667,12 @@ class workspaceTools
|
|||||||
throw new Exception("Only MySQL is supported");
|
throw new Exception("Only MySQL is supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
$workspaceSchema = $this->getSchema();
|
$workspaceSchema = $this->getSchema($rbac);
|
||||||
|
|
||||||
$changes = System::compareSchema($workspaceSchema, $schema);
|
$changes = System::compareSchema($workspaceSchema, $schema);
|
||||||
|
|
||||||
$changed = (count($changes['tablesToAdd']) > 0 || count($changes['tablesToAlter']) > 0 || count($changes['tablesWithNewIndex']) > 0 || count($changes['tablesToAlterIndex']) > 0);
|
$changed = (count($changes['tablesToAdd']) > 0 || count($changes['tablesToAlter']) > 0 || count($changes['tablesWithNewIndex']) > 0 || count($changes['tablesToAlterIndex']) > 0);
|
||||||
|
|
||||||
if ($checkOnly || (!$changed)) {
|
if ($checkOnly || (!$changed)) {
|
||||||
if ($changed) {
|
if ($changed) {
|
||||||
return $changes;
|
return $changes;
|
||||||
@@ -666,7 +682,8 @@ class workspaceTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDataBase = $this->getDatabase();
|
$oDataBase = $this->getDatabase($rbac);
|
||||||
|
|
||||||
$oDataBase->iFetchType = MYSQL_NUM;
|
$oDataBase->iFetchType = MYSQL_NUM;
|
||||||
|
|
||||||
$oDataBase->logQuery(count($changes));
|
$oDataBase->logQuery(count($changes));
|
||||||
|
|||||||
Reference in New Issue
Block a user