corebos
corebos copied to clipboard
Mobile: signature exposed to public
Frank Piepiorra (CRMNOW): The signature files are exposed to the public since you use the /storage URL for displaying in Detail View. For this reason it is better to transfer an image base 64 coded to the tpl. We use the code below (and block the /storage completely by some server settings for the public).
//crm-now: added because of restricted access to /storage
$type = pathinfo($imgpath, PATHINFO_EXTENSION);
$data = file_get_contents($imgpath);
$base64_str = "data:image/".$type.";base64,".base64_encode($data);
$viewer->assign('SIGNPATH',$base64_str);
Template:
<img border="0" align="middle" src="{$SIGNPATH}"/>