Implement an admin-config setting to be able to disable PGP encryption feature

This commit is contained in:
Hadi Nategh 2018-08-23 16:58:14 +02:00
parent 620e20f0e4
commit b4b2b9d5d2
4 changed files with 17 additions and 2 deletions

View File

@ -47,6 +47,16 @@
<option value="True">Yes</option>
</select>
</row>
<row>
<description value="Encryption" span="all" class="subHeader"/>
</row>
<row>
<description value="Disable PGP encryption (Mailvelope)" lable="%s:"/>
<select id="newsettings[disable_pgp_encryption]">
<option value="">{No} - {Default}</option>
<option value="True">Yes</option>
</select>
</row>
</rows>
</grid>
</template>

View File

@ -284,7 +284,7 @@ class Hooks
*/
public static function pgp_encryption_menu($appname)
{
if (Header\UserAgent::mobile()) return;
if (Header\UserAgent::mobile() || $GLOBALS['egw_info']['server']['disable_pgp_encryption']) return;
// PGP Encryption (Mailvelope plugin) restore/backup menu
$file = Array(

View File

@ -2271,10 +2271,14 @@ class infolog_ui
{
$sel_options['action']['schedule'] = array('label' => 'Schedule', 'title' => 'Schedule appointment');
}
if ($GLOBALS['egw_info']['user']['apps']['stylite'])
if ($GLOBALS['egw_info']['user']['apps']['stylite'] && !$GLOBALS['egw_info']['server']['disable_pgp_encryption'])
{
$content['encryption_ts'] = filemtime(EGW_SERVER_ROOT.'/stylite/js/infolog-encryption.js');
}
elseif ($GLOBALS['egw_info']['server']['disable_pgp_encryption'])
{
$readonlys['encrypt'] = true;
}
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.
($content['status_only'] ? lang('Edit Status') : lang('Edit'));
$GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => ($info_id ? 'ManualInfologEdit' : 'ManualInfologAdd'));

View File

@ -271,6 +271,7 @@ class mail_compose
}
unset($actions['pgp']);
}
if ($GLOBALS['egw_info']['server']['disable_pgp_encryption']) unset($actions['pgp']);
// remove vfs actions if the user has no run access to filemanager
if (!$GLOBALS['egw_info']['user']['apps']['filemanager'])
{