[vhffs-dev] [383] Admins can now modify mysql db passwords

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 383
Author:   beuss
Date:     2006-12-22 08:08:15 +0000 (Fri, 22 Dec 2006)

Log Message:
-----------
Admins can now modify mysql db passwords

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-panel/admin/mysql/edit.pl
    branches/vhffs_4.1/vhffs-panel/admin/mysql/edit_submit.pl
    branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/edit.tmpl


Modified: branches/vhffs_4.1/vhffs-panel/admin/mysql/edit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mysql/edit.pl	2006-12-22 06:59:36 UTC (rev 382)
+++ branches/vhffs_4.1/vhffs-panel/admin/mysql/edit.pl	2006-12-22 08:08:15 UTC (rev 383)
@@ -94,6 +94,7 @@
 	$template->param( TEXT_DBNAME => gettext("Servername") );
 	$template->param( TEXT_DBUSER => gettext("User") );
 	$template->param( TEXT_DBPASS => gettext("Password") );
+    $template->param( INFO_DBPASS => gettext("Password will not be modified if it is set to 'blanked' or empty") );
 	$template->param( TEXT_GROUP => gettext("Group") );
 	$template->param( TEXT_OWNER => gettext("Owner") );
 	$template->param( TEXT_STATUS => gettext("Status") );

Modified: branches/vhffs_4.1/vhffs-panel/admin/mysql/edit_submit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mysql/edit_submit.pl	2006-12-22 06:59:36 UTC (rev 382)
+++ branches/vhffs_4.1/vhffs-panel/admin/mysql/edit_submit.pl	2006-12-22 08:08:15 UTC (rev 383)
@@ -88,10 +88,15 @@
 {
 
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    my $pass = $cgi->param( "DBPASS" );
+    if( $pass ne '' && $pass ne 'blanked' ) {
+        $object->set_dbpassword($pass);
+        $object->set_status(Vhffs::Constants::WAITING_FOR_MODIFICATION);
+    } else {
+    	$object->set_status( $cgi->param( "STATUS" ) );
+    }
 
-	$object->set_status( $cgi->param( "STATUS" ) );
 
-
 	if( $object->commit < 0 )
 	{
 		$message = gettext("Unable to modify the object");

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/edit.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/edit.tmpl	2006-12-22 06:59:36 UTC (rev 382)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/edit.tmpl	2006-12-22 08:08:15 UTC (rev 383)
@@ -2,16 +2,16 @@
 
 <form method="post" action="edit_submit.pl">
 	<p>
-		<label for="DBNAME">		
+		<label>		
 			<TMPL_VAR NAME="TEXT_DBNAME">
 		</label>
-		<input type="text" name="DBNAME" id="DBNAME" value="<TMPL_VAR NAME="VALUE_DBNAME">" />
+		<TMPL_VAR NAME="VALUE_DBNAME">
 	</p>
 	<p>
-		<label for="DBUSER">	
+		<label>	
 		<TMPL_VAR NAME="TEXT_DBUSER">
 		</label>
-		<input type="text" name="DBUSER" id="DBUSER"  value="<TMPL_VAR NAME="VALUE_DBUSER">" />
+		<TMPL_VAR NAME="VALUE_DBUSER">
 	</p>
 	<p>
 		<label for="DBPASS">	
@@ -19,17 +19,20 @@
 		</label>
 		<input type="text" name="DBPASS"  id="DBPASS" value="<TMPL_VAR NAME="VALUE_DBPASS">" />
 	</p>
+    <p>
+        <em><TMPL_VAR NAME="INFO_DBPASS"></em>
+    </p>
 	<p>
-		<label for="OWNER">	
+		<label>	
 		<TMPL_VAR NAME="TEXT_OWNER">
 		</label>
-		<input type="text" name="OWNER"  id="OWNER" value="<TMPL_VAR NAME="VALUE_OWNER">" />
+		<TMPL_VAR NAME="VALUE_OWNER">
 	</p>
 	<p>
-		<label for="GROUP">	
+		<label>	
 		<TMPL_VAR NAME="TEXT_GROUP">
 		</label>
-		<input type="text" name="GROUP" id="GROUP"  value="<TMPL_VAR NAME="VALUE_GROUP">" />
+		<TMPL_VAR NAME="VALUE_GROUP">
 	</p>
 	<p>
 		<label for="STATUS">	


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/