From b7679aa5f3ac020988bf76092f85c87ee4b625c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Apr 2008 17:17:11 +0000 Subject: [PATCH] Fix: Minor fixes on xcal export --- htdocs/admin/agenda_xcal.php | 8 ++++---- htdocs/admin/events.php | 1 + htdocs/admin/webcalendar.php | 7 ++++--- htdocs/comm/action/agendaexport.php | 5 ++++- htdocs/langs/en_US/agenda.lang | 5 +++-- htdocs/langs/fr_FR/agenda.lang | 5 +++-- htdocs/webcal/webcalexport.php | 8 +++----- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 1c8df56b702..e091fd2762d 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -45,7 +45,7 @@ if ($actionsave) $db->begin(); - $i+=dolibarr_set_const($db,'MAIN_PASSWORD_VCALEXPORT',trim($_POST["MAIN_PASSWORD_VCALEXPORT"]),'chaine',0); + $i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]),'chaine',0); if ($i > 0) { @@ -91,7 +91,7 @@ print ""; print ""; print "".$langs->trans("PasswordTogetVCalExport").""; -print "global->MAIN_PASSWORD_VCALEXPORT) . "\" size=\"40\">"; +print "global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\">"; print " "; print ""; @@ -113,10 +113,10 @@ print "
"; // Show message $message=''; $urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); -$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').''; +$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').''; $message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); $message.='
'; -$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').''; +$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').''; $message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical); print info_admin($message); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 42d5ee4fa86..b1521ceaca6 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -41,6 +41,7 @@ $action=$_POST["action"]; // List of all events supported by triggers $eventstolog=array( array('id'=>'USER_LOGIN', 'test'=>1), + array('id'=>'USER_LOGIN_FAILED', 'test'=>1), array('id'=>'USER_CREATE', 'test'=>1), array('id'=>'USER_MODIFY', 'test'=>1), array('id'=>'USER_NEW_PASSWORD', 'test'=>1), diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php index f8258b5e5e9..750608716ff 100644 --- a/htdocs/admin/webcalendar.php +++ b/htdocs/admin/webcalendar.php @@ -55,6 +55,7 @@ if ($actionsave) $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_DBNAME',trim($_POST["phpwebcalendar_dbname"]),'chaine',0); $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_USER',trim($_POST["phpwebcalendar_user"]),'chaine',0); $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_PASS',trim($_POST["phpwebcalendar_pass"]),'chaine',0); + $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_PASSWORD_VCALEXPORT',trim($_POST["PHPWEBCALENDAR_PASSWORD_VCALEXPORT"]),'chaine',0); $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_SYNCRO',trim($_POST["phpwebcalendar_syncro"]),'chaine',0); $i+=dolibarr_set_const($db,'PHPWEBCALENDAR_COMPANYCREATE',trim($_POST["phpwebcalendar_companycreate"]),'chaine',0); @@ -204,7 +205,7 @@ print ''; print ' '; print ""; -print ""; +print ""; print "".$langs->trans("PasswordTogetVCalExport").""; print "global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT) . "\" size=\"40\">"; print " "; @@ -312,10 +313,10 @@ print "
"; // Show message $message=''; $urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); -$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey=...'.''; +$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.''; $message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); $message.='
'; -$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey=...'.''; +$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.''; $message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical); print info_admin($message); diff --git a/htdocs/comm/action/agendaexport.php b/htdocs/comm/action/agendaexport.php index f02e20a7da6..1e019490509 100644 --- a/htdocs/comm/action/agendaexport.php +++ b/htdocs/comm/action/agendaexport.php @@ -33,9 +33,12 @@ require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php'); function llxHeader() { print 'Export agenda cal'; } function llxFooter() { print ''; } +// Security check +if (! $conf->agenda->enabled) + accessforbidden(); // Check config -if (! $conf->agenda->enabled && empty($conf->global->MAIN_PASSWORD_VCALEXPORT)) +if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { $user->getrights(); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index fb244b03bac..12fbcf517ee 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -23,5 +23,6 @@ ViewList=View list ViewCal=View calendar ViewWithPredefinedFilters=View with predefined filters AutoActions=Automatic creation of actions -AgendaAutoActionDesc=Define here, actions for which you want Dolibarr to creat automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda. -AgendaSetupOtherDesc=This page allows to configure other parameters. \ No newline at end of file +AgendaAutoActionDesc=Define here events for which you want Dolibarr to create automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda. +AgendaSetupOtherDesc=This page allows to configure other parameters of agenda module. +ActionsEvents=Events for which create an action \ No newline at end of file diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 4635edc16a3..2f7e4135251 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -23,5 +23,6 @@ ViewList=Voir liste ViewCal=Voir calendrier ViewWithPredefinedFilters=Vues avec filtres prédéfinis AutoActions=Création automatiques des actions -AgendaAutoActionDesc=Définissez dans cet onglet, les actions pour lesquels dolibarr créera automatiquement une tache dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda. -AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres. \ No newline at end of file +AgendaAutoActionDesc=Définissez dans cet onglet les évènements pour lesquels dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda. +AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres du module agenda. +ActionsEvents=Evènements pour lesquels creer une action \ No newline at end of file diff --git a/htdocs/webcal/webcalexport.php b/htdocs/webcal/webcalexport.php index 05240bb95fc..9dbbdafce79 100644 --- a/htdocs/webcal/webcalexport.php +++ b/htdocs/webcal/webcalexport.php @@ -37,7 +37,7 @@ if (! $conf->webcal->enabled) accessforbidden(); // Check config -if (empty($conf->global->PHPWEBCALENDAR_URL)) +if (empty($conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT)) { $user->getrights(); @@ -55,16 +55,14 @@ if (! $webcal->localdb->connected || ! $webcal->localdb->database_selected) llxHeader(); if ($webcal->localdb->connected == 1 && $webcal->localdb->database_selected != 1) { - print '
'.$langs->trans("WebCalTestKo1",$conf->webcal->db->host,$conf->webcal->db->name); - print '
'.$webcal->localdb->error(); + print $webcal->localdb->error(); print '
'.$langs->trans("WebCalCheckWebcalSetup"); print "
"; //$webcal->localdb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique } else { - print "
".$langs->trans("WebCalTestKo2",$conf->webcal->db->host,$conf->webcal->db->user); - print "
".$webcal->localdb->error(); + print $webcal->localdb->error(); print '
'.$langs->trans("WebCalCheckWebcalSetup"); print "
"; }