Disable qrcode if Endroid QrCode library is missing

Treat a missing QrCode library the same as roundcube treats a missing
php-gd library.  Hide the button to disallow access.

Requested by distributions that don't use composer and don't yet have
packages for the QrCode library.
pull/5890/head
Philippe 'Peep' Chaintreuil 7 years ago committed by Aleksander Machniak
parent e31d87b311
commit 9d4155bfaa

@ -43,7 +43,11 @@ if ($cid && ($record = ($CONTACT_RECORD ?: $CONTACTS->get_record($cid, true))))
rcmail_set_sourcename($CONTACTS);
// Disable qr-code if php-gd is not installed
$OUTPUT->set_env('qrcode', function_exists('imagecreate'));
// Disable qr-code if Endriod's QrCode is not installed
$OUTPUT->set_env(
'qrcode',
function_exists('imagecreate') && class_exists('Endroid\QrCode\QrCode')
);
$OUTPUT->add_label('qrcode');
$OUTPUT->add_handlers(array(

Loading…
Cancel
Save