ispman/ispman-web/cgi-bin/tmpl/vhosts add.tmpl,1.15,1.16

[email protected]
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/ispman-web/cgi-bin/tmpl/vhosts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12464/ispman-web/cgi-bin/tmpl/vhosts

Modified Files:
	add.tmpl 
Log Message:
upgrade to new vhost logdir/statdir style
some form redesign

Index: add.tmpl
===================================================================
RCS file: /cvsroot/ispman/ispman/ispman-web/cgi-bin/tmpl/vhosts/add.tmpl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- add.tmpl	6 Feb 2004 22:18:43 -0000	1.15
+++ add.tmpl	14 Feb 2004 19:23:05 -0000	1.16
@@ -1,31 +1,65 @@
-<LINK HREF="<perl>$ispman->getConfig('ispmanUrlPrefix')</perl>/ispman.css" REL="stylesheet" TYPE="text/css">
+<script type="text/javascript" language="JavaScript">
+<!--
+        function check_input(){
+	    homedir = document.addvhost.homeDirectory.value;
+	    docroot = document.addvhost.ispmanVhostDocumentRoot.value;
+	    scriptdir = document.addvhost.ispmanVhostScriptDir.value;
+	    logdir = document.addvhost.ispmanVhostLogdir.value;
+	    statdir = document.addvhost.ispmanVhostStatdir.value;
+	    
+	    rc = true;
+	    
+	    if (homedir==""){
+		alert('<perl>_("vhost homedirectory is empty!")</perl>');
+		rc = false;
+	    }
+	    
+	    if (docroot==""){
+		alert('<perl>_("DocumentRoot is empty")</perl>');
+		rc = false;
+	    }
+	    
+	    if (scriptdir==""){
+		alert('<perl>_("ScriptDirectory is empty")</perl>');
+		rc = false;
+	    }
+	    
+	    if (logdir==""){
+		alert('<perl>_("LogDirectory is empty")</perl>');
+		rc = false;
+	    }
+	    
+	    if (statdir==""){
+		alert('<perl>_("StatDirectory is empty")</perl>');
+		rc = false;
+	    }
 
-   
-<b>Please note:
-DocumentRoot, ScriptDirectory, LogDirectory and StatDirectory are relative to <br>
-<perl>join '/', ($ispman->getConf("defaultHomeDirectoryPath"),  $r->param('ispmanDomain'), "vhosts")</perl>/<BR>
-if they do not begin with a /.<BR>
-It is safe to take the default values.
-</b>
-<p>
+	    return rc;
+	}
+//-->
+</script>
+
+<form name="addvhost" onsubmit="return check_input();" action="<perl>$ispman->getConfig('ispmanUrlPrefix')</perl>/admin/index.cgi" method="POST">
+
+<perl>
+   $substmap={	
+       vhost => $r->param("ispmanVhostName"),
+       domain => $r->param("ispmanDomain")};
+
+   "Adding vhost: ".$r->param("ispmanVhostName").".".$r->param("ispmanDomain")
+</perl>
+<hr>
 
 <table border=0>
-<form action="<perl>$ispman->getConfig('ispmanUrlPrefix')</perl>/admin/index.cgi" method="POST">
 <tr>
     <td>IP address </td>
     <td>
-        <input  size=35 type=text  name=ispmanVhostIpAddress value="<perl>$ispman->getConf("apacheVhostsIP")</perl>">
-    </td>
-</tr>
-<tr>
-    <td>Virtualhost name </td>
-    <td>
-        <input  size=35 type=text name=ispmanVhostName value="<perl>$r->param("ispmanVhostName")</perl>">
+        <input type=text name=ispmanVhostIpAddress value="<perl>$ispman->getConf("apacheVhostsIP")</perl>">
     </td>
 </tr>
 
 <tr>
-    <td valign=center>Create vhost  on server</td>
+    <td valign=center>Create vhost on server</td>
     <td>
         <select name="webHost" MULTIPLE>
         <perl>
@@ -80,14 +114,21 @@
 </tr>
 
 <tr>
-    <td>DocumentRoot </td>
+    <td>Vhost's Home</td>
     <td>
-        <input  size=35 type=text name=ispmanVhostDocumentRoot value="<perl>join '/', ($r->param('ispmanVhostName'), 'htdocs')</perl>">
+        <input size=35 type=text name=homeDirectory value="<perl>join '/', ($ispman->getConf("defaultHomeDirectoryPath"), $r->param("ispmanDomain"), "vhosts", $r->param("ispmanVhostName"))</perl>">
     </td>
 </tr>
 
 <tr>
-    <td>DocumentRoot directory options </td>
+    <td>DocumentRoot*</td>
+    <td>
+        <input size=35 type=text name=ispmanVhostDocumentRoot value="htdocs">
+    </td>
+</tr>
+
+<tr>
+    <td>DocumentRoot directory options</td>
     <td>
         <select name=ispmanVhostDocumentRootOption MULTIPLE>
 	<option value="Indexes" selected>Show Indexes in Directories</option>
@@ -100,9 +141,9 @@
 </tr>
 
 <tr>
-    <td>ScriptDirectory (/cgi-bin/) </td>
+    <td>ScriptDirectory (/cgi-bin/)* </td>
     <td>
-        <input size=35 type=text name=ispmanVhostScriptDir value="<perl>join '/', ($r->param('ispmanVhostName'), 'cgi-bin')</perl>">
+        <input size=35 type=text name=ispmanVhostScriptDir value="cgi-bin">
     </td>
 </tr>
 
@@ -129,31 +170,35 @@
 </tr>
 
 <tr>
-    <td>Log Directory </td>
+    <td>Log Directory*</td>
     <td>
         <perl>
-          if (lc($ispman->getConf('apacheLogsDirectory')) eq 'none') {
-            $logdir = join '/', ($r->param("ispmanVhostName"), "logs");
-          } else {
-            $logdir = $ispman->getConf('apacheLogsDirectory');
+          if ($ispman->getConf('apacheLogsDirectory')) {
+            $logdir = $ispman->substitute(
+                  $ispman->getConf('apacheLogsDirectory'),
+		  $substmap);
+          } else {	
+            $logdir = "logs";
           }
-          $logdir
+          ""
         </perl>
-        <input size=35 type=hidden name=ispmanVhostLogdir value="<perl> $logdir</perl>">
+        <input size=35 name=ispmanVhostLogdir value="<perl>$logdir</perl>">
     </td>
 </tr>
 <tr>    
-    <td>Stats Directory (/stats/) </td>
+    <td>Stats Directory (/stats/)*</td>
     <td>
         <perl>
-          if (lc($ispman->getConf('apacheStatDirectory')) eq 'none') {
-            $statdir = join "/", ($r->param("ispmanVhostName"), "stats");
+          if ($ispman->getConf('apacheStatDirectory')) {
+            $statdir = $ispman->substitute(
+	          $ispman->getConf('apacheStatDirectory'),
+		  $substmap);
           } else {
-            $statdir = $ispman->getConf('apacheStatDirectory');
+            $statdir = "stats";
           }
-          $statdir
+          ""
         </perl>
-        <input size=35 type=hidden name=ispmanVhostStatdir value="<perl> $statdir</perl>">
+        <input size=35 name=ispmanVhostStatdir value="<perl>$statdir</perl>">
     </td>
 </tr>
 <tr>
@@ -188,17 +233,19 @@
     </td>
 </tr>
 
-
-
-
+<tr><td align=left colspan=2>  
         <input type=hidden name="mode" value="newVhost">
+	<input type=hidden name="ispmanVhostName" value="<perl>$r->param("ispmanVhostName")</perl>">
         <input type=hidden name="ispmanDomain" value="<perl>$r->param("ispmanDomain")</perl>">
-        
-   <tr><td align=left colspan=2>  
-         <input type=button class="button" onClick="document.forms[0].reset()" value="Reset">
-         <input type=button class="button" onClick="document.forms[0].submit()" value="Add">
-      </td></tr>
-   </form></table>
+        <input type="reset" class="button" value="Reset">
+        <input type="submit" class="button" value="Add">
+</td></tr>
+
+</table>
+</form>
+<hr>
+<b>*) paths without leading "/" are relative to vhost's home.</b>
+
  
  
 



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.