Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

New: [ task #181 ] Hide password of click2dial in user card

  • Loading branch information...
commit 7fc3fb5827c9d2e83b736059641f60bf3a16f4d6 1 parent 915bc47
@eldy eldy authored
Showing with 23 additions and 20 deletions.
  1. +1 −0  ChangeLog
  2. +22 −20 htdocs/user/clicktodial.php
View
1  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:
View
42 htdocs/user/clicktodial.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 @@
$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 @@
* 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 @@
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 @@
print '</td>';
print '</tr>';
- // Nom
+ // Name
print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
- print '<td colspan="2">'.$fuser->nom.'</td>';
+ print '<td colspan="2">'.$fuser->lastname.'</td>';
print "</tr>\n";
// Prenom
print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
- print '<td colspan="2">'.$fuser->prenom.'</td>';
+ print '<td colspan="2">'.$fuser->name.'</td>';
print "</tr>\n";
print "</table>\n";
print "<br>\n";
- if ($_GET["action"] == 'edit')
+ if ($action == 'edit')
{
print '<form action="clicktodial.php?id='.$_GET["id"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -115,7 +118,7 @@
if ($user->admin)
{
- print "<tr>".'<td width="25%" valign="top">ClickToDial URL</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial URL</td>';
print '<td class="valeur">';
if (empty($conf->global->CLICKTODIAL_URL))
{
@@ -127,17 +130,17 @@
print '</tr>';
}
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
print '<td class="valeur">';
print '<input name="login" value="'.$fuser->clicktodial_login.'"></td>';
print '</tr>';
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
print '<td class="valeur">';
print '<input name="password" value="'.$fuser->clicktodial_password.'"></td>';
print "</tr>\n";
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
print '<td class="valeur">';
print '<input name="poste" value="'.$fuser->clicktodial_poste.'"></td>';
print "</tr>\n";
@@ -167,13 +170,13 @@
print '</td>';
print '</tr>';
}
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
print '<td class="valeur">'.$fuser->clicktodial_login.'</td>';
print '</tr>';
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
- print '<td class="valeur">'.$fuser->clicktodial_password.'</a></td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
+ print '<td class="valeur">'.preg_replace('/./','*',$fuser->clicktodial_password).'</a></td>';
print "</tr>\n";
- print "<tr>".'<td width="25%" valign="top">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
+ print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
print '<td class="valeur">'.$fuser->clicktodial_poste.'</td>';
print "</tr></table>\n";
}
@@ -185,7 +188,7 @@
*/
print '<div class="tabsAction">';
- if ($user->admin && $_GET["action"] <> 'edit')
+ if ($user->admin && $action <> 'edit')
{
print '<a class="butAction" href="clicktodial.php?id='.$fuser->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>';
}
@@ -196,8 +199,7 @@
}
+llxFooter();
$db->close();
-
-llxFooter();
?>
Please sign in to comment.
Something went wrong with that request. Please try again.