When a client of any protocol handler sends a command to initiate SSL/TLS on a connec...
[citadel.git] / webcit / static / t / aide / display_aliases.html
1 <?=("head")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
2 <div id="banner">
3 <h1><a href="javascript:load_aliases()">&#8635;</a>
4 <?_("Global email aliases")></h1>
5 </div>
6 <div id="content" class="service">
7 <?!("COND:AIDE", 1)><?_("You need to be aide to view this.")><?!("X", 1)>
8 <??("COND:AIDE", 2)>
9
10 <div id="wc_easterbunny77">
11 </div>
12
13
14 <br> ---form begins here ---<br>
15
16 <form method="POST" action="do_generic">
17         <input type="hidden" name="return_to" value="/do_template?template=aide_display_aliases">
18         <textarea name="global_aliases" id="global_aliases" VALUE=""></textarea>
19         <input type="submit" value="<?_("Save")>">
20         <input type="submit" value="<?_("Cancel")>">
21 </form>
22
23 <script type="text/javascript">
24
25 load_aliases = async() => {
26         response = await fetch("ajax_servcmd?g_cmd=LIST");
27         data = await(response.text());
28         populate_aliases(data);
29 };
30
31 function delete_alias(rowid) {
32         var row = document.getElementById(rowid);
33         row.parentNode.removeChild(row);
34         repopulate_the_box();
35 }
36
37 function populate_aliases(data) {
38         var a = "<table id=killo9867>";
39         lines = data.split("\n");
40         for (var i=1; i<lines.length && lines[i] != "000"; ++i) {
41                 config_line = lines[i].split("|");
42                 lineid = randomString(10);
43                 a +=    "<tr id=" + lineid + "><td>" + config_line[0] + "</td><td>" +
44                         config_line[1] + "</td><td>" +
45                         "<a href=\"javascript:delete_alias('" + lineid + "');\">" +
46                         "<font color=#FF0000>&#10006;</font></a></td></tr>";
47         }
48         a += "</table>";
49         document.getElementById("wc_easterbunny77").innerHTML = a;
50         repopulate_the_box();
51 }
52
53 function repopulate_the_box() {
54         newbox = "";
55         t = document.getElementById("killo9867");
56         for (row of t.rows) {
57                 newbox += row.cells[0].innerHTML + " - " + row.cells[1].innerHTML + "\n";
58         }
59         document.getElementById("global_aliases").innerHTML = newbox;
60 }
61
62 load_aliases();
63
64 </script>
65
66
67 <??("X", 2)>
68 </div>
69 </div>
70 <?=("trailing")>