BUG-15479 ProcessMaker en una sola Base de Datos
Comandos unify-database y upgrade
This commit is contained in:
@@ -114,6 +114,18 @@ class database extends database_base
|
|||||||
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* generate rename table sentence
|
||||||
|
*
|
||||||
|
* @param $sTableOld old table name
|
||||||
|
* @return $sSql sql sentence
|
||||||
|
*/
|
||||||
|
public function generateRenameTableSQL ($sTableOld)
|
||||||
|
{
|
||||||
|
$sSQL = 'ALTER TABLE ' . $sTableOld . ' RENAME TO RBAC_' . $sTableOld;
|
||||||
|
return $sSQL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate drop column sentence
|
* generate drop column sentence
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
// include object class
|
// include object class
|
||||||
//include_once 'classes/model/RbacUsers.php';
|
//include_once 'classes/model/RbacUsers.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skeleton subclass for performing query and update operations on the 'USERS' table.
|
* Skeleton subclass for performing query and update operations on the 'USERS' table.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Roles extends BaseRoles {
|
|||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
$this->getRolName();
|
$this->getRolName();
|
||||||
$aFields['ROL_NAME'] = ($this->rol_name != '' ? $this->rol_name: $this->getRolCode());
|
$aFields['ROL_NAME'] = $this->rol_name;
|
||||||
|
|
||||||
return $aFields;
|
return $aFields;
|
||||||
} else {
|
} else {
|
||||||
@@ -87,9 +87,6 @@ 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;
|
||||||
@@ -186,9 +183,6 @@ 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;
|
||||||
@@ -326,9 +320,6 @@ 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;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class AuthenticationSourceMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('AUTHENTICATION_SOURCE');
|
$tMap = $this->dbMap->addTable('RBAC_AUTHENTICATION_SOURCE');
|
||||||
$tMap->setPhpName('AuthenticationSource');
|
$tMap->setPhpName('AuthenticationSource');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class PermissionsMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('PERMISSIONS');
|
$tMap = $this->dbMap->addTable('RBAC_PERMISSIONS');
|
||||||
$tMap->setPhpName('Permissions');
|
$tMap->setPhpName('Permissions');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class RbacUsersMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('USERS');
|
$tMap = $this->dbMap->addTable('RBAC_USERS');
|
||||||
$tMap->setPhpName('RbacUsers');
|
$tMap->setPhpName('RbacUsers');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class RolesMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('ROLES');
|
$tMap = $this->dbMap->addTable('RBAC_ROLES');
|
||||||
$tMap->setPhpName('Roles');
|
$tMap->setPhpName('Roles');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class RolesPermissionsMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('ROLES_PERMISSIONS');
|
$tMap = $this->dbMap->addTable('RBAC_ROLES_PERMISSIONS');
|
||||||
$tMap->setPhpName('RolesPermissions');
|
$tMap->setPhpName('RolesPermissions');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class SystemsMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('SYSTEMS');
|
$tMap = $this->dbMap->addTable('RBAC_SYSTEMS');
|
||||||
$tMap->setPhpName('Systems');
|
$tMap->setPhpName('Systems');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class UsersRolesMapBuilder {
|
|||||||
{
|
{
|
||||||
$this->dbMap = Propel::getDatabaseMap('rbac');
|
$this->dbMap = Propel::getDatabaseMap('rbac');
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('USERS_ROLES');
|
$tMap = $this->dbMap->addTable('RBAC_USERS_ROLES');
|
||||||
$tMap->setPhpName('UsersRoles');
|
$tMap->setPhpName('UsersRoles');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseAuthenticationSourcePeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'AUTHENTICATION_SOURCE';
|
const TABLE_NAME = 'RBAC_AUTHENTICATION_SOURCE';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.AuthenticationSource';
|
const CLASS_DEFAULT = 'classes.model.AuthenticationSource';
|
||||||
@@ -31,46 +31,46 @@ abstract class BaseAuthenticationSourcePeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_UID field */
|
/** the column name for the AUTH_SOURCE_UID field */
|
||||||
const AUTH_SOURCE_UID = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_UID';
|
const AUTH_SOURCE_UID = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_UID';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_NAME field */
|
/** the column name for the AUTH_SOURCE_NAME field */
|
||||||
const AUTH_SOURCE_NAME = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_NAME';
|
const AUTH_SOURCE_NAME = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_NAME';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_PROVIDER field */
|
/** the column name for the AUTH_SOURCE_PROVIDER field */
|
||||||
const AUTH_SOURCE_PROVIDER = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_PROVIDER';
|
const AUTH_SOURCE_PROVIDER = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_PROVIDER';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_SERVER_NAME field */
|
/** the column name for the AUTH_SOURCE_SERVER_NAME field */
|
||||||
const AUTH_SOURCE_SERVER_NAME = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_SERVER_NAME';
|
const AUTH_SOURCE_SERVER_NAME = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_SERVER_NAME';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_PORT field */
|
/** the column name for the AUTH_SOURCE_PORT field */
|
||||||
const AUTH_SOURCE_PORT = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_PORT';
|
const AUTH_SOURCE_PORT = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_PORT';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_ENABLED_TLS field */
|
/** the column name for the AUTH_SOURCE_ENABLED_TLS field */
|
||||||
const AUTH_SOURCE_ENABLED_TLS = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_ENABLED_TLS';
|
const AUTH_SOURCE_ENABLED_TLS = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_ENABLED_TLS';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_VERSION field */
|
/** the column name for the AUTH_SOURCE_VERSION field */
|
||||||
const AUTH_SOURCE_VERSION = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_VERSION';
|
const AUTH_SOURCE_VERSION = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_VERSION';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_BASE_DN field */
|
/** the column name for the AUTH_SOURCE_BASE_DN field */
|
||||||
const AUTH_SOURCE_BASE_DN = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_BASE_DN';
|
const AUTH_SOURCE_BASE_DN = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_BASE_DN';
|
||||||
|
|
||||||
/** the column name for the AUTH_ANONYMOUS field */
|
/** the column name for the AUTH_ANONYMOUS field */
|
||||||
const AUTH_ANONYMOUS = 'AUTHENTICATION_SOURCE.AUTH_ANONYMOUS';
|
const AUTH_ANONYMOUS = 'RBAC_AUTHENTICATION_SOURCE.AUTH_ANONYMOUS';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_SEARCH_USER field */
|
/** the column name for the AUTH_SOURCE_SEARCH_USER field */
|
||||||
const AUTH_SOURCE_SEARCH_USER = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_SEARCH_USER';
|
const AUTH_SOURCE_SEARCH_USER = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_SEARCH_USER';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_PASSWORD field */
|
/** the column name for the AUTH_SOURCE_PASSWORD field */
|
||||||
const AUTH_SOURCE_PASSWORD = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_PASSWORD';
|
const AUTH_SOURCE_PASSWORD = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_PASSWORD';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_ATTRIBUTES field */
|
/** the column name for the AUTH_SOURCE_ATTRIBUTES field */
|
||||||
const AUTH_SOURCE_ATTRIBUTES = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_ATTRIBUTES';
|
const AUTH_SOURCE_ATTRIBUTES = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_ATTRIBUTES';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_OBJECT_CLASSES field */
|
/** the column name for the AUTH_SOURCE_OBJECT_CLASSES field */
|
||||||
const AUTH_SOURCE_OBJECT_CLASSES = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_OBJECT_CLASSES';
|
const AUTH_SOURCE_OBJECT_CLASSES = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_OBJECT_CLASSES';
|
||||||
|
|
||||||
/** the column name for the AUTH_SOURCE_DATA field */
|
/** the column name for the AUTH_SOURCE_DATA field */
|
||||||
const AUTH_SOURCE_DATA = 'AUTHENTICATION_SOURCE.AUTH_SOURCE_DATA';
|
const AUTH_SOURCE_DATA = 'RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_DATA';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -230,8 +230,8 @@ abstract class BaseAuthenticationSourcePeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(AUTHENTICATION_SOURCE.AUTH_SOURCE_UID)';
|
const COUNT = 'COUNT(RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT AUTHENTICATION_SOURCE.AUTH_SOURCE_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_AUTHENTICATION_SOURCE.AUTH_SOURCE_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BasePermissionsPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'PERMISSIONS';
|
const TABLE_NAME = 'RBAC_PERMISSIONS';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.Permissions';
|
const CLASS_DEFAULT = 'classes.model.Permissions';
|
||||||
@@ -31,22 +31,22 @@ abstract class BasePermissionsPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the PER_UID field */
|
/** the column name for the PER_UID field */
|
||||||
const PER_UID = 'PERMISSIONS.PER_UID';
|
const PER_UID = 'RBAC_PERMISSIONS.PER_UID';
|
||||||
|
|
||||||
/** the column name for the PER_CODE field */
|
/** the column name for the PER_CODE field */
|
||||||
const PER_CODE = 'PERMISSIONS.PER_CODE';
|
const PER_CODE = 'RBAC_PERMISSIONS.PER_CODE';
|
||||||
|
|
||||||
/** the column name for the PER_CREATE_DATE field */
|
/** the column name for the PER_CREATE_DATE field */
|
||||||
const PER_CREATE_DATE = 'PERMISSIONS.PER_CREATE_DATE';
|
const PER_CREATE_DATE = 'RBAC_PERMISSIONS.PER_CREATE_DATE';
|
||||||
|
|
||||||
/** the column name for the PER_UPDATE_DATE field */
|
/** the column name for the PER_UPDATE_DATE field */
|
||||||
const PER_UPDATE_DATE = 'PERMISSIONS.PER_UPDATE_DATE';
|
const PER_UPDATE_DATE = 'RBAC_PERMISSIONS.PER_UPDATE_DATE';
|
||||||
|
|
||||||
/** the column name for the PER_STATUS field */
|
/** the column name for the PER_STATUS field */
|
||||||
const PER_STATUS = 'PERMISSIONS.PER_STATUS';
|
const PER_STATUS = 'RBAC_PERMISSIONS.PER_STATUS';
|
||||||
|
|
||||||
/** the column name for the PER_SYSTEM field */
|
/** the column name for the PER_SYSTEM field */
|
||||||
const PER_SYSTEM = 'PERMISSIONS.PER_SYSTEM';
|
const PER_SYSTEM = 'RBAC_PERMISSIONS.PER_SYSTEM';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -190,8 +190,8 @@ abstract class BasePermissionsPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(PERMISSIONS.PER_UID)';
|
const COUNT = 'COUNT(RBAC_PERMISSIONS.PER_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT PERMISSIONS.PER_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_PERMISSIONS.PER_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'USERS';
|
const TABLE_NAME = 'RBAC_USERS';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.RbacUsers';
|
const CLASS_DEFAULT = 'classes.model.RbacUsers';
|
||||||
@@ -31,46 +31,46 @@ abstract class BaseRbacUsersPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the USR_UID field */
|
/** the column name for the USR_UID field */
|
||||||
const USR_UID = 'USERS.USR_UID';
|
const USR_UID = 'RBAC_USERS.USR_UID';
|
||||||
|
|
||||||
/** the column name for the USR_USERNAME field */
|
/** the column name for the USR_USERNAME field */
|
||||||
const USR_USERNAME = 'USERS.USR_USERNAME';
|
const USR_USERNAME = 'RBAC_USERS.USR_USERNAME';
|
||||||
|
|
||||||
/** the column name for the USR_PASSWORD field */
|
/** the column name for the USR_PASSWORD field */
|
||||||
const USR_PASSWORD = 'USERS.USR_PASSWORD';
|
const USR_PASSWORD = 'RBAC_USERS.USR_PASSWORD';
|
||||||
|
|
||||||
/** the column name for the USR_FIRSTNAME field */
|
/** the column name for the USR_FIRSTNAME field */
|
||||||
const USR_FIRSTNAME = 'USERS.USR_FIRSTNAME';
|
const USR_FIRSTNAME = 'RBAC_USERS.USR_FIRSTNAME';
|
||||||
|
|
||||||
/** the column name for the USR_LASTNAME field */
|
/** the column name for the USR_LASTNAME field */
|
||||||
const USR_LASTNAME = 'USERS.USR_LASTNAME';
|
const USR_LASTNAME = 'RBAC_USERS.USR_LASTNAME';
|
||||||
|
|
||||||
/** the column name for the USR_EMAIL field */
|
/** the column name for the USR_EMAIL field */
|
||||||
const USR_EMAIL = 'USERS.USR_EMAIL';
|
const USR_EMAIL = 'RBAC_USERS.USR_EMAIL';
|
||||||
|
|
||||||
/** the column name for the USR_DUE_DATE field */
|
/** the column name for the USR_DUE_DATE field */
|
||||||
const USR_DUE_DATE = 'USERS.USR_DUE_DATE';
|
const USR_DUE_DATE = 'RBAC_USERS.USR_DUE_DATE';
|
||||||
|
|
||||||
/** the column name for the USR_CREATE_DATE field */
|
/** the column name for the USR_CREATE_DATE field */
|
||||||
const USR_CREATE_DATE = 'USERS.USR_CREATE_DATE';
|
const USR_CREATE_DATE = 'RBAC_USERS.USR_CREATE_DATE';
|
||||||
|
|
||||||
/** the column name for the USR_UPDATE_DATE field */
|
/** the column name for the USR_UPDATE_DATE field */
|
||||||
const USR_UPDATE_DATE = 'USERS.USR_UPDATE_DATE';
|
const USR_UPDATE_DATE = 'RBAC_USERS.USR_UPDATE_DATE';
|
||||||
|
|
||||||
/** the column name for the USR_STATUS field */
|
/** the column name for the USR_STATUS field */
|
||||||
const USR_STATUS = 'USERS.USR_STATUS';
|
const USR_STATUS = 'RBAC_USERS.USR_STATUS';
|
||||||
|
|
||||||
/** the column name for the USR_AUTH_TYPE field */
|
/** the column name for the USR_AUTH_TYPE field */
|
||||||
const USR_AUTH_TYPE = 'USERS.USR_AUTH_TYPE';
|
const USR_AUTH_TYPE = 'RBAC_USERS.USR_AUTH_TYPE';
|
||||||
|
|
||||||
/** the column name for the UID_AUTH_SOURCE field */
|
/** the column name for the UID_AUTH_SOURCE field */
|
||||||
const UID_AUTH_SOURCE = 'USERS.UID_AUTH_SOURCE';
|
const UID_AUTH_SOURCE = 'RBAC_USERS.UID_AUTH_SOURCE';
|
||||||
|
|
||||||
/** the column name for the USR_AUTH_USER_DN field */
|
/** the column name for the USR_AUTH_USER_DN field */
|
||||||
const USR_AUTH_USER_DN = 'USERS.USR_AUTH_USER_DN';
|
const USR_AUTH_USER_DN = 'RBAC_USERS.USR_AUTH_USER_DN';
|
||||||
|
|
||||||
/** the column name for the USR_AUTH_SUPERVISOR_DN field */
|
/** the column name for the USR_AUTH_SUPERVISOR_DN field */
|
||||||
const USR_AUTH_SUPERVISOR_DN = 'USERS.USR_AUTH_SUPERVISOR_DN';
|
const USR_AUTH_SUPERVISOR_DN = 'RBAC_USERS.USR_AUTH_SUPERVISOR_DN';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -230,8 +230,8 @@ abstract class BaseRbacUsersPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(USERS.USR_UID)';
|
const COUNT = 'COUNT(RBAC_USERS.USR_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT USERS.USR_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_USERS.USR_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseRolesPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'ROLES';
|
const TABLE_NAME = 'RBAC_ROLES';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.Roles';
|
const CLASS_DEFAULT = 'classes.model.Roles';
|
||||||
@@ -31,25 +31,25 @@ abstract class BaseRolesPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the ROL_UID field */
|
/** the column name for the ROL_UID field */
|
||||||
const ROL_UID = 'ROLES.ROL_UID';
|
const ROL_UID = 'RBAC_ROLES.ROL_UID';
|
||||||
|
|
||||||
/** the column name for the ROL_PARENT field */
|
/** the column name for the ROL_PARENT field */
|
||||||
const ROL_PARENT = 'ROLES.ROL_PARENT';
|
const ROL_PARENT = 'RBAC_ROLES.ROL_PARENT';
|
||||||
|
|
||||||
/** the column name for the ROL_SYSTEM field */
|
/** the column name for the ROL_SYSTEM field */
|
||||||
const ROL_SYSTEM = 'ROLES.ROL_SYSTEM';
|
const ROL_SYSTEM = 'RBAC_ROLES.ROL_SYSTEM';
|
||||||
|
|
||||||
/** the column name for the ROL_CODE field */
|
/** the column name for the ROL_CODE field */
|
||||||
const ROL_CODE = 'ROLES.ROL_CODE';
|
const ROL_CODE = 'RBAC_ROLES.ROL_CODE';
|
||||||
|
|
||||||
/** the column name for the ROL_CREATE_DATE field */
|
/** the column name for the ROL_CREATE_DATE field */
|
||||||
const ROL_CREATE_DATE = 'ROLES.ROL_CREATE_DATE';
|
const ROL_CREATE_DATE = 'RBAC_ROLES.ROL_CREATE_DATE';
|
||||||
|
|
||||||
/** the column name for the ROL_UPDATE_DATE field */
|
/** the column name for the ROL_UPDATE_DATE field */
|
||||||
const ROL_UPDATE_DATE = 'ROLES.ROL_UPDATE_DATE';
|
const ROL_UPDATE_DATE = 'RBAC_ROLES.ROL_UPDATE_DATE';
|
||||||
|
|
||||||
/** the column name for the ROL_STATUS field */
|
/** the column name for the ROL_STATUS field */
|
||||||
const ROL_STATUS = 'ROLES.ROL_STATUS';
|
const ROL_STATUS = 'RBAC_ROLES.ROL_STATUS';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -195,8 +195,8 @@ abstract class BaseRolesPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(ROLES.ROL_UID)';
|
const COUNT = 'COUNT(RBAC_ROLES.ROL_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT ROLES.ROL_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_ROLES.ROL_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseRolesPermissionsPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'ROLES_PERMISSIONS';
|
const TABLE_NAME = 'RBAC_ROLES_PERMISSIONS';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.RolesPermissions';
|
const CLASS_DEFAULT = 'classes.model.RolesPermissions';
|
||||||
@@ -31,10 +31,10 @@ abstract class BaseRolesPermissionsPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the ROL_UID field */
|
/** the column name for the ROL_UID field */
|
||||||
const ROL_UID = 'ROLES_PERMISSIONS.ROL_UID';
|
const ROL_UID = 'RBAC_ROLES_PERMISSIONS.ROL_UID';
|
||||||
|
|
||||||
/** the column name for the PER_UID field */
|
/** the column name for the PER_UID field */
|
||||||
const PER_UID = 'ROLES_PERMISSIONS.PER_UID';
|
const PER_UID = 'RBAC_ROLES_PERMISSIONS.PER_UID';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -170,8 +170,8 @@ abstract class BaseRolesPermissionsPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(ROLES_PERMISSIONS.ROL_UID)';
|
const COUNT = 'COUNT(RBAC_ROLES_PERMISSIONS.ROL_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT ROLES_PERMISSIONS.ROL_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_ROLES_PERMISSIONS.ROL_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseSystemsPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'SYSTEMS';
|
const TABLE_NAME = 'RBAC_SYSTEMS';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.Systems';
|
const CLASS_DEFAULT = 'classes.model.Systems';
|
||||||
@@ -31,19 +31,19 @@ abstract class BaseSystemsPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the SYS_UID field */
|
/** the column name for the SYS_UID field */
|
||||||
const SYS_UID = 'SYSTEMS.SYS_UID';
|
const SYS_UID = 'RBAC_SYSTEMS.SYS_UID';
|
||||||
|
|
||||||
/** the column name for the SYS_CODE field */
|
/** the column name for the SYS_CODE field */
|
||||||
const SYS_CODE = 'SYSTEMS.SYS_CODE';
|
const SYS_CODE = 'RBAC_SYSTEMS.SYS_CODE';
|
||||||
|
|
||||||
/** the column name for the SYS_CREATE_DATE field */
|
/** the column name for the SYS_CREATE_DATE field */
|
||||||
const SYS_CREATE_DATE = 'SYSTEMS.SYS_CREATE_DATE';
|
const SYS_CREATE_DATE = 'RBAC_SYSTEMS.SYS_CREATE_DATE';
|
||||||
|
|
||||||
/** the column name for the SYS_UPDATE_DATE field */
|
/** the column name for the SYS_UPDATE_DATE field */
|
||||||
const SYS_UPDATE_DATE = 'SYSTEMS.SYS_UPDATE_DATE';
|
const SYS_UPDATE_DATE = 'RBAC_SYSTEMS.SYS_UPDATE_DATE';
|
||||||
|
|
||||||
/** the column name for the SYS_STATUS field */
|
/** the column name for the SYS_STATUS field */
|
||||||
const SYS_STATUS = 'SYSTEMS.SYS_STATUS';
|
const SYS_STATUS = 'RBAC_SYSTEMS.SYS_STATUS';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -185,8 +185,8 @@ abstract class BaseSystemsPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(SYSTEMS.SYS_UID)';
|
const COUNT = 'COUNT(RBAC_SYSTEMS.SYS_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT SYSTEMS.SYS_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_SYSTEMS.SYS_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ abstract class BaseUsersRolesPeer {
|
|||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
|
|
||||||
/** the table name for this class */
|
/** the table name for this class */
|
||||||
const TABLE_NAME = 'USERS_ROLES';
|
const TABLE_NAME = 'RBAC_USERS_ROLES';
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
/** A class that can be returned by this peer. */
|
||||||
const CLASS_DEFAULT = 'classes.model.UsersRoles';
|
const CLASS_DEFAULT = 'classes.model.UsersRoles';
|
||||||
@@ -31,10 +31,10 @@ abstract class BaseUsersRolesPeer {
|
|||||||
|
|
||||||
|
|
||||||
/** the column name for the USR_UID field */
|
/** the column name for the USR_UID field */
|
||||||
const USR_UID = 'USERS_ROLES.USR_UID';
|
const USR_UID = 'RBAC_USERS_ROLES.USR_UID';
|
||||||
|
|
||||||
/** the column name for the ROL_UID field */
|
/** the column name for the ROL_UID field */
|
||||||
const ROL_UID = 'USERS_ROLES.ROL_UID';
|
const ROL_UID = 'RBAC_USERS_ROLES.ROL_UID';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
@@ -170,8 +170,8 @@ abstract class BaseUsersRolesPeer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(USERS_ROLES.USR_UID)';
|
const COUNT = 'COUNT(RBAC_USERS_ROLES.USR_UID)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT USERS_ROLES.USR_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT RBAC_USERS_ROLES.USR_UID)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<database name="rbac">
|
<database name="rbac">
|
||||||
<table name="PERMISSIONS">
|
<table name="RBAC_PERMISSIONS">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="PERMISSIONS"/>
|
<parameter name="Name" value="RBAC_PERMISSIONS"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -28,9 +29,9 @@
|
|||||||
<column name="PER_STATUS" type="INTEGER" required="true" default="1" />
|
<column name="PER_STATUS" type="INTEGER" required="true" default="1" />
|
||||||
<column name="PER_SYSTEM" type="VARCHAR" size="32" required="true" default="00000000000000000000000000000002" />
|
<column name="PER_SYSTEM" type="VARCHAR" size="32" required="true" default="00000000000000000000000000000002" />
|
||||||
</table>
|
</table>
|
||||||
<table name="ROLES">
|
<table name="RBAC_ROLES">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="ROLES"/>
|
<parameter name="Name" value="RBAC_ROLES"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -57,9 +58,9 @@
|
|||||||
<column name="ROL_UPDATE_DATE" type="TIMESTAMP" />
|
<column name="ROL_UPDATE_DATE" type="TIMESTAMP" />
|
||||||
<column name="ROL_STATUS" type="INTEGER" required="true" default="1" />
|
<column name="ROL_STATUS" type="INTEGER" required="true" default="1" />
|
||||||
</table>
|
</table>
|
||||||
<table name="ROLES_PERMISSIONS">
|
<table name="RBAC_ROLES_PERMISSIONS">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="ROLES_PERMISSIONS"/>
|
<parameter name="Name" value="RBAC_ROLES_PERMISSIONS"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -81,9 +82,9 @@
|
|||||||
<column name="ROL_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
<column name="ROL_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||||
<column name="PER_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
<column name="PER_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||||
</table>
|
</table>
|
||||||
<table name="SYSTEMS">
|
<table name="RBAC_SYSTEMS">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="SYSTEMS"/>
|
<parameter name="Name" value="RBAC_SYSTEMS"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -108,9 +109,9 @@
|
|||||||
<column name="SYS_UPDATE_DATE" type="TIMESTAMP" />
|
<column name="SYS_UPDATE_DATE" type="TIMESTAMP" />
|
||||||
<column name="SYS_STATUS" type="INTEGER" required="true" default="0" />
|
<column name="SYS_STATUS" type="INTEGER" required="true" default="0" />
|
||||||
</table>
|
</table>
|
||||||
<table name="USERS">
|
<table name="RBAC_USERS">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="USERS"/>
|
<parameter name="Name" value="RBAC_USERS"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -144,9 +145,9 @@
|
|||||||
<column name="USR_AUTH_USER_DN" type="VARCHAR" size="255" required="true" default="" />
|
<column name="USR_AUTH_USER_DN" type="VARCHAR" size="255" required="true" default="" />
|
||||||
<column name="USR_AUTH_SUPERVISOR_DN" type="VARCHAR" size="255" required="true" default="" />
|
<column name="USR_AUTH_SUPERVISOR_DN" type="VARCHAR" size="255" required="true" default="" />
|
||||||
</table>
|
</table>
|
||||||
<table name="USERS_ROLES">
|
<table name="RBAC_USERS_ROLES">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="USERS_ROLES"/>
|
<parameter name="Name" value="RBAC_USERS_ROLES"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
<parameter name="Version" value="10"/>
|
<parameter name="Version" value="10"/>
|
||||||
<parameter name="Row_format" value="Dynamic"/>
|
<parameter name="Row_format" value="Dynamic"/>
|
||||||
@@ -168,7 +169,7 @@
|
|||||||
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||||
<column name="ROL_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
<column name="ROL_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||||
</table>
|
</table>
|
||||||
<table name="AUTHENTICATION_SOURCE">
|
<table name="RBAC_AUTHENTICATION_SOURCE">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="AUTHENTICATION_SOURCE"/>
|
<parameter name="Name" value="AUTHENTICATION_SOURCE"/>
|
||||||
<parameter name="Engine" value="MyISAM"/>
|
<parameter name="Engine" value="MyISAM"/>
|
||||||
|
|||||||
@@ -1,64 +1,64 @@
|
|||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000001','PM_LOGIN','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000001','PM_LOGIN','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000002','PM_SETUP','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000002','PM_SETUP','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000003','PM_USERS','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000003','PM_USERS','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000004','PM_FACTORY','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000004','PM_FACTORY','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000005','PM_CASES','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000005','PM_CASES','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000006','PM_ALLCASES','2008-04-30 00:00:00','2008-04-30 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000006','PM_ALLCASES','2008-04-30 00:00:00','2008-04-30 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000008','PM_REPORTS','2008-05-12 00:00:00','2008-05-12 00:00:00',0,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000008','PM_REPORTS','2008-05-12 00:00:00','2008-05-12 00:00:00',0,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000007','PM_REASSIGNCASE','2008-05-02 18:16:29','2008-05-02 18:16:29',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000007','PM_REASSIGNCASE','2008-05-02 18:16:29','2008-05-02 18:16:29',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000009','PM_SUPERVISOR','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000009','PM_SUPERVISOR','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000010','PM_SETUP_ADVANCE','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000010','PM_SETUP_ADVANCE','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000011','PM_DASHBOARD','2009-02-18 00:00:00','2009-02-18 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000011','PM_DASHBOARD','2009-02-18 00:00:00','2009-02-18 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000012','PM_WEBDAV','2009-08-21 00:00:00','2009-08-21 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000012','PM_WEBDAV','2009-08-21 00:00:00','2009-08-21 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000013','PM_DELETECASE','2009-10-12 00:00:00','0000-00-00 00:00:00',0,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000013','PM_DELETECASE','2009-10-12 00:00:00','0000-00-00 00:00:00',0,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000014','PM_EDITPERSONALINFO','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000014','PM_EDITPERSONALINFO','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000015','PM_FOLDERS_VIEW','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000015','PM_FOLDERS_VIEW','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000016','PM_FOLDERS_ADD_FOLDER','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000016','PM_FOLDERS_ADD_FOLDER','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
INSERT INTO PERMISSIONS VALUES ('00000000000000000000000000000017','PM_FOLDERS_ADD_FILE','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000017','PM_FOLDERS_ADD_FILE','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
||||||
|
|
||||||
INSERT INTO ROLES VALUES ('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO ROLES VALUES ('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO ROLES VALUES ('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO ROLES VALUES ('00000000000000000000000000000004','','00000000000000000000000000000002','PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000004','','00000000000000000000000000000002','PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
||||||
|
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000001');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000001');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000002');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000002');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000003');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000003');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000004');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000004');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000005');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000005');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000006');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000006');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000007');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000007');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000008');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000008');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000009');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000009');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000010');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000010');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000011');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000011');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000012');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000012');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000013');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000013');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000014');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000014');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000015');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000015');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000016');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000016');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000017');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000017');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000001');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000001');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000005');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000005');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000001');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000001');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000003');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000003');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000005');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000005');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000006');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000006');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000007');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000007');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000008');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000008');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000009');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000009');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000011');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000011');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000013');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000013');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000014');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000014');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000015');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000015');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000016');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000016');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000017');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000017');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000018');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000018');
|
||||||
INSERT INTO ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000019');
|
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000019');
|
||||||
|
|
||||||
INSERT INTO SYSTEMS VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO RBAC_SYSTEMS VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO SYSTEMS VALUES ('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO RBAC_SYSTEMS VALUES ('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
|
|
||||||
INSERT INTO USERS VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','','','');
|
INSERT INTO RBAC_USERS VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','','','');
|
||||||
|
|
||||||
INSERT INTO USERS_ROLES VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
INSERT INTO RBAC_USERS_ROLES VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'PERMISSIONS')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_PERMISSIONS')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
|
DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -16,7 +16,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'PERMISSIONS'
|
and tables.name = 'RBAC_PERMISSIONS'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_1, @constraintname_1
|
FETCH NEXT from refcursor into @reftable_1, @constraintname_1
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -26,11 +26,11 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [PERMISSIONS]
|
DROP TABLE [RBAC_PERMISSIONS]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [PERMISSIONS]
|
CREATE TABLE [RBAC_PERMISSIONS]
|
||||||
(
|
(
|
||||||
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[PER_CODE] VARCHAR(32) default '' NOT NULL,
|
[PER_CODE] VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -38,7 +38,7 @@ CREATE TABLE [PERMISSIONS]
|
|||||||
[PER_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
[PER_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
||||||
[PER_STATUS] INT default 1 NOT NULL,
|
[PER_STATUS] INT default 1 NOT NULL,
|
||||||
[PER_SYSTEM] VARCHAR(32) default '00000000000000000000000000000002' NOT NULL,
|
[PER_SYSTEM] VARCHAR(32) default '00000000000000000000000000000002' NOT NULL,
|
||||||
CONSTRAINT PERMISSIONS_PK PRIMARY KEY ([PER_UID])
|
CONSTRAINT RBAC_PERMISSIONS_PK PRIMARY KEY ([PER_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -46,7 +46,7 @@ CREATE TABLE [PERMISSIONS]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'ROLES')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_ROLES')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60)
|
DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -68,11 +68,11 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [ROLES]
|
DROP TABLE [RBAC_ROLES]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [ROLES]
|
CREATE TABLE [RBAC_ROLES]
|
||||||
(
|
(
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[ROL_PARENT] VARCHAR(32) default '' NOT NULL,
|
[ROL_PARENT] VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -81,7 +81,7 @@ CREATE TABLE [ROLES]
|
|||||||
[ROL_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
[ROL_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
||||||
[ROL_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
[ROL_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
||||||
[ROL_STATUS] INT default 1 NOT NULL,
|
[ROL_STATUS] INT default 1 NOT NULL,
|
||||||
CONSTRAINT ROLES_PK PRIMARY KEY ([ROL_UID])
|
CONSTRAINT RBAC_ROLES_PK PRIMARY KEY ([ROL_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -89,7 +89,7 @@ CREATE TABLE [ROLES]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'ROLES_PERMISSIONS')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_ROLES_PERMISSIONS')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
|
DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -101,7 +101,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'ROLES_PERMISSIONS'
|
and tables.name = 'RBAC_ROLES_PERMISSIONS'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_3, @constraintname_3
|
FETCH NEXT from refcursor into @reftable_3, @constraintname_3
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -111,15 +111,15 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [ROLES_PERMISSIONS]
|
DROP TABLE [RBAC_ROLES_PERMISSIONS]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [ROLES_PERMISSIONS]
|
CREATE TABLE [RBAC_ROLES_PERMISSIONS]
|
||||||
(
|
(
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
CONSTRAINT ROLES_PERMISSIONS_PK PRIMARY KEY ([ROL_UID],[PER_UID])
|
CONSTRAINT RBAC_ROLES_PERMISSIONS_PK PRIMARY KEY ([ROL_UID],[PER_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -127,7 +127,7 @@ CREATE TABLE [ROLES_PERMISSIONS]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'SYSTEMS')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_SYSTEMS')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
|
DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -139,7 +139,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'SYSTEMS'
|
and tables.name = 'RBAC_SYSTEMS'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_4, @constraintname_4
|
FETCH NEXT from refcursor into @reftable_4, @constraintname_4
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -149,18 +149,18 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [SYSTEMS]
|
DROP TABLE [RBAC_SYSTEMS]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [SYSTEMS]
|
CREATE TABLE [RBAC_SYSTEMS]
|
||||||
(
|
(
|
||||||
[SYS_UID] VARCHAR(32) default '' NOT NULL,
|
[SYS_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[SYS_CODE] VARCHAR(32) default '' NOT NULL,
|
[SYS_CODE] VARCHAR(32) default '' NOT NULL,
|
||||||
[SYS_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
[SYS_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
||||||
[SYS_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
[SYS_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
||||||
[SYS_STATUS] INT default 0 NOT NULL,
|
[SYS_STATUS] INT default 0 NOT NULL,
|
||||||
CONSTRAINT SYSTEMS_PK PRIMARY KEY ([SYS_UID])
|
CONSTRAINT RBAC_SYSTEMS_PK PRIMARY KEY ([SYS_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -218,7 +218,7 @@ CREATE TABLE [RBAC_USERS]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'USERS_ROLES')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_USERS_ROLES')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
|
DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -230,7 +230,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'USERS_ROLES'
|
and tables.name = 'RBAC_USERS_ROLES'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_6, @constraintname_6
|
FETCH NEXT from refcursor into @reftable_6, @constraintname_6
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -240,15 +240,15 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [USERS_ROLES]
|
DROP TABLE [RBAC_USERS_ROLES]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [USERS_ROLES]
|
CREATE TABLE [RBAC_USERS_ROLES]
|
||||||
(
|
(
|
||||||
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
CONSTRAINT USERS_ROLES_PK PRIMARY KEY ([USR_UID],[ROL_UID])
|
CONSTRAINT RBAC_USERS_ROLES_PK PRIMARY KEY ([USR_UID],[ROL_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -256,7 +256,7 @@ CREATE TABLE [USERS_ROLES]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'AUTHENTICATION_SOURCE')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_AUTHENTICATION_SOURCE')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_7 nvarchar(60), @constraintname_7 nvarchar(60)
|
DECLARE @reftable_7 nvarchar(60), @constraintname_7 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -268,7 +268,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'AUTHENTICATION_SOURCE'
|
and tables.name = 'RBAC_AUTHENTICATION_SOURCE'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_7, @constraintname_7
|
FETCH NEXT from refcursor into @reftable_7, @constraintname_7
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -278,11 +278,11 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [AUTHENTICATION_SOURCE]
|
DROP TABLE [RBAC_AUTHENTICATION_SOURCE]
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [AUTHENTICATION_SOURCE]
|
CREATE TABLE [RBAC_AUTHENTICATION_SOURCE]
|
||||||
(
|
(
|
||||||
[AUTH_SOURCE_UID] VARCHAR(32) default '' NOT NULL,
|
[AUTH_SOURCE_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[AUTH_SOURCE_NAME] VARCHAR(50) default '' NOT NULL,
|
[AUTH_SOURCE_NAME] VARCHAR(50) default '' NOT NULL,
|
||||||
@@ -298,7 +298,7 @@ CREATE TABLE [AUTHENTICATION_SOURCE]
|
|||||||
[AUTH_SOURCE_ATTRIBUTES] VARCHAR(255) default '' NOT NULL,
|
[AUTH_SOURCE_ATTRIBUTES] VARCHAR(255) default '' NOT NULL,
|
||||||
[AUTH_SOURCE_OBJECT_CLASSES] VARCHAR(255) default '' NOT NULL,
|
[AUTH_SOURCE_OBJECT_CLASSES] VARCHAR(255) default '' NOT NULL,
|
||||||
[AUTH_SOURCE_DATA] TEXT NULL,
|
[AUTH_SOURCE_DATA] TEXT NULL,
|
||||||
CONSTRAINT AUTHENTICATION_SOURCE_PK PRIMARY KEY ([AUTH_SOURCE_UID])
|
CONSTRAINT RBAC_AUTHENTICATION_SOURCE_PK PRIMARY KEY ([AUTH_SOURCE_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ CREATE TABLE [AUTHENTICATION_SOURCE]
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'USERS')
|
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_USERS')
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @reftable_8 nvarchar(60), @constraintname_8 nvarchar(60)
|
DECLARE @reftable_8 nvarchar(60), @constraintname_8 nvarchar(60)
|
||||||
DECLARE refcursor CURSOR FOR
|
DECLARE refcursor CURSOR FOR
|
||||||
@@ -319,7 +319,7 @@ BEGIN
|
|||||||
where tables.id = ref.rkeyid
|
where tables.id = ref.rkeyid
|
||||||
and cons.id = ref.constid
|
and cons.id = ref.constid
|
||||||
and reftables.id = ref.fkeyid
|
and reftables.id = ref.fkeyid
|
||||||
and tables.name = 'USERS'
|
and tables.name = 'RBAC_USERS'
|
||||||
OPEN refcursor
|
OPEN refcursor
|
||||||
FETCH NEXT from refcursor into @reftable_8, @constraintname_8
|
FETCH NEXT from refcursor into @reftable_8, @constraintname_8
|
||||||
while @@FETCH_STATUS = 0
|
while @@FETCH_STATUS = 0
|
||||||
@@ -329,10 +329,10 @@ BEGIN
|
|||||||
END
|
END
|
||||||
CLOSE refcursor
|
CLOSE refcursor
|
||||||
DEALLOCATE refcursor
|
DEALLOCATE refcursor
|
||||||
DROP TABLE [USERS]
|
DROP TABLE [RBAC_USERS]
|
||||||
END
|
END
|
||||||
|
|
||||||
CREATE TABLE [USERS]
|
CREATE TABLE [RBAC_USERS]
|
||||||
(
|
(
|
||||||
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
||||||
[USR_USERNAME] VARCHAR(100) default '' NOT NULL,
|
[USR_USERNAME] VARCHAR(100) default '' NOT NULL,
|
||||||
@@ -354,7 +354,7 @@ CREATE TABLE [USERS]
|
|||||||
[USR_REPORTS_TO] varchar(32) NULL,
|
[USR_REPORTS_TO] varchar(32) NULL,
|
||||||
|
|
||||||
|
|
||||||
CONSTRAINT USERS_PK PRIMARY KEY ([USR_UID])
|
CONSTRAINT RBAC_USERS_PK PRIMARY KEY ([USR_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
INSERT INTO `PERMISSIONS` VALUES
|
INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||||
('00000000000000000000000000000001','PM_LOGIN','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000001','PM_LOGIN','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000002','PM_SETUP','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000002','PM_SETUP','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000003','PM_USERS','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000003','PM_USERS','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002'),
|
||||||
@@ -19,14 +19,14 @@ INSERT INTO `PERMISSIONS` VALUES
|
|||||||
('00000000000000000000000000000018','PM_CANCELCASE','2011-15-11 00:00:00','2011-15-11 00:00:00',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000018','PM_CANCELCASE','2011-15-11 00:00:00','2011-15-11 00:00:00',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000019','PM_FOLDER_DELETE','2011-15-11 00:00:00','2011-15-11 00:00:00',1,'00000000000000000000000000000002');
|
('00000000000000000000000000000019','PM_FOLDER_DELETE','2011-15-11 00:00:00','2011-15-11 00:00:00',1,'00000000000000000000000000000002');
|
||||||
|
|
||||||
INSERT INTO `ROLES` VALUES
|
INSERT INTO `RBAC_ROLES` VALUES
|
||||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||||
('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||||
('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||||
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `ROLES_PERMISSIONS` VALUES
|
INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||||
('00000000000000000000000000000002','00000000000000000000000000000001'),
|
('00000000000000000000000000000002','00000000000000000000000000000001'),
|
||||||
('00000000000000000000000000000002','00000000000000000000000000000002'),
|
('00000000000000000000000000000002','00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000002','00000000000000000000000000000003'),
|
('00000000000000000000000000000002','00000000000000000000000000000003'),
|
||||||
@@ -64,6 +64,6 @@ INSERT INTO `ROLES_PERMISSIONS` VALUES
|
|||||||
('00000000000000000000000000000004', '00000000000000000000000000000018'),
|
('00000000000000000000000000000004', '00000000000000000000000000000018'),
|
||||||
('00000000000000000000000000000004', '00000000000000000000000000000019');
|
('00000000000000000000000000000004', '00000000000000000000000000000019');
|
||||||
|
|
||||||
INSERT INTO `SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO `USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
||||||
INSERT INTO `USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
INSERT INTO `RBAC_USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ SET FOREIGN_KEY_CHECKS = 0;
|
|||||||
#-- PERMISSIONS
|
#-- PERMISSIONS
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `PERMISSIONS`;
|
DROP TABLE IF EXISTS `RBAC_PERMISSIONS`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `PERMISSIONS`
|
CREATE TABLE `RBAC_PERMISSIONS`
|
||||||
(
|
(
|
||||||
`PER_UID` VARCHAR(32) default '' NOT NULL,
|
`PER_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`PER_CODE` VARCHAR(32) default '' NOT NULL,
|
`PER_CODE` VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -24,10 +24,10 @@ CREATE TABLE `PERMISSIONS`
|
|||||||
#-- ROLES
|
#-- ROLES
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `ROLES`;
|
DROP TABLE IF EXISTS `RBAC_ROLES`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `ROLES`
|
CREATE TABLE `RBAC_ROLES`
|
||||||
(
|
(
|
||||||
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`ROL_PARENT` VARCHAR(32) default '' NOT NULL,
|
`ROL_PARENT` VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -42,10 +42,10 @@ CREATE TABLE `ROLES`
|
|||||||
#-- ROLES_PERMISSIONS
|
#-- ROLES_PERMISSIONS
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `ROLES_PERMISSIONS`;
|
DROP TABLE IF EXISTS `RBAC_ROLES_PERMISSIONS`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `ROLES_PERMISSIONS`
|
CREATE TABLE `RBAC_ROLES_PERMISSIONS`
|
||||||
(
|
(
|
||||||
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`PER_UID` VARCHAR(32) default '' NOT NULL,
|
`PER_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -55,10 +55,10 @@ CREATE TABLE `ROLES_PERMISSIONS`
|
|||||||
#-- SYSTEMS
|
#-- SYSTEMS
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `SYSTEMS`;
|
DROP TABLE IF EXISTS `RBAC_SYSTEMS`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `SYSTEMS`
|
CREATE TABLE `RBAC_SYSTEMS`
|
||||||
(
|
(
|
||||||
`SYS_UID` VARCHAR(32) default '' NOT NULL,
|
`SYS_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`SYS_CODE` VARCHAR(32) default '' NOT NULL,
|
`SYS_CODE` VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -71,10 +71,10 @@ CREATE TABLE `SYSTEMS`
|
|||||||
#-- USERS
|
#-- USERS
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `USERS`;
|
DROP TABLE IF EXISTS `RBAC_USERS`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `USERS`
|
CREATE TABLE `RBAC_USERS`
|
||||||
(
|
(
|
||||||
`USR_UID` VARCHAR(32) default '' NOT NULL,
|
`USR_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`USR_USERNAME` VARCHAR(100) default '' NOT NULL,
|
`USR_USERNAME` VARCHAR(100) default '' NOT NULL,
|
||||||
@@ -96,10 +96,10 @@ CREATE TABLE `USERS`
|
|||||||
#-- USERS_ROLES
|
#-- USERS_ROLES
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `USERS_ROLES`;
|
DROP TABLE IF EXISTS `RBAC_USERS_ROLES`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `USERS_ROLES`
|
CREATE TABLE `RBAC_USERS_ROLES`
|
||||||
(
|
(
|
||||||
`USR_UID` VARCHAR(32) default '' NOT NULL,
|
`USR_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
`ROL_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
@@ -109,10 +109,10 @@ CREATE TABLE `USERS_ROLES`
|
|||||||
#-- AUTHENTICATION_SOURCE
|
#-- AUTHENTICATION_SOURCE
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `AUTHENTICATION_SOURCE`;
|
DROP TABLE IF EXISTS `RBAC_AUTHENTICATION_SOURCE`;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `AUTHENTICATION_SOURCE`
|
CREATE TABLE `RBAC_AUTHENTICATION_SOURCE`
|
||||||
(
|
(
|
||||||
`AUTH_SOURCE_UID` VARCHAR(32) default '' NOT NULL,
|
`AUTH_SOURCE_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`AUTH_SOURCE_NAME` VARCHAR(50) default '' NOT NULL,
|
`AUTH_SOURCE_NAME` VARCHAR(50) default '' NOT NULL,
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
PERMISSIONS
|
PERMISSIONS
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "PERMISSIONS" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_PERMISSIONS" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "PERMISSIONS"
|
CREATE TABLE "RBAC_PERMISSIONS"
|
||||||
(
|
(
|
||||||
"PER_UID" VARCHAR2(32) default '' NOT NULL,
|
"PER_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"PER_CODE" VARCHAR2(32) default '' NOT NULL,
|
"PER_CODE" VARCHAR2(32) default '' NOT NULL,
|
||||||
@@ -16,7 +16,7 @@ CREATE TABLE "PERMISSIONS"
|
|||||||
"PER_STATUS" NUMBER default 1 NOT NULL
|
"PER_STATUS" NUMBER default 1 NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "PERMISSIONS"
|
ALTER TABLE "RBAC_PERMISSIONS"
|
||||||
ADD CONSTRAINT "PERMISSIONS_PK"
|
ADD CONSTRAINT "PERMISSIONS_PK"
|
||||||
PRIMARY KEY ("PER_UID");
|
PRIMARY KEY ("PER_UID");
|
||||||
|
|
||||||
@@ -25,10 +25,10 @@ CREATE TABLE "PERMISSIONS"
|
|||||||
ROLES
|
ROLES
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "ROLES" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_ROLES" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "ROLES"
|
CREATE TABLE "RBAC_ROLES"
|
||||||
(
|
(
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"ROL_PARENT" VARCHAR2(32) default '' NOT NULL,
|
"ROL_PARENT" VARCHAR2(32) default '' NOT NULL,
|
||||||
@@ -39,7 +39,7 @@ CREATE TABLE "ROLES"
|
|||||||
"ROL_STATUS" NUMBER default 1 NOT NULL
|
"ROL_STATUS" NUMBER default 1 NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "ROLES"
|
ALTER TABLE "RBAC_ROLES"
|
||||||
ADD CONSTRAINT "ROLES_PK"
|
ADD CONSTRAINT "ROLES_PK"
|
||||||
PRIMARY KEY ("ROL_UID");
|
PRIMARY KEY ("ROL_UID");
|
||||||
|
|
||||||
@@ -48,17 +48,17 @@ CREATE TABLE "ROLES"
|
|||||||
ROLES_PERMISSIONS
|
ROLES_PERMISSIONS
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "ROLES_PERMISSIONS" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_ROLES_PERMISSIONS" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "ROLES_PERMISSIONS"
|
CREATE TABLE "RBAC_ROLES_PERMISSIONS"
|
||||||
(
|
(
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"PER_UID" VARCHAR2(32) default '' NOT NULL
|
"PER_UID" VARCHAR2(32) default '' NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "ROLES_PERMISSIONS"
|
ALTER TABLE "RBAC_ROLES_PERMISSIONS"
|
||||||
ADD CONSTRAINT "ROLES_PERMISSIONS_PK"
|
ADD CONSTRAINT "RBAC_ROLES_PERMISSIONS_PK"
|
||||||
PRIMARY KEY ("ROL_UID","PER_UID");
|
PRIMARY KEY ("ROL_UID","PER_UID");
|
||||||
|
|
||||||
|
|
||||||
@@ -66,10 +66,10 @@ CREATE TABLE "ROLES_PERMISSIONS"
|
|||||||
SYSTEMS
|
SYSTEMS
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "SYSTEMS" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_SYSTEMS" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "SYSTEMS"
|
CREATE TABLE "RBAC_SYSTEMS"
|
||||||
(
|
(
|
||||||
"SYS_UID" VARCHAR2(32) default '' NOT NULL,
|
"SYS_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"SYS_CODE" VARCHAR2(32) default '' NOT NULL,
|
"SYS_CODE" VARCHAR2(32) default '' NOT NULL,
|
||||||
@@ -78,7 +78,7 @@ CREATE TABLE "SYSTEMS"
|
|||||||
"SYS_STATUS" NUMBER default 0 NOT NULL
|
"SYS_STATUS" NUMBER default 0 NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "SYSTEMS"
|
ALTER TABLE "RBAC_SYSTEMS"
|
||||||
ADD CONSTRAINT "SYSTEMS_PK"
|
ADD CONSTRAINT "SYSTEMS_PK"
|
||||||
PRIMARY KEY ("SYS_UID");
|
PRIMARY KEY ("SYS_UID");
|
||||||
|
|
||||||
@@ -87,10 +87,10 @@ CREATE TABLE "SYSTEMS"
|
|||||||
USERS
|
USERS
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "USERS" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_USERS" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "USERS"
|
CREATE TABLE "RBAC_USERS"
|
||||||
(
|
(
|
||||||
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"USR_USERNAME" VARCHAR2(100) default '' NOT NULL,
|
"USR_USERNAME" VARCHAR2(100) default '' NOT NULL,
|
||||||
@@ -104,7 +104,7 @@ CREATE TABLE "USERS"
|
|||||||
"USR_STATUS" NUMBER default 1 NOT NULL
|
"USR_STATUS" NUMBER default 1 NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "USERS"
|
ALTER TABLE "RBAC_USERS"
|
||||||
ADD CONSTRAINT "USERS_PK"
|
ADD CONSTRAINT "USERS_PK"
|
||||||
PRIMARY KEY ("USR_UID");
|
PRIMARY KEY ("USR_UID");
|
||||||
|
|
||||||
@@ -113,15 +113,15 @@ CREATE TABLE "USERS"
|
|||||||
USERS_ROLES
|
USERS_ROLES
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
DROP TABLE "USERS_ROLES" CASCADE CONSTRAINTS;
|
DROP TABLE "RBAC_USERS_ROLES" CASCADE CONSTRAINTS;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "USERS_ROLES"
|
CREATE TABLE "RBAC_USERS_ROLES"
|
||||||
(
|
(
|
||||||
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL
|
"ROL_UID" VARCHAR2(32) default '' NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "USERS_ROLES"
|
ALTER TABLE "RBAC_USERS_ROLES"
|
||||||
ADD CONSTRAINT "USERS_ROLES_PK"
|
ADD CONSTRAINT "USERS_ROLES_PK"
|
||||||
PRIMARY KEY ("USR_UID","ROL_UID");
|
PRIMARY KEY ("USR_UID","ROL_UID");
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
G::LoadClass("system");
|
G::LoadClass("system");
|
||||||
G::LoadClass("wsTools");
|
G::LoadClass("wsTools");
|
||||||
|
G::LoadSystem("dbMaintenance");
|
||||||
|
G::LoadClass("cli");
|
||||||
|
|
||||||
CLI::taskName('upgrade');
|
CLI::taskName('upgrade');
|
||||||
CLI::taskDescription(<<<EOT
|
CLI::taskDescription(<<<EOT
|
||||||
@@ -39,6 +41,24 @@ EOT
|
|||||||
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV");
|
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV");
|
||||||
CLI::taskRun("run_upgrade");
|
CLI::taskRun("run_upgrade");
|
||||||
|
|
||||||
|
CLI::taskName('unify-database');
|
||||||
|
CLI::taskDescription(<<<EOT
|
||||||
|
Unify Rbac, Reports and Workflow databases schemas to match the latest version
|
||||||
|
|
||||||
|
Specify the workspaces whose databases schemas should be unifyied.
|
||||||
|
If no workspace is specified, then the database schema will be upgraded or
|
||||||
|
repaired on all available workspaces.
|
||||||
|
|
||||||
|
This command will read the system schema and attempt to modify the workspaces
|
||||||
|
tables to match this new schema. Use this command to unify databases
|
||||||
|
schemas or before ProcessMaker has been upgraded, so the database schemas will
|
||||||
|
changed to match the new ProcessMaker code.
|
||||||
|
EOT
|
||||||
|
);
|
||||||
|
CLI::taskArg('workspace');
|
||||||
|
Add a comment to this line
|
||||||
|
CLI::taskRun("run_unify_database");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A version of rm_dir which does not exits on error.
|
* A version of rm_dir which does not exits on error.
|
||||||
*
|
*
|
||||||
@@ -239,3 +259,98 @@ function listFiles($dir) {
|
|||||||
}
|
}
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function run_unify_database($args)
|
||||||
|
{
|
||||||
|
$workspaces = get_workspaces_from_args($args);
|
||||||
|
|
||||||
|
CLI::logging("UPGRADE", PROCESSMAKER_PATH . "upgrade.log");
|
||||||
|
CLI::logging("Checking workspaces...\n");
|
||||||
|
//setting flag to true to check into sysGeneric.php
|
||||||
|
$flag = G::isPMUnderUpdating(0);
|
||||||
|
|
||||||
|
//start to unify
|
||||||
|
$count = count($workspaces);
|
||||||
|
|
||||||
|
if ($count > 1) {
|
||||||
|
if(!Bootstrap::isLinuxOs()){
|
||||||
|
CLI::error("This is not a Linux enviroment, please especify workspace.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($workspaces as $workspace) {
|
||||||
|
|
||||||
|
if (! $workspace->workspaceExists()) {
|
||||||
|
echo "Workspace {$workspace->name} not found\n";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ws = $workspace->name;
|
||||||
|
$sContent = file_get_contents (PATH_DB . $ws . PATH_SEP . 'db.php');
|
||||||
|
|
||||||
|
if (strpos($sContent, 'rb_')) {
|
||||||
|
$workspace->onedb = false;
|
||||||
|
} else {
|
||||||
|
$workspace->onedb = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = true;
|
||||||
|
$errors = false;
|
||||||
|
$countWorkspace = 0;
|
||||||
|
$buildCacheView = array_key_exists("buildACV", $args);
|
||||||
|
|
||||||
|
foreach ($workspaces as $workspace) {
|
||||||
|
try {
|
||||||
|
$countWorkspace++;
|
||||||
|
|
||||||
|
if ($workspace->onedb) {
|
||||||
|
CLI::logging("Workspace $workspace->name already one Database...\n");
|
||||||
|
} else {
|
||||||
|
//create destination path
|
||||||
|
$parentDirectory = PATH_DATA . "upgrade";
|
||||||
|
if (! file_exists( $parentDirectory )) {
|
||||||
|
mkdir( $parentDirectory );
|
||||||
|
}
|
||||||
|
$tempDirectory = $parentDirectory . basename(tempnam(__FILE__, ''));
|
||||||
|
if (is_writable( $parentDirectory )) {
|
||||||
|
mkdir( $tempDirectory );
|
||||||
|
} else {
|
||||||
|
throw new Exception( "Could not create directory:" . $parentDirectory );
|
||||||
|
}
|
||||||
|
$metadata = $workspace->getMetadata();
|
||||||
|
CLI::logging( "Exporting rb and rp databases to a temporal location...\n" );
|
||||||
|
$metadata["databases"] = $workspace->exportDatabase( $tempDirectory,true );
|
||||||
|
$metadata["version"] = 1;
|
||||||
|
|
||||||
|
list ($dbHost, $dbUser, $dbPass) = @explode( SYSTEM_HASH, G::decrypt( HASH_INSTALLATION, SYSTEM_HASH ) );
|
||||||
|
$link = mysql_connect( $dbHost, $dbUser, $dbPass );
|
||||||
|
|
||||||
|
foreach ($metadata->databases as $db) {
|
||||||
|
$dbName = 'wf_'.$workspace->name;
|
||||||
|
CLI::logging( "+> Restoring {$db->name} to $dbName database\n" );
|
||||||
|
$restore = $workspace->executeSQLScript( $dbName, "$tempDirectory/{$db->name}.sql" );
|
||||||
|
|
||||||
|
CLI::logging( "+> Remove {$db->name} database\n" );
|
||||||
|
|
||||||
|
$sql = "DROP DATABASE IF EXISTS {$db->name};";
|
||||||
|
if (! @mysql_query( $sql )) {
|
||||||
|
throw new Exception( mysql_error() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CLI::logging( "Removing temporary files\n" );
|
||||||
|
G::rm_dir( $tempDirectory );
|
||||||
|
|
||||||
|
$newDBNames = $workspace->resetDBInfo( $dbHost, true );
|
||||||
|
|
||||||
|
CLI::logging( CLI::info( "Done restoring databases" ) . "\n" );
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
CLI::logging("Errors upgrading workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
|
||||||
|
$errors = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$flag = G::isPMUnderUpdating(0);
|
||||||
|
}
|
||||||
@@ -814,6 +814,25 @@ class System
|
|||||||
return $aSchema;
|
return $aSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns tables name without prefix RBAC
|
||||||
|
*
|
||||||
|
* @param array $aOldSchema original schema array
|
||||||
|
* @return array with tablesToRename
|
||||||
|
*/
|
||||||
|
public static function verifyRbacSchema ($aOldSchema)
|
||||||
|
{
|
||||||
|
$aChanges = array ();
|
||||||
|
|
||||||
|
foreach ($aOldSchema as $sTableName => $aColumns) {
|
||||||
|
if(substr($sTableName, 0,4) != 'RBAC') {
|
||||||
|
$aChanges[] = $sTableName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $aChanges;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the difference between two schema arrays
|
* Returns the difference between two schema arrays
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ class workspaceTools
|
|||||||
*
|
*
|
||||||
* @param bool $first true if this is the first workspace to be upgrade
|
* @param bool $first true if this is the first workspace to be upgrade
|
||||||
*/
|
*/
|
||||||
public function upgrade($first = false, $buildCacheView = false, $workSpace = SYS_SYS, $lang = 'en')
|
public function upgrade($first = false, $buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en')
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
CLI::logging("> Updating database...\n");
|
CLI::logging("> Updating database...\n");
|
||||||
$this->upgradeDatabase();
|
$this->upgradeDatabase($onedb);
|
||||||
$stop = microtime(true);
|
$stop = microtime(true);
|
||||||
$final = $stop - $start;
|
$final = $stop - $start;
|
||||||
CLI::logging("<*> Database Upgrade Process took $final seconds.\n");
|
CLI::logging("<*> Database Upgrade Process took $final seconds.\n");
|
||||||
@@ -164,9 +164,17 @@ class workspaceTools
|
|||||||
* $matches will contain several groups:
|
* $matches will contain several groups:
|
||||||
* ((define('(<key>)2', ')1 (<value>)3 (');)4 )0
|
* ((define('(<key>)2', ')1 (<value>)3 (');)4 )0
|
||||||
*/
|
*/
|
||||||
$dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'rb_', 'DB_RBAC_USER' => 'rb_', 'DB_REPORT_NAME' => 'rp_', 'DB_REPORT_USER' => 'rp_');
|
$dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'wf_', 'DB_RBAC_USER' => 'wf_', 'DB_REPORT_NAME' => 'wf_', 'DB_REPORT_USER' => 'wf_');
|
||||||
$key = isset($matches['key']) ? $matches['key'] : $matches[2];
|
$key = isset($matches['key']) ? $matches['key'] : $matches[2];
|
||||||
$value = isset($matches['value']) ? $matches['value'] : $matches[3];
|
$value = isset($matches['value']) ? $matches['value'] : $matches[3];
|
||||||
|
|
||||||
|
if (!$this->onedb) {
|
||||||
|
if (array_search($key, array('DB_PASS', 'DB_RBAC_PASS', 'DB_REPORT_PASS'))) {
|
||||||
|
$value = $this->dbInfo['DB_PASS'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (array_search($key, array('DB_HOST', 'DB_RBAC_HOST', 'DB_REPORT_HOST')) !== false) {
|
if (array_search($key, array('DB_HOST', 'DB_RBAC_HOST', 'DB_REPORT_HOST')) !== false) {
|
||||||
/* Change the database hostname for these keys */
|
/* Change the database hostname for these keys */
|
||||||
$value = $this->newHost;
|
$value = $this->newHost;
|
||||||
@@ -674,7 +682,7 @@ class workspaceTools
|
|||||||
* @param bool $checkOnly only check if the upgrade is needed if true
|
* @param bool $checkOnly only check if the upgrade is needed if true
|
||||||
* @return array bool upgradeSchema for more information
|
* @return array bool upgradeSchema for more information
|
||||||
*/
|
*/
|
||||||
public function upgradeDatabase ($checkOnly = false)
|
public function upgradeDatabase ($onedb = false, $checkOnly = false)
|
||||||
{
|
{
|
||||||
G::LoadClass("patch");
|
G::LoadClass("patch");
|
||||||
$this->initPropel( true );
|
$this->initPropel( true );
|
||||||
@@ -682,7 +690,7 @@ class workspaceTools
|
|||||||
$systemSchema = System::getSystemSchema();
|
$systemSchema = System::getSystemSchema();
|
||||||
$systemSchemaRbac = System::getSystemSchemaRbac();// obtiene el Schema de Rbac
|
$systemSchemaRbac = System::getSystemSchemaRbac();// obtiene el Schema de Rbac
|
||||||
$this->upgradeSchema( $systemSchema );
|
$this->upgradeSchema( $systemSchema );
|
||||||
$this->upgradeSchema( $systemSchemaRbac, false, true );// Hace Upgrade de Rbac
|
$this->upgradeSchema( $systemSchemaRbac, false, true, $onedb ); // Hace Upgrade de Rbac
|
||||||
$this->upgradeData();
|
$this->upgradeData();
|
||||||
p11835::execute();
|
p11835::execute();
|
||||||
return true;
|
return true;
|
||||||
@@ -696,7 +704,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, $rbac = false)
|
public function upgradeSchema($schema, $checkOnly = false, $rbac = false, $onedb = false)
|
||||||
{
|
{
|
||||||
$dbInfo = $this->getDBInfo();
|
$dbInfo = $this->getDBInfo();
|
||||||
|
|
||||||
@@ -706,6 +714,19 @@ class workspaceTools
|
|||||||
|
|
||||||
$workspaceSchema = $this->getSchema($rbac);
|
$workspaceSchema = $this->getSchema($rbac);
|
||||||
|
|
||||||
|
$oDataBase = $this->getDatabase($rbac);
|
||||||
|
|
||||||
|
if (!$onedb) {
|
||||||
|
if($rbac){
|
||||||
|
$rename = System::verifyRbacSchema($workspaceSchema);
|
||||||
|
if (count($rename) > 0) {
|
||||||
|
foreach ($rename as $tableName) {
|
||||||
|
$oDataBase->executeQuery($oDataBase->generateRenameTableSQL($tableName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$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);
|
||||||
@@ -719,8 +740,6 @@ class workspaceTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDataBase = $this->getDatabase($rbac);
|
|
||||||
|
|
||||||
$oDataBase->iFetchType = MYSQL_NUM;
|
$oDataBase->iFetchType = MYSQL_NUM;
|
||||||
|
|
||||||
$oDataBase->logQuery(count($changes));
|
$oDataBase->logQuery(count($changes));
|
||||||
@@ -913,8 +932,6 @@ class workspaceTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
$wfDsn = $fields['DB_ADAPTER'] . '://' . $fields['DB_USER'] . ':' . $fields['DB_PASS'] . '@' . $fields['DB_HOST'] . '/' . $fields['DB_NAME'];
|
$wfDsn = $fields['DB_ADAPTER'] . '://' . $fields['DB_USER'] . ':' . $fields['DB_PASS'] . '@' . $fields['DB_HOST'] . '/' . $fields['DB_NAME'];
|
||||||
$rbDsn = $fields['DB_ADAPTER'] . '://' . $fields['DB_RBAC_USER'] . ':' . $fields['DB_RBAC_PASS'] . '@' . $fields['DB_RBAC_HOST'] . '/' . $fields['DB_RBAC_NAME'];
|
|
||||||
$rpDsn = $fields['DB_ADAPTER'] . '://' . $fields['DB_REPORT_USER'] . ':' . $fields['DB_REPORT_PASS'] . '@' . $fields['DB_REPORT_HOST'] . '/' . $fields['DB_REPORT_NAME'];
|
|
||||||
|
|
||||||
$info = array('Workspace Name' => $fields['WORKSPACE_NAME'],
|
$info = array('Workspace Name' => $fields['WORKSPACE_NAME'],
|
||||||
//'Available Databases' => $fields['AVAILABLE_DB'],
|
//'Available Databases' => $fields['AVAILABLE_DB'],
|
||||||
@@ -951,10 +968,16 @@ class workspaceTools
|
|||||||
*
|
*
|
||||||
* @param string $path the directory where to create the sql files
|
* @param string $path the directory where to create the sql files
|
||||||
*/
|
*/
|
||||||
public function exportDatabase($path)
|
public function exportDatabase($path, $onedb = false)
|
||||||
{
|
{
|
||||||
$dbInfo = $this->getDBInfo();
|
$dbInfo = $this->getDBInfo();
|
||||||
|
|
||||||
|
if ($onedb) {
|
||||||
|
$databases = array("rb", "rp");
|
||||||
|
} else {
|
||||||
$databases = array("wf", "rp", "rb");
|
$databases = array("wf", "rp", "rb");
|
||||||
|
}
|
||||||
|
|
||||||
$dbNames = array();
|
$dbNames = array();
|
||||||
foreach ($databases as $db) {
|
foreach ($databases as $db) {
|
||||||
$dbInfo = $this->getDBCredentials($db);
|
$dbInfo = $this->getDBCredentials($db);
|
||||||
|
|||||||
@@ -631,8 +631,8 @@ class Installer extends Controller
|
|||||||
$db_username = trim( $_REQUEST['db_username'] );
|
$db_username = trim( $_REQUEST['db_username'] );
|
||||||
$db_password = trim( $_REQUEST['db_password'] );
|
$db_password = trim( $_REQUEST['db_password'] );
|
||||||
$wf = trim( $_REQUEST['wfDatabase'] );
|
$wf = trim( $_REQUEST['wfDatabase'] );
|
||||||
$rb = trim( $_REQUEST['rbDatabase'] );
|
$rb = trim( $_REQUEST['wfDatabase'] );
|
||||||
$rp = trim( $_REQUEST['rpDatabase'] );
|
$rp = trim( $_REQUEST['wfDatabase'] );
|
||||||
$workspace = trim( $_REQUEST['workspace'] );
|
$workspace = trim( $_REQUEST['workspace'] );
|
||||||
$pathConfig = trim( $_REQUEST['pathConfig'] );
|
$pathConfig = trim( $_REQUEST['pathConfig'] );
|
||||||
$pathLanguages = trim( $_REQUEST['pathLanguages'] );
|
$pathLanguages = trim( $_REQUEST['pathLanguages'] );
|
||||||
@@ -659,35 +659,21 @@ class Installer extends Controller
|
|||||||
if ($deleteDB) {
|
if ($deleteDB) {
|
||||||
$q = sprintf( 'DROP DATABASE IF EXISTS %s;', $wf, $wf );
|
$q = sprintf( 'DROP DATABASE IF EXISTS %s;', $wf, $wf );
|
||||||
$this->mysqlQuery( $q );
|
$this->mysqlQuery( $q );
|
||||||
|
|
||||||
$q = sprintf( 'DROP DATABASE IF EXISTS %s;', $rb, $rb );
|
|
||||||
$this->mysqlQuery( $q );
|
|
||||||
|
|
||||||
$q = sprintf( 'DROP DATABASE IF EXISTS %s;', $rp, $rp );
|
|
||||||
$this->mysqlQuery( $q );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CREATE databases wf_workflow, rb_workflow and rp_workflow
|
// CREATE databases wf_workflow, rb_workflow and rp_workflow
|
||||||
$q = sprintf( 'CREATE DATABASE IF NOT EXISTS %s;', $wf, $wf );
|
$q = sprintf( 'CREATE DATABASE IF NOT EXISTS %s;', $wf, $wf );
|
||||||
$this->mysqlQuery( $q );
|
$this->mysqlQuery( $q );
|
||||||
|
|
||||||
$q = sprintf( 'CREATE DATABASE IF NOT EXISTS %s;', $rb, $rb );
|
|
||||||
$this->mysqlQuery( $q );
|
|
||||||
|
|
||||||
$q = sprintf( 'CREATE DATABASE IF NOT EXISTS %s;', $rp, $rp );
|
|
||||||
$this->mysqlQuery( $q );
|
|
||||||
|
|
||||||
// CREATE users and GRANT Privileges
|
// CREATE users and GRANT Privileges
|
||||||
$wf_workpace = $wf;
|
$wf_workpace = $wf;
|
||||||
$rb_workpace = $rb;
|
$rb_workpace = $wf;
|
||||||
$rp_workpace = $rp;
|
$rp_workpace = $wf;
|
||||||
if (!$userLogged) {
|
if (!$userLogged) {
|
||||||
$wfPass = G::generate_password( 12 );
|
$wfPass = G::generate_password( 12 );
|
||||||
$rbPass = G::generate_password( 12 );
|
|
||||||
$rpPass = G::generate_password( 12 );
|
|
||||||
$this->setGrantPrivilegesMySQL( $wf, $wfPass, $wf, $db_hostname );
|
$this->setGrantPrivilegesMySQL( $wf, $wfPass, $wf, $db_hostname );
|
||||||
$this->setGrantPrivilegesMySQL( $rb, $rbPass, $rb, $db_hostname );
|
$this->setGrantPrivilegesMySQL( $rb, $wfPass, $wf, $db_hostname );
|
||||||
$this->setGrantPrivilegesMySQL( $rp, $rpPass, $rp, $db_hostname );
|
$this->setGrantPrivilegesMySQL( $rp, $wfPass, $wf, $db_hostname );
|
||||||
} else {
|
} else {
|
||||||
$wfPass = $db_password;
|
$wfPass = $db_password;
|
||||||
$rbPass = $db_password;
|
$rbPass = $db_password;
|
||||||
@@ -743,20 +729,20 @@ class Installer extends Controller
|
|||||||
$dbData .= sprintf( "\$dbUser = '%s';\n", $wf );
|
$dbData .= sprintf( "\$dbUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbPass = '%s';\n", $wfPass );
|
$dbData .= sprintf( "\$dbPass = '%s';\n", $wfPass );
|
||||||
$dbData .= sprintf( "\$dbRbacHost = '%s';\n", $db_host );
|
$dbData .= sprintf( "\$dbRbacHost = '%s';\n", $db_host );
|
||||||
$dbData .= sprintf( "\$dbRbacName = '%s';\n", $rb_workpace );
|
$dbData .= sprintf( "\$dbRbacName = '%s';\n", $wf_workpace );
|
||||||
$dbData .= sprintf( "\$dbRbacUser = '%s';\n", $rb );
|
$dbData .= sprintf( "\$dbRbacUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbRbacPass = '%s';\n", $rbPass );
|
$dbData .= sprintf( "\$dbRbacPass = '%s';\n", $wfPass );
|
||||||
$dbData .= sprintf( "\$dbReportHost = '%s';\n", $db_host );
|
$dbData .= sprintf( "\$dbReportHost = '%s';\n", $db_host );
|
||||||
$dbData .= sprintf( "\$dbReportName = '%s';\n", $rp_workpace );
|
$dbData .= sprintf( "\$dbReportName = '%s';\n", $wf_workpace );
|
||||||
$dbData .= sprintf( "\$dbReportUser = '%s';\n", $rp );
|
$dbData .= sprintf( "\$dbReportUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbReportPass = '%s';\n", $rpPass );
|
$dbData .= sprintf( "\$dbReportPass = '%s';\n", $wfPass );
|
||||||
$databasesText = str_replace( '{dbData}', $dbData, @file_get_contents( PATH_HOME . 'engine/templates/installer/databases.tpl' ) );
|
$databasesText = str_replace( '{dbData}', $dbData, @file_get_contents( PATH_HOME . 'engine/templates/installer/databases.tpl' ) );
|
||||||
|
|
||||||
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($databases_file) ));
|
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($databases_file) ));
|
||||||
file_put_contents( $databases_file, $databasesText );
|
file_put_contents( $databases_file, $databasesText );
|
||||||
|
|
||||||
// Execute scripts to create and populates databases
|
// Execute scripts to create and populates databases
|
||||||
$query = sprintf( "USE %s;", $rb_workpace );
|
$query = sprintf( "USE %s;", $wf_workpace );
|
||||||
$this->mysqlQuery( $query );
|
$this->mysqlQuery( $query );
|
||||||
|
|
||||||
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/schema.sql' );
|
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/schema.sql' );
|
||||||
@@ -802,7 +788,7 @@ class Installer extends Controller
|
|||||||
$query = sprintf( "USE %s;", $rb_workpace );
|
$query = sprintf( "USE %s;", $rb_workpace );
|
||||||
$this->mysqlQuery( $query );
|
$this->mysqlQuery( $query );
|
||||||
|
|
||||||
$query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
$query = sprintf( "UPDATE RBAC_USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
||||||
$this->mysqlQuery( $query );
|
$this->mysqlQuery( $query );
|
||||||
|
|
||||||
// Write the paths_installed.php file (contains all the information configured so far)
|
// Write the paths_installed.php file (contains all the information configured so far)
|
||||||
@@ -958,8 +944,8 @@ class Installer extends Controller
|
|||||||
$db_username = trim( $_REQUEST['db_username'] );
|
$db_username = trim( $_REQUEST['db_username'] );
|
||||||
$db_password = trim( $_REQUEST['db_password'] );
|
$db_password = trim( $_REQUEST['db_password'] );
|
||||||
$wf = trim( $_REQUEST['wfDatabase'] );
|
$wf = trim( $_REQUEST['wfDatabase'] );
|
||||||
$rb = trim( $_REQUEST['rbDatabase'] );
|
$rb = trim( $_REQUEST['wfDatabase'] );
|
||||||
$rp = trim( $_REQUEST['rpDatabase'] );
|
$rp = trim( $_REQUEST['wfDatabase'] );
|
||||||
$workspace = trim( $_REQUEST['workspace'] );
|
$workspace = trim( $_REQUEST['workspace'] );
|
||||||
$pathConfig = trim( $_REQUEST['pathConfig'] );
|
$pathConfig = trim( $_REQUEST['pathConfig'] );
|
||||||
$pathLanguages = trim( $_REQUEST['pathLanguages'] );
|
$pathLanguages = trim( $_REQUEST['pathLanguages'] );
|
||||||
@@ -988,31 +974,15 @@ class Installer extends Controller
|
|||||||
if ($deleteDB) {
|
if ($deleteDB) {
|
||||||
$q = sprintf( "IF EXISTS (SELECT name FROM sys.databases WHERE name='%s' ) DROP DATABASE %s", $wf, $wf );
|
$q = sprintf( "IF EXISTS (SELECT name FROM sys.databases WHERE name='%s' ) DROP DATABASE %s", $wf, $wf );
|
||||||
$this->mssqlQuery( $q );
|
$this->mssqlQuery( $q );
|
||||||
|
|
||||||
$q = sprintf( "IF EXISTS (SELECT name FROM sys.databases WHERE name='%s' ) DROP DATABASE %s", $rb, $rb );
|
|
||||||
$this->mssqlQuery( $q );
|
|
||||||
|
|
||||||
$q = sprintf( "IF EXISTS (SELECT name FROM sys.databases WHERE name='%s' ) DROP DATABASE %s", $rp, $rp );
|
|
||||||
$this->mssqlQuery( $q );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CREATE databases wf_workflow, rb_workflow and rp_workflow
|
// CREATE databases wf_workflow, rb_workflow and rp_workflow
|
||||||
$q = sprintf( "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name='%s' ) CREATE DATABASE %s", $wf, $wf );
|
$q = sprintf( "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name='%s' ) CREATE DATABASE %s", $wf, $wf );
|
||||||
$this->mssqlQuery( $q );
|
$this->mssqlQuery( $q );
|
||||||
|
|
||||||
$q = sprintf( "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name='%s' ) CREATE DATABASE %s", $rb, $rb );
|
|
||||||
$this->mssqlQuery( $q );
|
|
||||||
|
|
||||||
$q = sprintf( "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name='%s' ) CREATE DATABASE %s", $rp, $rp );
|
|
||||||
$this->mssqlQuery( $q );
|
|
||||||
|
|
||||||
//CREATE users and GRANT Privileges
|
//CREATE users and GRANT Privileges
|
||||||
$wfPass = G::generate_password( 12 );
|
$wfPass = G::generate_password( 12 );
|
||||||
$rbPass = G::generate_password( 12 );
|
|
||||||
$rpPass = G::generate_password( 12 );
|
|
||||||
$this->setGrantPrivilegesMSSQL( $wf, $wfPass, $wf );
|
$this->setGrantPrivilegesMSSQL( $wf, $wfPass, $wf );
|
||||||
$this->setGrantPrivilegesMSSQL( $rb, $rbPass, $rb );
|
|
||||||
$this->setGrantPrivilegesMSSQL( $rp, $rpPass, $rp );
|
|
||||||
|
|
||||||
//Generate the db.php file and folders
|
//Generate the db.php file and folders
|
||||||
$path_site = $pathShared . "/sites/" . $workspace . "/";
|
$path_site = $pathShared . "/sites/" . $workspace . "/";
|
||||||
@@ -1032,13 +1002,13 @@ class Installer extends Controller
|
|||||||
$dbText .= sprintf( " define ('DB_USER', '%s' );\n", $wf );
|
$dbText .= sprintf( " define ('DB_USER', '%s' );\n", $wf );
|
||||||
$dbText .= sprintf( " define ('DB_PASS', '%s' );\n", $wfPass );
|
$dbText .= sprintf( " define ('DB_PASS', '%s' );\n", $wfPass );
|
||||||
$dbText .= sprintf( " define ('DB_RBAC_HOST', '%s' );\n", $db_host );
|
$dbText .= sprintf( " define ('DB_RBAC_HOST', '%s' );\n", $db_host );
|
||||||
$dbText .= sprintf( " define ('DB_RBAC_NAME', '%s' );\n", $rb );
|
$dbText .= sprintf( " define ('DB_RBAC_NAME', '%s' );\n", $wf );
|
||||||
$dbText .= sprintf( " define ('DB_RBAC_USER', '%s' );\n", $rb );
|
$dbText .= sprintf( " define ('DB_RBAC_USER', '%s' );\n", $wf );
|
||||||
$dbText .= sprintf( " define ('DB_RBAC_PASS', '%s' );\n", $rbPass );
|
$dbText .= sprintf( " define ('DB_RBAC_PASS', '%s' );\n", $wfPass );
|
||||||
$dbText .= sprintf( " define ('DB_REPORT_HOST', '%s' );\n", $db_host );
|
$dbText .= sprintf( " define ('DB_REPORT_HOST', '%s' );\n", $db_host );
|
||||||
$dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp );
|
$dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $wf );
|
||||||
$dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp );
|
$dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $wf );
|
||||||
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass );
|
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $wfPass );
|
||||||
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
||||||
$dbText .= "\n";
|
$dbText .= "\n";
|
||||||
$dbText .= " define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n";
|
$dbText .= " define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n";
|
||||||
@@ -1058,20 +1028,20 @@ class Installer extends Controller
|
|||||||
$dbData .= sprintf( "\$dbUser = '%s';\n", $wf );
|
$dbData .= sprintf( "\$dbUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbPass = '%s';\n", $wfPass );
|
$dbData .= sprintf( "\$dbPass = '%s';\n", $wfPass );
|
||||||
$dbData .= sprintf( "\$dbRbacHost = '%s';\n", $db_host );
|
$dbData .= sprintf( "\$dbRbacHost = '%s';\n", $db_host );
|
||||||
$dbData .= sprintf( "\$dbRbacName = '%s';\n", $rb );
|
$dbData .= sprintf( "\$dbRbacName = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbRbacUser = '%s';\n", $rb );
|
$dbData .= sprintf( "\$dbRbacUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbRbacPass = '%s';\n", $rbPass );
|
$dbData .= sprintf( "\$dbRbacPass = '%s';\n", $wfPass );
|
||||||
$dbData .= sprintf( "\$dbReportHost = '%s';\n", $db_host );
|
$dbData .= sprintf( "\$dbReportHost = '%s';\n", $db_host );
|
||||||
$dbData .= sprintf( "\$dbReportName = '%s';\n", $rp );
|
$dbData .= sprintf( "\$dbReportName = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbReportUser = '%s';\n", $rp );
|
$dbData .= sprintf( "\$dbReportUser = '%s';\n", $wf );
|
||||||
$dbData .= sprintf( "\$dbReportPass = '%s';\n", $rpPass );
|
$dbData .= sprintf( "\$dbReportPass = '%s';\n", $wfPass );
|
||||||
$databasesText = str_replace( '{dbData}', $dbData, @file_get_contents( PATH_HOME . 'engine/templates/installer/databases.tpl' ) );
|
$databasesText = str_replace( '{dbData}', $dbData, @file_get_contents( PATH_HOME . 'engine/templates/installer/databases.tpl' ) );
|
||||||
|
|
||||||
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($databases_file) ));
|
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($databases_file) ));
|
||||||
file_put_contents( $databases_file, $databasesText );
|
file_put_contents( $databases_file, $databasesText );
|
||||||
|
|
||||||
//execute scripts to create and populates databases
|
//execute scripts to create and populates databases
|
||||||
$query = sprintf( "USE %s;", $rb );
|
$query = sprintf( "USE %s;", $wf );
|
||||||
$this->mssqlQuery( $query );
|
$this->mssqlQuery( $query );
|
||||||
|
|
||||||
$this->mssqlFileQuery( PATH_RBAC_HOME . 'engine/data/mssql/schema.sql' );
|
$this->mssqlFileQuery( PATH_RBAC_HOME . 'engine/data/mssql/schema.sql' );
|
||||||
@@ -1108,10 +1078,10 @@ class Installer extends Controller
|
|||||||
$query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
$query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
||||||
$this->mssqlQuery( $query );
|
$this->mssqlQuery( $query );
|
||||||
|
|
||||||
$query = sprintf( "USE %s;", $rb );
|
$query = sprintf( "USE %s;", $wf );
|
||||||
$this->mssqlQuery( $query );
|
$this->mssqlQuery( $query );
|
||||||
|
|
||||||
$query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
$query = sprintf( "UPDATE RBAC_USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) );
|
||||||
$this->mssqlQuery( $query );
|
$this->mssqlQuery( $query );
|
||||||
|
|
||||||
// Write the paths_installed.php file (contains all the information configured so far)
|
// Write the paths_installed.php file (contains all the information configured so far)
|
||||||
@@ -1185,18 +1155,10 @@ class Installer extends Controller
|
|||||||
$link = @mysql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
$link = @mysql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
||||||
$dataset = @mysql_query( "show databases like '" . $_REQUEST['wfDatabase'] . "'", $link );
|
$dataset = @mysql_query( "show databases like '" . $_REQUEST['wfDatabase'] . "'", $link );
|
||||||
$info->wfDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
$info->wfDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
||||||
$dataset = @mysql_query( "show databases like '" . $_REQUEST['rbDatabase'] . "'", $link );
|
|
||||||
$info->rbDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
|
||||||
$dataset = @mysql_query( "show databases like '" . $_REQUEST['rpDatabase'] . "'", $link );
|
|
||||||
$info->rpDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
|
||||||
} else {
|
} else {
|
||||||
$link = @mssql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
$link = @mssql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
||||||
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['wfDatabase'] . "'", $link );
|
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['wfDatabase'] . "'", $link );
|
||||||
$info->wfDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
$info->wfDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
||||||
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['rbDatabase'] . "'", $link );
|
|
||||||
$info->rbDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
|
||||||
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['rpDatabase'] . "'", $link );
|
|
||||||
$info->rpDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$info->errMessage = G::LoadTranslation('ID_DATABASE_EXISTS_OVERWRITE');
|
$info->errMessage = G::LoadTranslation('ID_DATABASE_EXISTS_OVERWRITE');
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ if (isset( $_POST['form']['NW_TITLE'] )) {
|
|||||||
$ao_db_drop = (isset( $_POST['form']['AO_DB_DROP'] )) ? true : false;
|
$ao_db_drop = (isset( $_POST['form']['AO_DB_DROP'] )) ? true : false;
|
||||||
|
|
||||||
$ao_db_wf = (isset( $_POST['form']['AO_DB_WF'] )) ? $_POST['form']['AO_DB_WF'] : false;
|
$ao_db_wf = (isset( $_POST['form']['AO_DB_WF'] )) ? $_POST['form']['AO_DB_WF'] : false;
|
||||||
$ao_db_rb = (isset( $_POST['form']['AO_DB_RB'] )) ? $_POST['form']['AO_DB_RB'] : false;
|
$ao_db_rb = (isset( $_POST['form']['AO_DB_WF'] )) ? $_POST['form']['AO_DB_WF'] : false;
|
||||||
$ao_db_rp = (isset( $_POST['form']['AO_DB_RP'] )) ? $_POST['form']['AO_DB_RP'] : false;
|
$ao_db_rp = (isset( $_POST['form']['AO_DB_WF'] )) ? $_POST['form']['AO_DB_WF'] : false;
|
||||||
|
|
||||||
$result = $inst->create_site( Array ('isset' => true,'name' => $name,'admin' => Array ('username' => $user,'password' => $pass
|
$result = $inst->create_site( Array ('isset' => true,'name' => $name,'admin' => Array ('username' => $user,'password' => $pass
|
||||||
),'advanced' => Array ('ao_db_drop' => $ao_db_drop,'ao_db_wf' => $ao_db_wf,'ao_db_rb' => $ao_db_rb,'ao_db_rp' => $ao_db_rp
|
),'advanced' => Array ('ao_db_drop' => $ao_db_drop,'ao_db_wf' => $ao_db_wf,'ao_db_rb' => $ao_db_rb,'ao_db_rp' => $ao_db_rp
|
||||||
|
|||||||
@@ -192,16 +192,6 @@ Ext.onReady(function(){
|
|||||||
wizard.onClientValidation(4, false);
|
wizard.onClientValidation(4, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Ext.getCmp('rbDatabase').isValid()) {
|
|
||||||
Ext.getCmp('finish_message').setValue(getFieldOutput(_('ID_RBAC_DATABASE_NAME'), false));
|
|
||||||
wizard.onClientValidation(4, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!Ext.getCmp('rpDatabase').isValid()) {
|
|
||||||
Ext.getCmp('finish_message').setValue(getFieldOutput(_('ID_REPORT_DATABASE_NAME'), false));
|
|
||||||
wizard.onClientValidation(4, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
checkDatabases();
|
checkDatabases();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,10 +204,8 @@ Ext.onReady(function(){
|
|||||||
var noExistsMsg = '<span style="color: green;">' + _('ID_NO_EXIST') + '</span>';
|
var noExistsMsg = '<span style="color: green;">' + _('ID_NO_EXIST') + '</span>';
|
||||||
var response = Ext.util.JSON.decode(response.responseText);
|
var response = Ext.util.JSON.decode(response.responseText);
|
||||||
Ext.get('wfDatabaseSpan').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
|
Ext.get('wfDatabaseSpan').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
|
||||||
Ext.get('rbDatabaseSpan').dom.innerHTML = (response.rbDatabaseExists ? existMsg : noExistsMsg);
|
|
||||||
Ext.get('rpDatabaseSpan').dom.innerHTML = (response.rpDatabaseExists ? existMsg : noExistsMsg);
|
|
||||||
|
|
||||||
var dbFlag = ((!response.wfDatabaseExists && !response.rbDatabaseExists && !response.rpDatabaseExists) || Ext.getCmp('deleteDB').getValue());
|
var dbFlag = ((!response.wfDatabaseExists) || Ext.getCmp('deleteDB').getValue());
|
||||||
wizard.onClientValidation(4, dbFlag);
|
wizard.onClientValidation(4, dbFlag);
|
||||||
|
|
||||||
if (dbFlag) {
|
if (dbFlag) {
|
||||||
@@ -237,8 +225,6 @@ Ext.onReady(function(){
|
|||||||
'db_password': Ext.getCmp('db_password').getValue(),
|
'db_password': Ext.getCmp('db_password').getValue(),
|
||||||
'db_port' : Ext.getCmp('db_port').getValue(),
|
'db_port' : Ext.getCmp('db_port').getValue(),
|
||||||
'wfDatabase' : Ext.getCmp('wfDatabase').getValue(),
|
'wfDatabase' : Ext.getCmp('wfDatabase').getValue(),
|
||||||
'rbDatabase' : Ext.getCmp('rbDatabase').getValue(),
|
|
||||||
'rpDatabase' : Ext.getCmp('rpDatabase').getValue()
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -706,8 +692,6 @@ Ext.onReady(function(){
|
|||||||
wizard.onClientValidation(4, false);
|
wizard.onClientValidation(4, false);
|
||||||
if (!Ext.getCmp('changeDBNames').getValue()) {
|
if (!Ext.getCmp('changeDBNames').getValue()) {
|
||||||
Ext.getCmp('wfDatabase').setValue('wf_' + this.getValue());
|
Ext.getCmp('wfDatabase').setValue('wf_' + this.getValue());
|
||||||
Ext.getCmp('rbDatabase').setValue('rb_' + this.getValue());
|
|
||||||
Ext.getCmp('rpDatabase').setValue('rp_' + this.getValue());
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
},
|
},
|
||||||
@@ -762,19 +746,10 @@ Ext.onReady(function(){
|
|||||||
handler: function() {
|
handler: function() {
|
||||||
if (this.getValue()) {
|
if (this.getValue()) {
|
||||||
Ext.getCmp('wfDatabase').enable();
|
Ext.getCmp('wfDatabase').enable();
|
||||||
Ext.getCmp('rbDatabase').enable();
|
|
||||||
Ext.getCmp('rpDatabase').enable();
|
|
||||||
Ext.getCmp('wfDatabase').validate();
|
Ext.getCmp('wfDatabase').validate();
|
||||||
Ext.getCmp('rbDatabase').validate();
|
} else {
|
||||||
Ext.getCmp('rpDatabase').validate();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Ext.getCmp('wfDatabase').setValue('wf_' + Ext.getCmp('workspace').getValue());
|
Ext.getCmp('wfDatabase').setValue('wf_' + Ext.getCmp('workspace').getValue());
|
||||||
Ext.getCmp('rbDatabase').setValue('rb_' + Ext.getCmp('workspace').getValue());
|
|
||||||
Ext.getCmp('rpDatabase').setValue('rp_' + Ext.getCmp('workspace').getValue());
|
|
||||||
Ext.getCmp('wfDatabase').disable();
|
Ext.getCmp('wfDatabase').disable();
|
||||||
Ext.getCmp('rbDatabase').disable();
|
|
||||||
Ext.getCmp('rpDatabase').disable();
|
|
||||||
}
|
}
|
||||||
wizard.onClientValidation(4, false);
|
wizard.onClientValidation(4, false);
|
||||||
}
|
}
|
||||||
@@ -796,40 +771,6 @@ Ext.onReady(function(){
|
|||||||
wizard.onClientValidation(4, false);
|
wizard.onClientValidation(4, false);
|
||||||
}}
|
}}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
xtype : 'textfield',
|
|
||||||
fieldLabel: _('ID_RB_DATABASE_NAME') + ' <span id="rbDatabaseSpan"></span>',
|
|
||||||
id : 'rbDatabase',
|
|
||||||
value :'rb_workflow',
|
|
||||||
allowBlank : false,
|
|
||||||
maxLength: 32,
|
|
||||||
validator : function(v){
|
|
||||||
var t = /^[a-zA-Z_0-9]+$/;
|
|
||||||
return t.test(v);
|
|
||||||
},
|
|
||||||
disabled: true,
|
|
||||||
enableKeyEvents: true,
|
|
||||||
listeners: {keyup: function() {
|
|
||||||
wizard.onClientValidation(4, false);
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
xtype : 'textfield',
|
|
||||||
fieldLabel: _('ID_RP_DATABASE_NAME') + ' <span id="rpDatabaseSpan"></span>',
|
|
||||||
id : 'rpDatabase',
|
|
||||||
value :'rp_workflow',
|
|
||||||
allowBlank : false,
|
|
||||||
maxLength: 32,
|
|
||||||
validator : function(v){
|
|
||||||
var t = /^[a-zA-Z_0-9]+$/;
|
|
||||||
return t.test(v);
|
|
||||||
},
|
|
||||||
disabled: true,
|
|
||||||
enableKeyEvents: true,
|
|
||||||
listeners: {keyup: function() {
|
|
||||||
wizard.onClientValidation(4, false);
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
new Ext.form.Checkbox({
|
new Ext.form.Checkbox({
|
||||||
boxLabel : _('ID_DELETE_DATABASES'),
|
boxLabel : _('ID_DELETE_DATABASES'),
|
||||||
id : 'deleteDB',
|
id : 'deleteDB',
|
||||||
|
|||||||
@@ -101,8 +101,6 @@ function finishInstallation()
|
|||||||
'adminUsername' : Ext.getCmp('adminUsername' ).getValue(),
|
'adminUsername' : Ext.getCmp('adminUsername' ).getValue(),
|
||||||
'adminPassword' : Ext.getCmp('adminPassword' ).getValue(),
|
'adminPassword' : Ext.getCmp('adminPassword' ).getValue(),
|
||||||
'wfDatabase' : Ext.getCmp('wfDatabase' ).getValue(),
|
'wfDatabase' : Ext.getCmp('wfDatabase' ).getValue(),
|
||||||
'rbDatabase' : Ext.getCmp('rbDatabase' ).getValue(),
|
|
||||||
'rpDatabase' : Ext.getCmp('rpDatabase' ).getValue(),
|
|
||||||
'deleteDB' : Ext.getCmp('deleteDB' ).getValue(),
|
'deleteDB' : Ext.getCmp('deleteDB' ).getValue(),
|
||||||
'userLogged' : Ext.getCmp('createUserLogged' ).getValue()
|
'userLogged' : Ext.getCmp('createUserLogged' ).getValue()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ Ext.onReady(function(){
|
|||||||
}}
|
}}
|
||||||
},
|
},
|
||||||
new Ext.form.Checkbox({
|
new Ext.form.Checkbox({
|
||||||
boxLabel: 'Delete Databases if exists',
|
boxLabel: 'Delete Database if exists',
|
||||||
id: 'deleteDB',
|
id: 'deleteDB',
|
||||||
handler: function() {
|
handler: function() {
|
||||||
wizard.onClientValidation(2, false);
|
wizard.onClientValidation(2, false);
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ Ext.onReady(function(){
|
|||||||
c.getEl().on('keyup', function() {
|
c.getEl().on('keyup', function() {
|
||||||
namews=formNewSite.getForm().findField('NW_TITLE').getValue();
|
namews=formNewSite.getForm().findField('NW_TITLE').getValue();
|
||||||
formNewSite.getForm().findField('AO_DB_WF').setValue('wf_'+namews);
|
formNewSite.getForm().findField('AO_DB_WF').setValue('wf_'+namews);
|
||||||
formNewSite.getForm().findField('AO_DB_RB').setValue('rb_'+namews);
|
formNewSite.getForm().findField('AO_DB_WF').setValue('wf_'+namews);
|
||||||
formNewSite.getForm().findField('AO_DB_RP').setValue('rp_'+namews);
|
formNewSite.getForm().findField('AO_DB_WF').setValue('wf_'+namews);
|
||||||
}, c);
|
}, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ Ext.onReady(function(){
|
|||||||
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '13'},
|
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '13'},
|
||||||
allowBlank: false
|
allowBlank: false
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
id: 'AO_DB_RB',
|
id: 'AO_DB_RB',
|
||||||
fieldLabel: _('ID_RBAC_DATABASE'),
|
fieldLabel: _('ID_RBAC_DATABASE'),
|
||||||
xtype:'textfield',
|
xtype:'textfield',
|
||||||
@@ -59,7 +59,7 @@ Ext.onReady(function(){
|
|||||||
width: 200,
|
width: 200,
|
||||||
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '13'},
|
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '13'},
|
||||||
allowBlank: false
|
allowBlank: false
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
xtype: 'checkbox',
|
xtype: 'checkbox',
|
||||||
fieldLabel: _('ID_DROP_DATABASE_EXISTS'),
|
fieldLabel: _('ID_DROP_DATABASE_EXISTS'),
|
||||||
@@ -156,8 +156,8 @@ Ext.onReady(function(){
|
|||||||
success: function(f,a){
|
success: function(f,a){
|
||||||
nwTitle =formNewSite.getForm().findField('NW_TITLE').getValue();
|
nwTitle =formNewSite.getForm().findField('NW_TITLE').getValue();
|
||||||
aoDbWf =formNewSite.getForm().findField('AO_DB_WF').getValue();
|
aoDbWf =formNewSite.getForm().findField('AO_DB_WF').getValue();
|
||||||
aoDbRb =formNewSite.getForm().findField('AO_DB_RB').getValue();
|
aoDbRb =aoDbWf;
|
||||||
aoDbRp =formNewSite.getForm().findField('AO_DB_RP').getValue();
|
aoDbRp =aoDbWf;
|
||||||
nwUsername =formNewSite.getForm().findField('NW_USERNAME').getValue();
|
nwUsername =formNewSite.getForm().findField('NW_USERNAME').getValue();
|
||||||
nwPassword =formNewSite.getForm().findField('NW_PASSWORD').getValue();
|
nwPassword =formNewSite.getForm().findField('NW_PASSWORD').getValue();
|
||||||
nwPassword2=formNewSite.getForm().findField('NW_PASSWORD2').getValue();
|
nwPassword2=formNewSite.getForm().findField('NW_PASSWORD2').getValue();
|
||||||
|
|||||||
Reference in New Issue
Block a user