]> git.wh0rd.org Git - tt-rss.git/commitdiff
show partial access key in main instance editor, better key input checking
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Apr 2011 10:32:30 +0000 (14:32 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Apr 2011 10:32:30 +0000 (14:32 +0400)
modules/popup-dialog.php
modules/pref-instances.php

index 906e89f4f0b52d2aee21a2fe2d069a5f36673b60..f5a30a06e07eb653f3665cfd1badc2787ab71803 100644 (file)
                        print __("Access key:") . " ";
 
                        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
-                               placeHolder=\"".__("Access key")."\"
+                               placeHolder=\"".__("Access key")."\" regExp='\w{40}'
                                style=\"width: 20em\" name=\"access_key\" id=\"instance_add_key\"
                                value=\"$access_key\">";
 
index ab3d78c44bb22e23653cf0e4c4213ebbf70d7f29..45df2eb398bae5a9a59dac27643e281ab80e43dd 100644 (file)
@@ -70,7 +70,7 @@
                        print __("Access key:") . " ";
 
                        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
-                               placeHolder=\"".__("Access key")."\"
+                               placeHolder=\"".__("Access key")."\" regExp='\w{40}'
                                style=\"width: 20em\" name=\"access_key\" id=\"instance_edit_key\"
                                value=\"$access_key\">";
 
                print "<tr class=\"title\">
                        <td align='center' width=\"5%\">&nbsp;</td>
                        <td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">".__('Instance URL')."</a></td>
+                       <td width='20%'><a href=\"#\" onclick=\"updateInstanceList('access_key')\">".__('Access key')."</a></td>
                        <td width='20%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">".__('Last connected')."</a></td>
                        </tr>";
 
 
                        $onclick = "onclick='editInstance($id, event)' title='".__('Click to edit')."'";
 
+                       $access_key = mb_substr($line['access_key'], 0, 4) . '...' .
+                               mb_substr($line['access_key'], -4);
+
                        print "<td $onclick>" . htmlspecialchars($line['access_url']) . "</td>";
+                       print "<td $onclick>" . htmlspecialchars($access_key) . "</td>";
                        print "<td $onclick>" . htmlspecialchars($line['last_connected']) . "</td>";
 
                        print "</tr>";