[vhffs-dev] [949] Fixing the "blanked" feature on mysql passwords (well, an empty field is better then a field containing "blanked" which is a valid password ...)

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


Revision: 949
Author:   gradator
Date:     2007-09-29 16:58:21 +0000 (Sat, 29 Sep 2007)

Log Message:
-----------
Fixing the "blanked" feature on mysql passwords (well, an empty field is better then a field containing "blanked" which is a valid password ...)

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
    trunk/vhffs-panel/admin/mysql/edit.pl
    trunk/vhffs-panel/admin/mysql/edit_submit.pl
    trunk/vhffs-panel/templates/admin/mysql/edit.tmpl
    trunk/vhffs-tools/src/Makefile.am

Removed Paths:
-------------
    trunk/vhffs-tools/src/vhffs-blankmysql


Modified: trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-09-29 16:58:21 UTC (rev 949)
@@ -187,8 +187,8 @@
 {
 	my $self = shift;
 
-	my $request = $self->{'db'}->prepare("UPDATE vhffs_mysql SET dbpass='blanked' WHERE dbname='".$self->get_dbname."'") or return -1;
-    $request->execute();
+	my $request = $self->{'db'}->prepare("UPDATE vhffs_mysql SET dbpass='' WHERE dbname='".$self->get_dbname."'") or return -1;
+	$request->execute();
 	return 1;
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2007-09-29 16:58:21 UTC (rev 949)
@@ -217,7 +217,7 @@
 {   
     my $self = shift;
     
-    my $request = $self->{'db'}->prepare("UPDATE vhffs_pgsql SET dbpass='blanked' WHERE dbname='".$self->get_dbname."'") or return -1;
+    my $request = $self->{'db'}->prepare("UPDATE vhffs_pgsql SET dbpass='' WHERE dbname='".$self->get_dbname."'") or return -1;
     $request->execute();
     return 1;
 }

Modified: trunk/vhffs-panel/admin/mysql/edit.pl
===================================================================
--- trunk/vhffs-panel/admin/mysql/edit.pl	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-panel/admin/mysql/edit.pl	2007-09-29 16:58:21 UTC (rev 949)
@@ -95,7 +95,6 @@
 	$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: trunk/vhffs-panel/admin/mysql/edit_submit.pl
===================================================================
--- trunk/vhffs-panel/admin/mysql/edit_submit.pl	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-panel/admin/mysql/edit_submit.pl	2007-09-29 16:58:21 UTC (rev 949)
@@ -88,15 +88,15 @@
 {
 
 	$template = new HTML::Template( filename => $templatedir."/panel/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" ) );
-    }
+	my $pass = $cgi->param( "DBPASS" );
+	if( $pass ne '' ) {
+		$object->set_dbpassword( $pass );	
+		$object->set_status(Vhffs::Constants::WAITING_FOR_MODIFICATION);
+	} else {
+		$object->blank_password;
+		$object->set_status( $cgi->param( "STATUS" ) );
+	}
 
-
 	if( $object->commit < 0 )
 	{
 		$message = gettext("Unable to modify the object");

Modified: trunk/vhffs-panel/templates/admin/mysql/edit.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/mysql/edit.tmpl	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-panel/templates/admin/mysql/edit.tmpl	2007-09-29 16:58:21 UTC (rev 949)
@@ -20,7 +20,6 @@
 		<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>	

Modified: trunk/vhffs-tools/src/Makefile.am
===================================================================
--- trunk/vhffs-tools/src/Makefile.am	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-tools/src/Makefile.am	2007-09-29 16:58:21 UTC (rev 949)
@@ -1,6 +1,5 @@
 toolsdir = @TOOLSDIR@
 tools_SCRIPTS = \
-	vhffs-blankmysql \
 	vhffs-dumpmysql \
 	vhffs-groupdel \
 	vhffs-groupinfo \

Deleted: trunk/vhffs-tools/src/vhffs-blankmysql
===================================================================
--- trunk/vhffs-tools/src/vhffs-blankmysql	2007-09-29 16:37:31 UTC (rev 948)
+++ trunk/vhffs-tools/src/vhffs-blankmysql	2007-09-29 16:58:21 UTC (rev 949)
@@ -1,23 +0,0 @@
-#!%PERL%
-
-##############################################################################
-# This binary blank all databases password for MySQL database
-# This is a part of VHFFS distribution
-# Use as it : blank_mysql
-
-use strict;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::Constants;
-use Vhffs::Functions;
-use Vhffs::Services::Mysql;
-
-
-my $vhffs = init Vhffs::Main;
-my $objs = Vhffs::Services::Mysql::getall( $vhffs , Vhffs::Constants::ACTIVATED );
-my $obj;
-
-foreach $obj ( @{$objs} )
-{
-	$obj->blank_password;
-}


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