Skip to content
Snippets Groups Projects
Commit 8915d02f authored by Prasad's avatar Prasad
Browse files

Fixes #471: Deny access to send sms when profile does not allow or server is not configured.

parent 7e8e61d2
No related branches found
No related tags found
1 merge request!311Language italian translation
{*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************}
<div id="sendSmsContainer" class='modal-xs modal-dialog'>
<div class = "modal-content">
{include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE=$TITLE}
<div class="modal-body">
{$BODY}
</div>
<div class="modal-footer">
</div>
</div>
</div>
\ No newline at end of file
...@@ -299,6 +299,22 @@ class Vtiger_MassActionAjax_View extends Vtiger_IndexAjax_View { ...@@ -299,6 +299,22 @@ class Vtiger_MassActionAjax_View extends Vtiger_IndexAjax_View {
$sourceModule = $request->getModule(); $sourceModule = $request->getModule();
$moduleName = 'SMSNotifier'; $moduleName = 'SMSNotifier';
$isCreateAllowed = Users_Privileges_Model::isPermitted($moduleName, 'CreateView');
if(!$isCreateAllowed) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}
$viewer = $this->getViewer($request);
require_once 'modules/SMSNotifier/SMSNotifier.php';
if (!SMSNotifier::checkServer()) {
$viewer->assign('TITLE', vtranslate('LBL_SEND_SMS', $moduleName));
$viewer->assign('BODY', vtranslate('LBL_NOT_ACCESSIBLE', $moduleName));
echo $viewer->view('NotAccessible.tpl', $moduleName, true);
exit;
}
$selectedIds = $this->getRecordsListFromRequest($request); $selectedIds = $this->getRecordsListFromRequest($request);
$excludedIds = $request->get('excluded_ids'); $excludedIds = $request->get('excluded_ids');
$cvId = $request->get('viewname'); $cvId = $request->get('viewname');
...@@ -306,7 +322,6 @@ class Vtiger_MassActionAjax_View extends Vtiger_IndexAjax_View { ...@@ -306,7 +322,6 @@ class Vtiger_MassActionAjax_View extends Vtiger_IndexAjax_View {
$user = Users_Record_Model::getCurrentUserModel(); $user = Users_Record_Model::getCurrentUserModel();
$moduleModel = Vtiger_Module_Model::getInstance($sourceModule); $moduleModel = Vtiger_Module_Model::getInstance($sourceModule);
$phoneFields = $moduleModel->getFieldsByType('phone'); $phoneFields = $moduleModel->getFieldsByType('phone');
$viewer = $this->getViewer($request);
if(count($selectedIds) == 1){ if(count($selectedIds) == 1){
$recordId = $selectedIds[0]; $recordId = $selectedIds[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment