Accès MySQL root pour les admins

tags/0.1.1
Daniel Berteaud 12 years ago
parent 7cd552118b
commit 4a60784199
  1. 1
      root/etc/e-smith/db/accounts/defaults/admin/SqlLogin
  2. 12
      root/etc/e-smith/db/accounts/migrate/98AdminSqlPass
  3. 8
      root/etc/e-smith/templates/etc/phpMyAdmin/sso.inc.php/10All
  4. 2
      root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/075phpMyadmin

@ -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());
}
}

@ -1,7 +1,7 @@
{ {
use Digest::SHA1 qw(sha1_hex);
use esmith::AccountsDB; use esmith::AccountsDB;
use esmith::util;
my $a = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB\n"; my $a = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB\n";
$OUT .= "// login and password for MySQL access\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 $user = $u->key;
my $login = $u->prop('SqlLogin') || ''; my $login = $u->prop('SqlLogin') || '';
my $pass = $u->prop('SqlPassword') || ''; 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 '')); next unless (($login ne '') && ($pass ne ''));
$OUT .= "// Credentials for $user\n"; $OUT .= "// Credentials for $user\n";
$OUT .= '$login["'.$user.'"] = "'.$login."\";\n"; $OUT .= '$login["'.$user.'"] = "'.$login."\";\n";

@ -6,7 +6,7 @@ $conf->{'exportedHeaders'}->{"sql.$domain"} = {
$conf->{'locationRules'}->{"sql.$domain"} = { $conf->{'locationRules'}->{"sql.$domain"} = {
'default' => '$groups =~ /\\badmins\\b/', 'default' => '$groups =~ /\\badmins|mysqladmins\\b/',
} unless ($conf->{'locationRules'}->{"sql.$domain"}); } unless ($conf->{'locationRules'}->{"sql.$domain"});
$conf->{'applicationList'}->{'030admin'}->{'phpmyadmin'} = { $conf->{'applicationList'}->{'030admin'}->{'phpmyadmin'} = {

Loading…
Cancel
Save