diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 7d5ca2dc4c6..0aed8ffbe57 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -65,20 +65,13 @@ function societe_prepare_head($objsoc) $head[$h][2] = 'supplier'; $h++; } - /*if ($conf->facture->enabled || $conf->compta->enabled || $conf->accounting->enabled) + if ($conf->agenda->enabled) { - $langs->load("compta"); - $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Accountancy"); - $head[$h][2] = 'compta'; - $h++; - }*/ - - $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Agenda"); - $head[$h][2] = 'agenda'; - $h++; - + $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Agenda"); + $head[$h][2] = 'agenda'; + $h++; + } //show categorie tab if ($conf->categorie->enabled) { @@ -103,7 +96,6 @@ function societe_prepare_head($objsoc) $head[$h][2] = 'document'; $h++; } - if ($conf->notification->enabled && $user->societe_id == 0) { $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id; @@ -111,7 +103,6 @@ function societe_prepare_head($objsoc) $head[$h][2] = 'notify'; $h++; } - if ($user->societe_id == 0) { $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index a5810b280da..a0439edd265 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -33,6 +33,10 @@ if (! $user->rights->user->user->lire && !$user->admin) $langs->load("users"); +// Security check (for external users) +$socid=0; +if ($user->societe_id > 0) $socid = $user->societe_id; + /* * View @@ -89,6 +93,7 @@ $sql.= " s.nom, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; +if (!empty($socid)) $sql.= " AND u.fk_societe = ".$socid; $sql.= $db->order("u.datec","DESC"); $sql.= $db->plimit($max);