diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php
index c2774272117..0aa999bfee6 100644
--- a/htdocs/core/class/canvas.class.php
+++ b/htdocs/core/class/canvas.class.php
@@ -105,27 +105,29 @@ class Canvas
*/
function getCanvas($module,$card,$canvas)
{
- global $langs;
+ global $conf, $langs;
$error='';
$this->card = $card;
- $this->aliastargetmodule = $this->targetmodule = $module;
+ $this->canvas = $canvas;
+ $childmodule = $this->aliasmodule = $this->module = $module;
+ $targetmodule = $this->aliastargetmodule = $this->targetmodule = $module;
if (preg_match('/^([^@]+)@([^@]+)$/i',$canvas,$regs))
{
- $this->aliasmodule = $this->module = $regs[2];
+ $childmodule = $this->aliasmodule = $this->module = $regs[2];
$this->canvas = $regs[1];
// For compatibility
- if ($this->module == 'thirdparty') $this->aliasmodule = 'societe';
- if ($this->targetmodule == 'thirdparty') $this->aliastargetmodule = 'societe';
- }
- else
- {
- $this->error = $langs->trans('CanvasIsInvalid');
- return 0;
+ if ($this->module == 'thirdparty') $childmodule = $this->aliasmodule = 'societe';
+ if ($this->targetmodule == 'thirdparty') $targetmodule = $this->aliastargetmodule = 'societe';
}
+ //print 'childmodule='.$childmodule.' targetmodule='.$targetmodule.'
';
+ //print 'childmodule='.$conf->$childmodule->enabled.' targetmodule='.$conf->$targetmodule->enabled.'
';
+
+ if (! $conf->$childmodule->enabled || ! $conf->$targetmodule->enabled) accessforbidden();
+
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$this->aliasmodule.'/canvas/'.$this->canvas.'/'.$this->targetmodule.'.'.$this->canvas.'.class.php') &&
file_exists(DOL_DOCUMENT_ROOT.'/'.$this->aliasmodule.'/canvas/'.$this->canvas.'/'.$this->card.'.'.$this->canvas.'.class.php'))
{
@@ -160,8 +162,7 @@ class Canvas
}
else
{
- $this->error = $langs->trans('CanvasIsInvalid');
- return 0;
+ accessforbidden();
}
return 1;
diff --git a/htdocs/societe/canvas/individual/card.individual.class.php b/htdocs/societe/canvas/individual/card.individual.class.php
index ad534aeede4..eab65a1881a 100644
--- a/htdocs/societe/canvas/individual/card.individual.class.php
+++ b/htdocs/societe/canvas/individual/card.individual.class.php
@@ -98,7 +98,7 @@ class CardIndividual extends CardCommon
// Confirm delete third party
if ($_GET["action"] == 'delete')
{
- $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,2);
+ $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,2);
}
}
}