Permalink
Browse files

Make the *webadmin module support IRC networks

  • Loading branch information...
1 parent 0f9af26 commit ee7a2083c840c56e4ec5d7002308b80d556b4daf @kylef kylef committed Aug 24, 2011
@@ -5,6 +5,7 @@
<div class="section">
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="user" value="<? VAR User ?>" />
+ <input type="hidden" name="network" value="<? VAR Network ?>" />
<? IF Edit ?><input type="hidden" name="name" value="<? VAR ChanName ?>" /><? ENDIF ?>
<h3>Channel Info</h3>
@@ -0,0 +1,108 @@
+<? INC Header.tmpl ?>
+
+<form action="<? IF Edit ?>editnetwork<? ELSE ?>addnetwork<? ENDIF ?>" method="post">
+ <? INC _csrf_check.tmpl ?>
+ <div class="section">
+ <input type="hidden" name="submitted" value="1" />
+ <input type="hidden" name="user" value="<? VAR Username ?>" />
+ <? IF Edit ?><input type="hidden" name="network" value="<? VAR Name ?>" /><? ENDIF ?>
+
+ <h3>Network Info</h3>
+ <div class="sectionbg">
+ <div class="sectionbody">
+ <div class="subsection half">
+ <div class="inputlabel">Servers:</div>
+ <div><textarea name="servers" cols="70" rows="5"><? LOOP ServerLoop ?><? VAR Server ?>
+<? ENDLOOP ?>
+</textarea></div>
+ <br /><span class="info">One server per line, host [[+]port] [password]</span>
+ </div>
+ <div style="clear: both;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="section">
+ <h3>Channels</h3>
+ <? IF !Edit ?>
+ <span class="info">You will be able to add + modify channels here after you created the network.</span><br />
+ <? ELSE ?>
+ <div class="sectionbg">
+ <div class="sectionbody">
+ <table>
+ <thead>
+ <tr>
+ <td>[<a href="addchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Name ESC=URL ?>">Add</a>]</td>
+ <? IF ChannelLoop ?>
+ <td>Save</td>
+ <td>Name</td>
+ <td>CurModes</td>
+ <td>DefModes</td>
+ <td>BufferCount</td>
+ <td>Options</td>
+ <? ELSE ?>
+ <td>&nbsp;&nbsp;&lt;- Add a channel (opens in same page)&nbsp;&nbsp;</td>
+ <? ENDIF ?>
+ </tr>
+ </thead>
+
+ <tbody>
+ <? LOOP ChannelLoop SORTASC=Name ?>
+ <tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
+ <td>
+ <input type="hidden" name="channel" value="<? VAR Name ?>" />
+ [<a href="editchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>">Edit</a>] [<a href="delchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>">Del</a>]
+ </td>
+ <td><input type="checkbox" name="save_<? VAR Name ?>"<? IF InConfig ?> checked="checked"<? ENDIF ?> /></td>
+ <td><? VAR Name ?></td>
+ <td><? VAR CurModes ?></td>
+ <td><? VAR DefModes ?></td>
+ <td><? VAR BufferCount ?></td>
+ <td><? VAR Options ?></td>
+ </tr>
+ <? ENDLOOP ?>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <? ENDIF ?>
+ </div>
+
+ <div class="section">
+ <h3>Modules</h3>
+ <div class="sectionbg">
+ <div class="sectionbody">
+ <table>
+ <thead>
+ <tr>
+ <td>Name</td>
+ <td>Arguments</td>
+ <td>Description</td>
+ </tr>
+ </thead>
+ <tbody>
+
+ <? LOOP ModuleLoop ?>
+ <tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
+ <td class="mod_name">
+ <input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
+ </td>
+ <td class="mod_args">
+ <? IF Disabled ?><? VAR Args ?><? ELSE ?><input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /><? ENDIF ?>
+ </td>
+ <td class="mod_descr"><? VAR Description ?></td>
+ </tr>
+ <? ENDLOOP ?>
+
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+
+ <div class="submitline">
+ <input type="submit" value="<? IF Edit ?>Save<? ELSE ?>Add Network<? ENDIF ?>" />
+ </div>
+</form>
+
+<? INC Footer.tmpl ?>
@@ -99,15 +99,6 @@
</div>
<div style="clear: both;"></div>
- <div class="subsection half">
- <div class="inputlabel">Servers:</div>
- <div><textarea name="servers" cols="70" rows="5"><? LOOP ServerLoop ?><? VAR Server ?>
-<? ENDLOOP ?>
-</textarea></div>
- <br /><span class="info">One server per line, host [[+]port] [password]</span>
- </div>
- <div style="clear: both;"></div>
-
<div class="subsection">
<div class="inputlabel">Active:</div>
<div class="checkbox"><input type="checkbox" name="doconnect" id="doconnect_checkbox"<? IF IRCConnectEnabled ?> checked="checked"<? ENDIF ?> />
@@ -120,81 +111,71 @@
</div>
<div class="section">
- <h3>Modules</h3>
+ <h3>Networks</h3>
+ <? IF !Edit ?>
+ <span class="info">You will be able to add + modify networks here after you created the user.</span><br />
+ <? ELSE ?>
<div class="sectionbg">
<div class="sectionbody">
<table>
<thead>
<tr>
+ <td>[<a href="addnetwork?user=<? VAR Username ESC=URL ?>">Add</a>]</td>
+ <? IF NetworkLoop ?>
<td>Name</td>
- <td>Arguments</td>
- <td>Description</td>
+ <? ELSE ?>
+ <td>&nbsp;&nbsp;&lt;- Add a network (opens in same page)&nbsp;&nbsp;</td>
+ <? ENDIF ?>
</tr>
</thead>
- <tbody>
- <? LOOP ModuleLoop ?>
+ <tbody>
+ <? LOOP NetworkLoop SORTASC=Name ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
- <td class="mod_name">
- <input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
- </td>
- <td class="mod_args">
- <? IF Disabled ?><? VAR Args ?><? ELSE ?><input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /><? ENDIF ?>
+ <td>
+ <input type="hidden" name="network" value="<? VAR Name ?>" />
+ [<a href="editnetwork?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Name ESC=URL ?>">Edit</a>] [<a href="delnetwork?user=<? VAR Username ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>">Del</a>]
</td>
- <td class="mod_descr"><? VAR Description ?></td>
+ <td><? VAR Name ?></td>
</tr>
- <? ENDLOOP ?>
-
+ <? ENDLOOP ?>
</tbody>
</table>
</div>
</div>
+ <? ENDIF ?>
</div>
<div class="section">
- <h3>Channels</h3>
- <? IF !Edit ?>
- <span class="info">You will be able to add + modify channels here after you created the user.</span><br />
- <? ELSE ?>
+ <h3>Modules</h3>
<div class="sectionbg">
<div class="sectionbody">
<table>
<thead>
<tr>
- <td>[<a href="addchan?user=<? VAR Username ESC=URL ?>">Add</a>]</td>
- <? IF ChannelLoop ?>
- <td>Save</td>
<td>Name</td>
- <td>CurModes</td>
- <td>DefModes</td>
- <td>BufferCount</td>
- <td>Options</td>
- <? ELSE ?>
- <td>&nbsp;&nbsp;&lt;- Add a channel (opens in same page)&nbsp;&nbsp;</td>
- <? ENDIF ?>
+ <td>Arguments</td>
+ <td>Description</td>
</tr>
</thead>
-
<tbody>
- <? LOOP ChannelLoop SORTASC=Name ?>
+
+ <? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
- <td>
- <input type="hidden" name="channel" value="<? VAR Name ?>" />
- [<a href="editchan?user=<? VAR Username ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>">Edit</a>] [<a href="delchan?user=<? VAR Username ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>">Del</a>]
+ <td class="mod_name">
+ <input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
</td>
- <td><input type="checkbox" name="save_<? VAR Name ?>"<? IF InConfig ?> checked="checked"<? ENDIF ?> /></td>
- <td><? VAR Name ?></td>
- <td><? VAR CurModes ?></td>
- <td><? VAR DefModes ?></td>
- <td><? VAR BufferCount ?></td>
- <td><? VAR Options ?></td>
+ <td class="mod_args">
+ <? IF Disabled ?><? VAR Args ?><? ELSE ?><input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /><? ENDIF ?>
+ </td>
+ <td class="mod_descr"><? VAR Description ?></td>
</tr>
- <? ENDLOOP ?>
+ <? ENDLOOP ?>
+
</tbody>
</table>
</div>
</div>
- <? ENDIF ?>
</div>
<div class="section">
@@ -11,9 +11,8 @@
<tr>
<td>Action</td>
<td>Username</td>
+ <td>Networks</td>
<td>Clients</td>
- <td>Current Server</td>
- <td>IRC Nick</td>
</tr>
</thead>
@@ -27,9 +26,8 @@
</span>
</td>
<td><? VAR Username ?></td>
+ <td><? VAR Networks ?></td>
<td><? VAR Clients ?></td>
- <td><? VAR Server DEFAULT="-N/A-" ?></td>
- <td><? VAR IRCNick ?></td>
</tr>
<?ENDLOOP?>
</tbody>
@@ -17,15 +17,19 @@
<th>Total Users</th>
<td><? VAR TotalUsers ?></td>
</tr>
- <tr class="oddrow">
- <th>Attached Users</th>
- <td><? VAR AttachedUsers ?></td>
+ <tr class="oddrow">
+ <th>Total Networks</th>
+ <td><? VAR TotalNetworks ?></td>
</tr>
<tr class="evenrow">
+ <th>Attached Networks</th>
+ <td><? VAR AttachedNetworks ?></td>
+ </tr>
+ <tr class="oddrow">
<th>Total Client Connections</th>
<td><? VAR TotalCConnections ?></td>
</tr>
- <tr class="oddrow">
+ <tr class="evenrow">
<th>Total IRC Connections</th>
<td><? VAR TotalIRCConnections ?></td>
</tr>
Oops, something went wrong.

0 comments on commit ee7a208

Please sign in to comment.