Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

228
modules/ACL/ACLController.php Executable file
View File

@@ -0,0 +1,228 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/ACLActions/actiondefs.php');
require_once('modules/ACL/ACLJSController.php');
class ACLController {
function checkAccess($category, $action, $is_owner=false, $type='module'){
global $current_user;
if(is_admin($current_user))return true;
//calendar is a special case since it has 3 modules in it (calls, meetings, tasks)
if($category == 'Calendar'){
return ACLAction::userHasAccess($current_user->id, 'Calls', $action,$type, $is_owner) || ACLAction::userHasAccess($current_user->id, 'Meetings', $action,'module', $is_owner) || ACLAction::userHasAccess($current_user->id, 'Tasks', $action,'module', $is_owner);
}
if($category == 'Activities'){
return ACLAction::userHasAccess($current_user->id, 'Calls', $action,$type, $is_owner) || ACLAction::userHasAccess($current_user->id, 'Meetings', $action,'module', $is_owner) || ACLAction::userHasAccess($current_user->id, 'Tasks', $action,'module', $is_owner)|| ACLAction::userHasAccess($current_user->id, 'Emails', $action,'module', $is_owner)|| ACLAction::userHasAccess($current_user->id, 'Notes', $action,'module', $is_owner);
}
return ACLAction::userHasAccess($current_user->id, $category, $action,$type, $is_owner);
}
function requireOwner($category, $value, $type='module'){
global $current_user;
if(is_admin($current_user))return false;
return ACLAction::userNeedsOwnership($current_user->id, $category, $value,$type);
}
function filterModuleList(&$moduleList, $by_value=true){
global $aclModuleList, $current_user;
$actions = ACLAction::getUserActions($current_user->id, false);
$compList = array();
if($by_value){
foreach($moduleList as $key=>$value){
$compList[$value]= $key;
}
}else{
$compList =& $moduleList;
}
foreach($actions as $action_name=>$action){
if(!empty($action['module'])){
$aclModuleList[$action_name] = $action_name;
if(isset($compList[$action_name])){
if($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED){
if($by_value){
unset($moduleList[$compList[$action_name]]);
}else{
unset($moduleList[$action_name]);
}
}
}
}
}
if(isset($compList['Calendar']) &&
!( ACLController::checkModuleAllowed('Calls', $actions) || ACLController::checkModuleAllowed('Meetings', $actions) || ACLController::checkModuleAllowed('Tasks', $actions)))
{
if($by_value){
unset($moduleList[$compList['Calendar']]);
}else{
unset($moduleList['Calendar']);
}
if(isset($compList['Activities']) &&
!( ACLController::checkModuleAllowed('Notes', $actions) || ACLController::checkModuleAllowed('Notes', $actions))){
if($by_value){
unset($moduleList[$compList['Activities']]);
}else{
unset($moduleList['Activities']);
}
}
}
}
/**
* Check to see if the module is available for this user.
*
* @param String $module_name
* @return true if they are allowed. false otherwise.
*/
function checkModuleAllowed($module_name, $actions)
{
if(!empty($actions[$module_name]['module']['access']['aclaccess']) &&
ACL_ALLOW_ENABLED == $actions[$module_name]['module']['access']['aclaccess'])
{
return true;
}
return false;
}
function disabledModuleList($moduleList, $by_value=true,$view='list'){
global $aclModuleList, $current_user;
$actions = ACLAction::getUserActions($current_user->id, false);
$disabled = array();
$compList = array();
if($by_value){
foreach($moduleList as $key=>$value){
$compList[$value]= $key;
}
}else{
$compList =& $moduleList;
}
if(isset($moduleList['ProductTemplates'])){
$moduleList['Products'] ='Products';
}
foreach($actions as $action_name=>$action){
if(!empty($action['module'])){
$aclModuleList[$action_name] = $action_name;
if(isset($compList[$action_name])){
if($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED || $action['module'][$view]['aclaccess'] < 0){
if($by_value){
$disabled[$compList[$action_name]] =$compList[$action_name] ;
}else{
$disabled[$action_name] = $action_name;
}
}
}
}
}
if(isset($compList['Calendar']) && !( ACL_ALLOW_ENABLED == $actions['Calls']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Meetings']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Tasks']['module']['access']['aclaccess'])){
if($by_value){
$disabled[$compList['Calendar']] = $compList['Calendar'];
}else{
$disabled['Calendar'] = 'Calendar';
}
if(isset($compList['Activities']) &&!( ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'] )){
if($by_value){
$disabled[$compList['Activities']] = $compList['Activities'];
}else{
$disabled['Activities'] = 'Activities';
}
}
}
if(isset($disabled['Products'])){
$disabled['ProductTemplates'] = 'ProductTemplates';
}
return $disabled;
}
function addJavascript($category,$form_name='', $is_owner=false){
$jscontroller = new ACLJSController($category, $form_name, $is_owner);
echo $jscontroller->getJavascript();
}
function moduleSupportsACL($module){
static $checkModules = array();
global $beanFiles, $beanList;
if(isset($checkModules[$module])){
return $checkModules[$module];
}
if(!isset($beanList[$module])){
$checkModules[$module] = false;
}else{
$class = $beanList[$module];
require_once($beanFiles[$class]);
$mod = new $class();
if(!is_subclass_of($mod, 'SugarBean')){
$checkModules[$module] = false;
}else{
$checkModules[$module] = $mod->bean_implements('ACL');
}
}
return $checkModules[$module] ;
}
function displayNoAccess($redirect_home = false){
echo '<script>function set_focus(){}</script><p class="error">' . translate('LBL_NO_ACCESS', 'ACL') . '</p>';
if($redirect_home)echo 'Redirect to Home in <span id="seconds_left">3</span> seconds<script> function redirect_countdown(left){document.getElementById("seconds_left").innerHTML = left; if(left == 0){document.location.href = "index.php";}else{left--; setTimeout("redirect_countdown("+ left+")", 1000)}};setTimeout("redirect_countdown(3)", 1000)</script>';
}
}
?>

177
modules/ACL/ACLJSController.php Executable file
View File

@@ -0,0 +1,177 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class ACLJSController{
function ACLJSController($module,$form='', $is_owner=false){
$this->module = $module;
$this->is_owner = $is_owner;
$this->form = $form;
}
function getJavascript(){
global $action;
if(!ACLController::moduleSupportsACL($this->module)){
return '';
}
$script = "<SCRIPT>\n//BEGIN ACL JAVASCRIPT\n";
if($action == 'DetailView'){
if(!ACLController::checkAccess($this->module,'edit', $this->is_owner)){
$script .= <<<EOQ
if(typeof(document.DetailView) != 'undefined'){
if(typeof(document.DetailView.elements['Edit']) != 'undefined'){
document.DetailView.elements['Edit'].disabled = 'disabled';
}
if(typeof(document.DetailView.elements['Duplicate']) != 'undefined'){
document.DetailView.elements['Duplicate'].disabled = 'disabled';
}
}
EOQ;
}
if(!ACLController::checkAccess($this->module,'delete', $this->is_owner)){
$script .= <<<EOQ
if(typeof(document.DetailView) != 'undefined'){
if(typeof(document.DetailView.elements['Delete']) != 'undefined'){
document.DetailView.elements['Delete'].disabled = 'disabled';
}
}
EOQ;
}
}
if(file_exists('modules/'. $this->module . '/metadata/acldefs.php')){
include('modules/'. $this->module . '/metadata/acldefs.php');
foreach($acldefs[$this->module]['forms'] as $form_name=>$form){
foreach($form as $field_name=>$field){
if($field['app_action'] == $action){
switch($form_name){
case 'by_id':
$script .= $this->getFieldByIdScript($field_name, $field);
break;
case 'by_name':
$script .= $this->getFieldByNameScript($field_name, $field);
break;
default:
$script .= $this->getFieldByFormScript($form_name, $field_name, $field);
break;
}
}
}
}
}
$script .= '</SCRIPT>';
return $script;
}
function getHTMLValues($def){
$return_array = array();
switch($def['display_option']){
case 'clear_link':
$return_array['href']= "#";
$return_array['className']= "nolink";
break;
default;
$return_array[$def['display_option']] = $def['display_option'];
break;
}
return $return_array;
}
function getFieldByIdScript($name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= "\nif(document.getElementById('$name'))document.getElementById('$name')." . $key . '="' .$value. '";'. "\n";
}
}
return $script;
}
function getFieldByNameScript($name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= <<<EOQ
var aclfields = document.getElementsByName('$name');
for(var i in aclfields){
aclfields[i].$key = '$value';
}
EOQ;
}
}
return $script;
}
function getFieldByFormScript($form, $name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= "\nif(typeof(document.$form.$name.$key) != 'undefined')\n document.$form.$name.".$key . '="' .$value. '";';
}
}
return $script;
}
}
?>

0
modules/ACL/Forms.php Executable file
View File

45
modules/ACL/List.php Executable file
View File

@@ -0,0 +1,45 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
if($_REQUEST['submodule'] == 'Roles'){
require_once('modules/ACL/Roles/ListView.php');
}
if($_REQUEST['submodule'] == 'Users'){
require_once('modules/ACL/Roles/ListUsers.php');
}
?>

43
modules/ACL/Menu.php Executable file
View File

@@ -0,0 +1,43 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $mod_strings;
$module_menu = Array(
Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"),
Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"),
);
?>

39
modules/ACL/Save.php Executable file
View File

@@ -0,0 +1,39 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/ACL/Roles/Save.php');
?>

75
modules/ACL/install_actions.php Executable file
View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $current_user,$beanList, $beanFiles, $mod_strings;
$installed_classes = array();
$ACLbeanList=$beanList;
if(is_admin($current_user)){
foreach($ACLbeanList as $module=>$class){
if(empty($installed_classes[$class]) && isset($beanFiles[$class]) && file_exists($beanFiles[$class])){
if($class == 'Tracker'){
} else {
require_once($beanFiles[$class]);
$mod = new $class();
if($mod->bean_implements('ACL') && empty($mod->acl_display_only)){
// BUG 10339: do not display messages for upgrade wizard
if(!isset($_REQUEST['upgradeWizard'])){
echo translate('LBL_ADDING','ACL','') . $mod->module_dir . '<br>';
}
if(!empty($mod->acltype)){
ACLAction::addActions($mod->module_dir, $mod->acltype);
}else{
ACLAction::addActions($mod->module_dir);
}
$installed_classes[$class] = true;
}
}
}
}
}
?>

View File

@@ -0,0 +1,52 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$mod_strings = array (
'LBL_ALLOW_ALL'=>'All',
'LBL_ALLOW_NONE'=>'None',
'LBL_ALLOW_OWNER'=>'Owner',
'LBL_ROLE'=>'Role',
'LBL_NAME'=>'Name',
'LBL_DESCRIPTION'=>'Description',
'LIST_ROLES'=>'List Roles',
'LBL_USERS_SUBPANEL_TITLE'=>'Users',
'LIST_ROLES_BY_USER'=>'List Roles By User',
'LBL_ROLES_SUBPANEL_TITLE'=>'User Roles',
'LBL_SEARCH_FORM_TITLE'=>'Search',
'LBL_NO_ACCESS'=>'You do not have access to this area. Contact your site administrator to obtain access.',
'LBL_ADDING'=>'Adding for ',
)
?>

View File

@@ -0,0 +1,47 @@
<?PHP
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ALLOW_ALL'=>'Wszystko',
'LBL_ALLOW_NONE'=>'Nic',
'LBL_ALLOW_OWNER'=>'Właściciel',
'LBL_ROLE'=>'Zależność',
'LBL_NAME'=>'Nazwa',
'LBL_DESCRIPTION'=>'Opis',
'LIST_ROLES'=>'Lista zależności',
'LBL_USERS_SUBPANEL_TITLE'=>'Użytkownicy',
'LIST_ROLES_BY_USER'=>'Lista Zalezności użytkowników',
'LBL_ROLES_SUBPANEL_TITLE'=>'Zależności użytkowników',
'LBL_SEARCH_FORM_TITLE'=>'Szukaj',
'LBL_NO_ACCESS'=>'Nie masz dostępu do tej części systemu. Skontaktuj się z administratorem, jeśli sądzisz, że powinieneś mieć.',
'LBL_ADDING'=>'Dodano dla ',
)
?>

View File

@@ -0,0 +1,72 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$layout_defs['ACL'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'users' => array(
'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),),
'order' => 20,
'module' => 'Users',
'subpanel_name' => 'ForSubModules',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'user_id',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
),
),
);
$layout_defs['UserRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'acl' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),),
'order' => 20,
'module' => 'ACL',
'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php',
'subpanel_name' => 'default',
'get_subpanel_data' => 'roles',
'add_subpanel_data' => 'role_id',
'title_key' => 'LBL_ROLES_SUBPANEL_TITLE',
),
),
);
?>

57
modules/ACL/remove_actions.php Executable file
View File

@@ -0,0 +1,57 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $current_user,$beanList, $beanFiles;
$actionarr = ACLAction::getDefaultActions();
if(is_admin($current_user)){
$foundOne = false;
foreach($actionarr as $actionobj){
if(!isset($beanList[$actionobj->category]) || !file_exists($beanFiles[$beanList[$actionobj->category]])){
if(!isset($_REQUEST['upgradeWizard'])){
echo 'Removing for ' . $actionobj->category . '<br>';
}
$foundOne = true;
ACLAction::removeActions($actionobj->category);
}
}
if(!$foundOne)
echo 'No ACL modules found that needed to be removed';
}
?>

40
modules/ACL/vardefs.php Executable file
View File

@@ -0,0 +1,40 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
?>