[freeside-commits] freeside/rt/etc acl.mysql,1.2,1.3
Ivan,,,
ivan at wavetail.420.am
Sun Feb 19 14:40:51 PST 2012
Update of /home/cvs/cvsroot/freeside/rt/etc
In directory wavetail.420.am:/tmp/cvs-serv15920/etc
Modified Files:
acl.mysql
Log Message:
fix ancient vendor branch CVS bs
Index: acl.mysql
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/etc/acl.mysql,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- acl.mysql 15 Jul 2003 13:30:33 -0000 1.2
+++ acl.mysql 19 Feb 2012 22:40:49 -0000 1.3
@@ -1,8 +1,25 @@
+
sub acl {
+ my $db_name = RT->Config->Get('DatabaseName');
+ my $db_rthost = RT->Config->Get('DatabaseRTHost');
+ my $db_user = RT->Config->Get('DatabaseUser');
+ my $db_pass = RT->Config->Get('DatabasePassword');
+ unless ( $db_user ) {
+ print STDERR "DatabaseUser option is not defined or empty. Skipping...\n";
+ return;
+ }
+ if ( $db_user eq 'root' ) {
+ print STDERR "DatabaseUser is root. Skipping...\n";
+ return;
+ }
+ print "Granting access to $db_user\@'$db_rthost' on $db_name.\n";
+ $db_name =~ s/([_%])/\\$1/g;
return (
-"USE mysql;",
-"DELETE FROM user WHERE user = '${RT::DatabaseUser}';",
-"DELETE FROM db where db = '${RT::DatabaseName}';",
-"GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON ${RT::DatabaseName}.* TO ${RT::DatabaseUser}\@${RT::DatabaseRTHost} IDENTIFIED BY '${RT::DatabasePassword}';");
+ "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
+ ON `$db_name`.*
+ TO '$db_user'\@'$db_rthost'
+ IDENTIFIED BY '$db_pass';",
+ );
}
+
1;
More information about the freeside-commits
mailing list