diff --git a/root/etc/e-smith/db/accounts/defaults/admin/SqlLogin b/root/etc/e-smith/db/accounts/defaults/admin/SqlLogin deleted file mode 100644 index d8649da..0000000 --- a/root/etc/e-smith/db/accounts/defaults/admin/SqlLogin +++ /dev/null @@ -1 +0,0 @@ -root diff --git a/root/etc/e-smith/db/accounts/migrate/98AdminSqlPass b/root/etc/e-smith/db/accounts/migrate/98AdminSqlPass deleted file mode 100644 index 5f2f804..0000000 --- a/root/etc/e-smith/db/accounts/migrate/98AdminSqlPass +++ /dev/null @@ -1,12 +0,0 @@ -{ - -use esmith::util; - -my $admin = $DB->get('admin') || return; -my $pw = $admin->prop('SqlPassword'); - -unless ($pw){ - $admin->set_prop('SqlPassword', esmith::util::LdapPassword()); -} - -} diff --git a/root/etc/e-smith/templates/etc/phpMyAdmin/sso.inc.php/10All b/root/etc/e-smith/templates/etc/phpMyAdmin/sso.inc.php/10All index f510273..1a6c975 100644 --- a/root/etc/e-smith/templates/etc/phpMyAdmin/sso.inc.php/10All +++ b/root/etc/e-smith/templates/etc/phpMyAdmin/sso.inc.php/10All @@ -1,7 +1,7 @@ { -use Digest::SHA1 qw(sha1_hex); use esmith::AccountsDB; +use esmith::util; my $a = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB\n"; $OUT .= "// login and password for MySQL access\n"; @@ -10,6 +10,12 @@ foreach my $u ($a->users,$a->get('admin')){ my $user = $u->key; my $login = $u->prop('SqlLogin') || ''; my $pass = $u->prop('SqlPassword') || ''; + # Members of the admins group automatically have + # full privileges on MySQL + if (($a->is_user_in_group($user,'admins')) || ($a->is_user_in_group($user,'mysqladmins'))){ + $login = 'root'; + $pass = esmith::util::LdapPassword(); + } next unless (($login ne '') && ($pass ne '')); $OUT .= "// Credentials for $user\n"; $OUT .= '$login["'.$user.'"] = "'.$login."\";\n"; diff --git a/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/075phpMyadmin b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/075phpMyadmin index 04b2fce..f3b3136 100644 --- a/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/075phpMyadmin +++ b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/075phpMyadmin @@ -6,7 +6,7 @@ $conf->{'exportedHeaders'}->{"sql.$domain"} = { $conf->{'locationRules'}->{"sql.$domain"} = { - 'default' => '$groups =~ /\\badmins\\b/', + 'default' => '$groups =~ /\\badmins|mysqladmins\\b/', } unless ($conf->{'locationRules'}->{"sql.$domain"}); $conf->{'applicationList'}->{'030admin'}->{'phpmyadmin'} = {