CODE STYLE workflow/engine/methods/roles/
FILES: data_rolesList.php data_rolesPermissions.php data_rolesUsers.php rolesUsersPermission.php roles_AddUser.php roles_Ajax.php roles_List.php
This commit is contained in:
@@ -12,26 +12,25 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once (PATH_RBAC . "model/RolesPeer.php");
|
||||
G::LoadClass('ArrayPeer');
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
|
||||
isset($_POST['textFilter']) ? $filter = $_POST['textFilter'] : $filter = '';
|
||||
isset( $_POST['textFilter'] ) ? $filter = $_POST['textFilter'] : $filter = '';
|
||||
|
||||
if ($filter != ""){
|
||||
$aRoles = $RBAC->getAllRolesFilter($filter);
|
||||
}else{
|
||||
$aRoles = $RBAC->getAllRoles();
|
||||
if ($filter != "") {
|
||||
$aRoles = $RBAC->getAllRolesFilter( $filter );
|
||||
} else {
|
||||
$aRoles = $RBAC->getAllRoles();
|
||||
}
|
||||
|
||||
//$ocaux = $oAdditionalTables->getDataCriteria($_GET['sUID']);
|
||||
@@ -43,4 +42,5 @@ if ($filter != ""){
|
||||
//while($rs->next()){
|
||||
// $rows[] = $rs->getRow();
|
||||
//}
|
||||
echo '{roles: '.G::json_encode($aRoles).'}';
|
||||
echo '{roles: ' . G::json_encode( $aRoles ) . '}';
|
||||
|
||||
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$ROL_UID = $_GET['rUID'];
|
||||
@@ -28,18 +27,22 @@ $TYPE_DATA = $_GET["type"];
|
||||
|
||||
global $RBAC;
|
||||
|
||||
$filter = (isset($_REQUEST['textFilter']))? $_REQUEST['textFilter'] : '';
|
||||
$filter = (isset( $_REQUEST['textFilter'] )) ? $_REQUEST['textFilter'] : '';
|
||||
|
||||
//BUG 7554: erik/ hook for existents environments that have not PM_CANCELCASE
|
||||
if ($RBAC->permissionsObj->loadByCode('PM_CANCELCASE') === false) {
|
||||
$RBAC->permissionsObj->create(array('PER_CODE' => 'PM_CANCELCASE', 'PER_CREATE_DATE' => date('Y-m-d H:i:s')));
|
||||
if ($RBAC->permissionsObj->loadByCode( 'PM_CANCELCASE' ) === false) {
|
||||
$RBAC->permissionsObj->create( array ('PER_CODE' => 'PM_CANCELCASE','PER_CREATE_DATE' => date( 'Y-m-d H:i:s' )
|
||||
) );
|
||||
}
|
||||
|
||||
if ($TYPE_DATA=='list') $oDataset = $RBAC->getRolePermissions($ROL_UID, $filter, 1);
|
||||
if ($TYPE_DATA=='show') $oDataset = $RBAC->getAllPermissions($ROL_UID, $RBAC->sSystem, $filter, 1);
|
||||
if ($TYPE_DATA == 'list')
|
||||
$oDataset = $RBAC->getRolePermissions( $ROL_UID, $filter, 1 );
|
||||
if ($TYPE_DATA == 'show')
|
||||
$oDataset = $RBAC->getAllPermissions( $ROL_UID, $RBAC->sSystem, $filter, 1 );
|
||||
|
||||
$rows = Array();
|
||||
while($oDataset->next()){
|
||||
$rows[] = $oDataset->getRow();
|
||||
$rows = Array ();
|
||||
while ($oDataset->next()) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
}
|
||||
echo '{permissions: '.G::json_encode($rows).'}';
|
||||
echo '{permissions: ' . G::json_encode( $rows ) . '}';
|
||||
|
||||
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$ROL_UID = $_GET['rUID'];
|
||||
@@ -28,13 +27,16 @@ $TYPE_DATA = $_GET["type"];
|
||||
|
||||
global $RBAC;
|
||||
|
||||
$filter = (isset($_REQUEST['textFilter']))? $_REQUEST['textFilter'] : '';
|
||||
$filter = (isset( $_REQUEST['textFilter'] )) ? $_REQUEST['textFilter'] : '';
|
||||
|
||||
if ($TYPE_DATA=='list') $oDataset = $RBAC->getRoleUsers($ROL_UID, $filter);
|
||||
if ($TYPE_DATA=='show') $oDataset = $RBAC->getAllUsers($ROL_UID, $filter);
|
||||
if ($TYPE_DATA == 'list')
|
||||
$oDataset = $RBAC->getRoleUsers( $ROL_UID, $filter );
|
||||
if ($TYPE_DATA == 'show')
|
||||
$oDataset = $RBAC->getAllUsers( $ROL_UID, $filter );
|
||||
|
||||
$rows = Array();
|
||||
while($oDataset->next()){
|
||||
$rows[] = $oDataset->getRow();
|
||||
$rows = Array ();
|
||||
while ($oDataset->next()) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
}
|
||||
echo '{users: '.G::json_encode($rows).'}';
|
||||
echo '{users: ' . G::json_encode( $rows ) . '}';
|
||||
|
||||
|
||||
@@ -12,57 +12,54 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_USERS')) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -3:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
switch ($RBAC->userCanAccess( 'PM_USERS' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 3:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'ROLES';
|
||||
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript('roles/rolesUsersPermission', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('roles/rolesUsersPermission'); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript( 'roles/rolesUsersPermission', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'roles/rolesUsersPermission' ); //adding a html file .html.
|
||||
|
||||
|
||||
$roles = Array();
|
||||
$roles = Array ();
|
||||
$roles['ROL_UID'] = $_GET['rUID'];
|
||||
$roles['ROL_CODE'] = $RBAC->getRoleCode($_GET['rUID']);
|
||||
$roles['CURRENT_TAB'] = ($_GET['tab']=='permissions') ? 1 : 0;
|
||||
$roles['ROL_CODE'] = $RBAC->getRoleCode( $_GET['rUID'] );
|
||||
$roles['CURRENT_TAB'] = ($_GET['tab'] == 'permissions') ? 1 : 0;
|
||||
|
||||
$oHeadPublisher->assign( 'ROLES', $roles );
|
||||
$oHeadPublisher->assign( 'permissionsAdmin', $RBAC->loadPermissionAdmin() );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
$oHeadPublisher->assign('ROLES', $roles);
|
||||
$oHeadPublisher->assign('permissionsAdmin', $RBAC->loadPermissionAdmin());
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
?>
|
||||
@@ -1,35 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* roles_AddUser.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once ( 'classes/class.xmlfield_InputPM.php' );
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aData = Array('ROL_UID'=>$_GET['ROL_UID']);
|
||||
$G_PUBLISH->AddContent('propeltable', 'roles/paged-table', 'roles/roles_ListUsers', $oUser->getAvailableUsersCriteria($_GET['ROL_UID']),$aData);
|
||||
|
||||
G::RenderPage('publish', 'raw');
|
||||
die;
|
||||
<?php
|
||||
/**
|
||||
* roles_AddUser.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
require_once ('classes/class.xmlfield_InputPM.php');
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aData = Array ('ROL_UID' => $_GET['ROL_UID']
|
||||
);
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'roles/paged-table', 'roles/roles_ListUsers', $oUser->getAvailableUsersCriteria( $_GET['ROL_UID'] ), $aData );
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
die();
|
||||
|
||||
|
||||
@@ -12,344 +12,287 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$REQUEST = (isset($_GET['request']))?$_GET['request']:$_POST['request'];
|
||||
$REQUEST = (isset( $_GET['request'] )) ? $_GET['request'] : $_POST['request'];
|
||||
|
||||
switch ($REQUEST) {
|
||||
case 'newRole':
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'roles/roles_New', '', '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'saveNewRole':
|
||||
$newid = md5( $_POST['code'] . date( "d-M-Y_H:i:s" ) );
|
||||
$aData['ROL_UID'] = $newid;
|
||||
//$aData['ROL_PARENT'] = $_POST['parent'];
|
||||
$aData['ROL_SYSTEM'] = '00000000000000000000000000000002';
|
||||
$aData['ROL_CODE'] = trim( $_POST['code'] );
|
||||
$aData['ROL_NAME'] = $_POST['name'];
|
||||
$aData['ROL_CREATE_DATE'] = date( "Y-M-d H:i:s" );
|
||||
$aData['ROL_UPDATE_DATE'] = date( "Y-M-d H:i:s" );
|
||||
$aData['ROL_STATUS'] = $_POST['status'];
|
||||
$oCriteria = $RBAC->createRole( $aData );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'editRole':
|
||||
$ROL_UID = $_GET['ROL_UID'];
|
||||
$aFields = $RBAC->loadById( $ROL_UID );
|
||||
|
||||
case 'newRole':
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'roles/roles_New', '', '');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'roles/roles_Edit', '', $aFields );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'updateRole':
|
||||
$aData['ROL_UID'] = $_POST['rol_uid'];
|
||||
//$aData['ROL_PARENT'] = $_POST['parent'];
|
||||
$aData['ROL_CODE'] = trim( $_POST['code'] );
|
||||
$aData['ROL_NAME'] = $_POST['name'];
|
||||
$aData['ROL_UPDATE_DATE'] = date( "Y-M-d H:i:s" );
|
||||
$aData['ROL_STATUS'] = $_POST['status'];
|
||||
$oCriteria = $RBAC->updateRole( $aData );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'show':
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$aRoles = $RBAC->getAllRoles();
|
||||
|
||||
case 'saveNewRole':
|
||||
$newid = md5($_POST['code'].date("d-M-Y_H:i:s"));
|
||||
$aData['ROL_UID'] = $newid;
|
||||
//$aData['ROL_PARENT'] = $_POST['parent'];
|
||||
$aData['ROL_SYSTEM'] = '00000000000000000000000000000002';
|
||||
$aData['ROL_CODE'] = trim($_POST['code']);
|
||||
$aData['ROL_NAME'] = $_POST['name'];
|
||||
$aData['ROL_CREATE_DATE'] = date("Y-M-d H:i:s");
|
||||
$aData['ROL_UPDATE_DATE'] = date("Y-M-d H:i:s");
|
||||
$aData['ROL_STATUS'] = $_POST['status'];
|
||||
$oCriteria = $RBAC->createRole($aData);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
$fields = Array ('ROL_UID' => 'char','ROL_PARENT' => 'char','ROL_SYSTEM' => 'char','ROL_CREATE_DATE' => 'char','ROL_UPDATE_DATE' => 'char','ROL_STATUS' => 'char'
|
||||
);
|
||||
|
||||
case 'editRole':
|
||||
|
||||
$ROL_UID = $_GET['ROL_UID'];
|
||||
$aFields = $RBAC->loadById($ROL_UID);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'roles/roles_Edit', '', $aFields);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
$rows = array_merge( Array ($fields
|
||||
), $aRoles );
|
||||
|
||||
case 'updateRole':
|
||||
|
||||
$aData['ROL_UID'] = $_POST['rol_uid'];
|
||||
//$aData['ROL_PARENT'] = $_POST['parent'];
|
||||
$aData['ROL_CODE'] = trim($_POST['code']);
|
||||
$aData['ROL_NAME'] = $_POST['name'];
|
||||
$aData['ROL_UPDATE_DATE'] = date("Y-M-d H:i:s");
|
||||
$aData['ROL_STATUS'] = $_POST['status'];
|
||||
$oCriteria = $RBAC->updateRole($aData);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
global $_DBArray;
|
||||
$_DBArray['virtual_roles'] = $rows;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'virtual_roles' );
|
||||
|
||||
case 'show':
|
||||
G::LoadClass('ArrayPeer');
|
||||
$aRoles = $RBAC->getAllRoles();
|
||||
|
||||
$fields = Array(
|
||||
'ROL_UID'=>'char',
|
||||
'ROL_PARENT'=>'char',
|
||||
'ROL_SYSTEM'=>'char',
|
||||
'ROL_CREATE_DATE'=>'char',
|
||||
'ROL_UPDATE_DATE'=>'char',
|
||||
'ROL_STATUS'=>'char'
|
||||
);
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'roles/roles_List', $oCriteria );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'deleteRole':
|
||||
$oCriteria = $RBAC->removeRole( $_POST['ROL_UID'] );
|
||||
break;
|
||||
case 'canDeleteRole':
|
||||
if ($RBAC->numUsersWithRole( $_POST['ROL_UID'] ) == 0) {
|
||||
echo 'true';
|
||||
} else {
|
||||
echo 'false';
|
||||
}
|
||||
break;
|
||||
case 'verifyNewRole':
|
||||
$response = ($RBAC->verifyNewRole( $_POST['code'] )) ? 'true' : 'false';
|
||||
print ($response) ;
|
||||
break;
|
||||
case 'updateDataRole':
|
||||
require_once 'classes/model/om/BaseRoles.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
$oCriteria = new Criteria( 'rbac' );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_UID );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_PARENT );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_SYSTEM );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_CODE );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_CREATE_DATE );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_UPDATE_DATE );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_STATUS );
|
||||
$oCriteria->add( RolesPeer::ROL_CODE, $_GET['code'] );
|
||||
|
||||
$rows = array_merge(Array($fields), $aRoles);
|
||||
$result = RolesPeer::doSelectRS( $oCriteria );
|
||||
$result->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['virtual_roles'] = $rows;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('virtual_roles');
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'ROL_NAME' );
|
||||
$oCriteria1->add( ContentPeer::CON_ID, $row['ROL_UID'] );
|
||||
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||
$oDataset1 = ContentPeer::doSelectRS( $oCriteria1 );
|
||||
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset1->next();
|
||||
$aRow1 = $oDataset1->getRow();
|
||||
$row['ROL_NAME'] = $aRow1['CON_VALUE'];
|
||||
$row['ROL_UPDATE_DATE'] = date( "Y-M-d H:i:s" );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'roles/roles_List', $oCriteria);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
$RBAC->updateRole( $row );
|
||||
//$response = ($RBAC->verifyNewRole($_GET['code']))?'true':'false';
|
||||
break;
|
||||
case 'usersIntoRole':
|
||||
$_GET['ROL_UID'] = (isset( $_GET['ROL_UID'] )) ? $_GET['ROL_UID'] : $_POST['ROL_UID'];
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_Tree' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'deleteUserRole':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$RBAC->deleteUserRole( $ROL_UID, $USR_UID );
|
||||
|
||||
case 'deleteRole':
|
||||
$oCriteria = $RBAC->removeRole($_POST['ROL_UID']);
|
||||
break;
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_Tree' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showUsers':
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_AssignRole' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showPermissions':
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_AssignPermissions' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'assignUserToRole':
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$aUserIuds = explode( ",", $_POST['aUsers'] );
|
||||
foreach ($aUserIuds as $key => $val) {
|
||||
$sData['USR_UID'] = $val;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignUserToRole( $sData );
|
||||
}
|
||||
|
||||
case 'canDeleteRole':
|
||||
// $_GET['ROL_UID'] = $ROL_UID;
|
||||
// $G_PUBLISH = new Publisher;
|
||||
// $G_PUBLISH->AddContent('view', 'roles/roles_Tree' );
|
||||
// G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
case 'assignPermissionToRole':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$sData['PER_UID'] = $USR_UID;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignPermissionRole( $sData );
|
||||
|
||||
if($RBAC->numUsersWithRole($_POST['ROL_UID']) == 0){
|
||||
echo 'true';
|
||||
} else {
|
||||
echo 'false';
|
||||
}
|
||||
// $_GET['ROL_UID'] = $ROL_UID;
|
||||
// $G_PUBLISH = new Publisher;
|
||||
// $G_PUBLISH->AddContent('view', 'roles/roles_permissionsTree' );
|
||||
// G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
case 'viewPermitions':
|
||||
$_GET['ROL_UID'] = (isset( $_GET['ROL_UID'] )) ? $_GET['ROL_UID'] : $_POST['ROL_UID'];
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_permissionsTree' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'deletePermissionRole':
|
||||
$PER_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$RBAC->deletePermissionRole( $ROL_UID, $PER_UID );
|
||||
|
||||
break;
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'roles/roles_permissionsTree' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'assignPermissionToRoleMultiple':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrPer = explode( ',', $USR_UID );
|
||||
foreach ($arrPer as $PER_UID) {
|
||||
unset( $sData );
|
||||
$sData['PER_UID'] = $PER_UID;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignPermissionRole( $sData );
|
||||
}
|
||||
break;
|
||||
case 'deletePermissionToRoleMultiple':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrPer = explode( ',', $USR_UID );
|
||||
foreach ($arrPer as $PER_UID) {
|
||||
$RBAC->deletePermissionRole( $ROL_UID, $PER_UID );
|
||||
}
|
||||
break;
|
||||
case 'deleteUserRoleMultiple':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrUsers = explode( ',', $USR_UID );
|
||||
foreach ($arrUsers as $aUID) {
|
||||
$RBAC->deleteUserRole( $ROL_UID, $aUID );
|
||||
}
|
||||
break;
|
||||
case 'rolesList':
|
||||
require_once (PATH_RBAC . "model/RolesPeer.php");
|
||||
require_once ("classes/model/Content.php");
|
||||
G::LoadClass( 'configuration' );
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration( 'rolesList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
|
||||
|
||||
case 'verifyNewRole':
|
||||
$response = ($RBAC->verifyNewRole($_POST['code']))?'true':'false';
|
||||
print($response);
|
||||
break;
|
||||
$start = isset( $_POST['start'] ) ? $_POST['start'] : 0;
|
||||
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : $limit_size;
|
||||
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
|
||||
|
||||
case 'updateDataRole':
|
||||
require_once 'classes/model/om/BaseRoles.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
$oCriteria = new Criteria('rbac');
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UID);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_PARENT);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_SYSTEM);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_CODE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_CREATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UPDATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$oCriteria->add(RolesPeer::ROL_CODE, $_GET['code']);
|
||||
global $RBAC;
|
||||
$Criterias = $RBAC->getAllRolesFilter( $start, $limit, $filter );
|
||||
|
||||
$result = RolesPeer::doSelectRS($oCriteria);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
$rs = RolesPeer::DoSelectRs( $Criterias['LIST'] );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$oCriteria1 = new Criteria('workflow');
|
||||
$oCriteria1->add(ContentPeer::CON_CATEGORY, 'ROL_NAME');
|
||||
$oCriteria1->add(ContentPeer::CON_ID, $row['ROL_UID']);
|
||||
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
|
||||
$oDataset1 = ContentPeer::doSelectRS($oCriteria1);
|
||||
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset1->next();
|
||||
$aRow1 = $oDataset1->getRow();
|
||||
$row['ROL_NAME'] = $aRow1['CON_VALUE'];
|
||||
$row['ROL_UPDATE_DATE'] = date("Y-M-d H:i:s");
|
||||
$content = new Content();
|
||||
$rNames = $content->getAllContentsByRole();
|
||||
$aUsers = $RBAC->getAllUsersByRole();
|
||||
|
||||
$RBAC->updateRole($row);
|
||||
//$response = ($RBAC->verifyNewRole($_GET['code']))?'true':'false';
|
||||
$aRows = Array ();
|
||||
while ($rs->next()) {
|
||||
$aRows[] = $rs->getRow();
|
||||
$index = sizeof( $aRows ) - 1;
|
||||
$aRows[$index]['ROL_NAME'] = isset( $rNames[$aRows[$index]['ROL_UID']] ) ? $rNames[$aRows[$index]['ROL_UID']] : '';
|
||||
$aRows[$index]['TOTAL_USERS'] = isset( $aUsers[$aRows[$index]['ROL_UID']] ) ? $aUsers[$aRows[$index]['ROL_UID']] : 0;
|
||||
}
|
||||
|
||||
break;
|
||||
$oData = RolesPeer::doSelectRS( $Criterias['COUNTER'] );
|
||||
$oData->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oData->next();
|
||||
$row = $oData->getRow();
|
||||
$total_roles = $row['CNT'];
|
||||
|
||||
case 'usersIntoRole':
|
||||
|
||||
$_GET['ROL_UID'] = (isset($_GET['ROL_UID']))?$_GET['ROL_UID']:$_POST['ROL_UID'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_Tree' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'deleteUserRole':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$RBAC->deleteUserRole($ROL_UID, $USR_UID);
|
||||
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_Tree' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'showUsers':
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_AssignRole' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'showPermissions':
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_AssignPermissions' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'assignUserToRole':
|
||||
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$aUserIuds = explode(",",$_POST['aUsers']);
|
||||
foreach($aUserIuds as $key=>$val){
|
||||
$sData['USR_UID'] = $val;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignUserToRole($sData);
|
||||
}
|
||||
|
||||
// $_GET['ROL_UID'] = $ROL_UID;
|
||||
// $G_PUBLISH = new Publisher;
|
||||
// $G_PUBLISH->AddContent('view', 'roles/roles_Tree' );
|
||||
// G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'assignPermissionToRole':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$sData['PER_UID'] = $USR_UID;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignPermissionRole($sData);
|
||||
|
||||
// $_GET['ROL_UID'] = $ROL_UID;
|
||||
// $G_PUBLISH = new Publisher;
|
||||
// $G_PUBLISH->AddContent('view', 'roles/roles_permissionsTree' );
|
||||
// G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'viewPermitions':
|
||||
|
||||
$_GET['ROL_UID'] = (isset($_GET['ROL_UID']))?$_GET['ROL_UID']:$_POST['ROL_UID'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_permissionsTree' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'deletePermissionRole':
|
||||
$PER_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$RBAC->deletePermissionRole($ROL_UID, $PER_UID);
|
||||
|
||||
$_GET['ROL_UID'] = $ROL_UID;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'roles/roles_permissionsTree');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'assignPermissionToRoleMultiple':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrPer = explode(',',$USR_UID);
|
||||
foreach ($arrPer as $PER_UID){
|
||||
unset($sData);
|
||||
$sData['PER_UID'] = $PER_UID;
|
||||
$sData['ROL_UID'] = $ROL_UID;
|
||||
$RBAC->assignPermissionRole($sData);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'deletePermissionToRoleMultiple':
|
||||
$USR_UID = $_POST['PER_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrPer = explode(',',$USR_UID);
|
||||
foreach ($arrPer as $PER_UID){
|
||||
$RBAC->deletePermissionRole($ROL_UID, $PER_UID);
|
||||
}
|
||||
break;
|
||||
case 'deleteUserRoleMultiple':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$ROL_UID = $_POST['ROL_UID'];
|
||||
$arrUsers = explode(',',$USR_UID);
|
||||
foreach ($arrUsers as $aUID){
|
||||
$RBAC->deleteUserRole($ROL_UID, $aUID);
|
||||
}
|
||||
break;
|
||||
case 'rolesList':
|
||||
require_once (PATH_RBAC . "model/RolesPeer.php");
|
||||
require_once ("classes/model/Content.php");
|
||||
G::LoadClass('configuration');
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration('rolesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||
|
||||
$start = isset($_POST['start']) ? $_POST['start'] : 0;
|
||||
$limit = isset($_POST['limit']) ? $_POST['limit'] : $limit_size;
|
||||
$filter = isset($_REQUEST['textFilter'])? $_REQUEST['textFilter'] : '';
|
||||
|
||||
|
||||
global $RBAC;
|
||||
$Criterias = $RBAC->getAllRolesFilter($start,$limit,$filter);
|
||||
|
||||
$rs = RolesPeer::DoSelectRs($Criterias['LIST']);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$content = new Content();
|
||||
$rNames = $content->getAllContentsByRole();
|
||||
$aUsers = $RBAC->getAllUsersByRole();
|
||||
|
||||
$aRows = Array();
|
||||
while($rs->next()){
|
||||
$aRows[] = $rs->getRow();
|
||||
$index = sizeof($aRows)-1;
|
||||
$aRows[$index]['ROL_NAME'] = isset($rNames[$aRows[$index]['ROL_UID']])? $rNames[$aRows[$index]['ROL_UID']] : '';
|
||||
$aRows[$index]['TOTAL_USERS'] = isset($aUsers[$aRows[$index]['ROL_UID']])? $aUsers[$aRows[$index]['ROL_UID']] : 0;
|
||||
}
|
||||
|
||||
$oData = RolesPeer::doSelectRS($Criterias['COUNTER']);
|
||||
$oData->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oData->next();
|
||||
$row = $oData->getRow();
|
||||
$total_roles = $row['CNT'];
|
||||
|
||||
echo '{roles: '.G::json_encode($aRows).', total_roles: '.$total_roles.'}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('rolesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'checkRoleCode':
|
||||
$rol_code = $_POST['ROL_CODE'];
|
||||
$rol_uid = isset($_POST['ROL_UID'])? $_POST['ROL_UID']: '';
|
||||
$oCriteria = new Criteria('rbac');
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UID);
|
||||
$oCriteria->add(RolesPeer::ROL_CODE, $rol_code);
|
||||
if ($rol_uid !=''){
|
||||
$oCriteria->add(RolesPeer::ROL_UID, $rol_uid, Criteria::NOT_EQUAL);
|
||||
}
|
||||
$oDataset = RolesPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($oDataset->next()){
|
||||
$response = 'false';
|
||||
}else{
|
||||
$response = 'true';
|
||||
}
|
||||
echo '{success:'.$response.'}';
|
||||
break;
|
||||
|
||||
default: echo 'default';
|
||||
echo '{roles: ' . G::json_encode( $aRows ) . ', total_roles: ' . $total_roles . '}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
|
||||
$config = Array ();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig( 'rolesList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'checkRoleCode':
|
||||
$rol_code = $_POST['ROL_CODE'];
|
||||
$rol_uid = isset( $_POST['ROL_UID'] ) ? $_POST['ROL_UID'] : '';
|
||||
$oCriteria = new Criteria( 'rbac' );
|
||||
$oCriteria->addSelectColumn( RolesPeer::ROL_UID );
|
||||
$oCriteria->add( RolesPeer::ROL_CODE, $rol_code );
|
||||
if ($rol_uid != '') {
|
||||
$oCriteria->add( RolesPeer::ROL_UID, $rol_uid, Criteria::NOT_EQUAL );
|
||||
}
|
||||
$oDataset = RolesPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
if ($oDataset->next()) {
|
||||
$response = 'false';
|
||||
} else {
|
||||
$response = 'true';
|
||||
}
|
||||
echo '{success:' . $response . '}';
|
||||
break;
|
||||
default:
|
||||
echo 'default';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,56 +12,51 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_USERS')) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -3:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'ROLES';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_USERS' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 3:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
G::LoadClass('configuration');
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'ROLES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('rolesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript('roles/rolesList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('roles/rolesList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
?>
|
||||
$configPage = $c->getConfiguration( 'rolesList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'roles/rolesList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'roles/rolesList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user