From 7fc3fb5827c9d2e83b736059641f60bf3a16f4d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Jan 2012 23:17:12 +0100 Subject: [PATCH] New: [ task #181 ] Hide password of click2dial in user card --- ChangeLog | 1 + htdocs/user/clicktodial.php | 42 +++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5d6ea4e630..7d492909485 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ For users: - New: Reduce seriously size of packages. - New: Can define country code for import. - New: When invoice was generated from order, order date is visible on PDF, after order ref. +- New: [ task #181 ] Hide password of click2dial in user card - Fix: Can use POS module with several concurrent users. For developers: diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 70b5faad5ba..eef8a16bc7a 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2009 Laurent Destailleur + * Copyright (C) 2005-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/usergroups.lib.php"); $langs->load("users"); $langs->load("admin"); +$action=GETPOST('action','alpha'); +$id=GETPOST('id','int'); + // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; @@ -41,10 +44,10 @@ $result = restrictedArea($user, 'user', $_GET["id"], '', $feature2); * Actions */ -if ($_POST["action"] == 'update' && ! $_POST['cancel']) +if ($action == 'update' && ! $_POST['cancel']) { $edituser = new User($db); - $edituser->fetch($_GET["id"]); + $edituser->fetch($id); $edituser->clicktodial_login = $_POST["login"]; $edituser->clicktodial_password = $_POST["password"]; @@ -64,10 +67,10 @@ $form = new Form($db); llxHeader("","ClickToDial"); -if ($_GET["id"]) +if ($id) { $fuser = new User($db); - $fuser->fetch($_GET["id"]); + $fuser->fetch($id); $fuser->fetch_clicktodial(); @@ -92,21 +95,21 @@ if ($_GET["id"]) print ''; print ''; - // Nom + // Name print ''.$langs->trans("Lastname").''; - print ''.$fuser->nom.''; + print ''.$fuser->lastname.''; print "\n"; // Prenom print ''.$langs->trans("Firstname").''; - print ''.$fuser->prenom.''; + print ''.$fuser->name.''; print "\n"; print "\n"; print "
\n"; - if ($_GET["action"] == 'edit') + if ($action == 'edit') { print '
'; print ''; @@ -115,7 +118,7 @@ if ($_GET["id"]) if ($user->admin) { - print "".'ClickToDial URL'; + print 'ClickToDial URL'; print ''; if (empty($conf->global->CLICKTODIAL_URL)) { @@ -127,17 +130,17 @@ if ($_GET["id"]) print ''; } - print "".'ClickToDial '.$langs->trans("Login").''; + print 'ClickToDial '.$langs->trans("Login").''; print ''; print ''; print ''; - print "".'ClickToDial '.$langs->trans("Password").''; + print 'ClickToDial '.$langs->trans("Password").''; print ''; print ''; print "\n"; - print "".'ClickToDial '.$langs->trans("IdPhoneCaller").''; + print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; print ''; print ''; print "\n"; @@ -167,13 +170,13 @@ if ($_GET["id"]) print ''; print ''; } - print "".'ClickToDial '.$langs->trans("Login").''; + print 'ClickToDial '.$langs->trans("Login").''; print ''.$fuser->clicktodial_login.''; print ''; - print "".'ClickToDial '.$langs->trans("Password").''; - print ''.$fuser->clicktodial_password.''; + print 'ClickToDial '.$langs->trans("Password").''; + print ''.preg_replace('/./','*',$fuser->clicktodial_password).''; print "\n"; - print "".'ClickToDial '.$langs->trans("IdPhoneCaller").''; + print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; print ''.$fuser->clicktodial_poste.''; print "\n"; } @@ -185,7 +188,7 @@ if ($_GET["id"]) */ print '
'; - if ($user->admin && $_GET["action"] <> 'edit') + if ($user->admin && $action <> 'edit') { print ''.$langs->trans("Modify").''; } @@ -196,8 +199,7 @@ if ($_GET["id"]) } +llxFooter(); $db->close(); - -llxFooter(); ?>