MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: tochits on 2017-05-17, 10:16:41

Title: setup-roundcube script
Post by: tochits on 2017-05-17, 10:16:41
I found a problem with /script/setup-roundcube:
Code: [Select]
...
for x in defaults.inc.php db.inc.php config.inc.php ; do
        if [ -f ${path}/config/${x} ] ; then
                'cp' -f ${path}/config/roundcube_${x} ${path}/config/${x}
                sed -i "s!mysql://roundcube:roundcube!mysql://roundcube:${pass}!g" ${path}/config/${x}
                sed -i "s!mysql://roundcube:pass!mysql://roundcube:${pass}!g" ${path}/config/${x}
                sed -i "s!mysql://roundcube:@!mysql://roundcube:${pass}!g" ${path}/config/${x}
        fi
done

chown -R apache:apache ${path}

Q1="USE roundcubemail;"
Q2="GRANT ALL ON roundcubemail.* TO roundcubemail@localhost IDENTIFIED BY '${pass}';"
Q3="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}"
...

As seen in the code above, the config files are set to use 'roundcube' but the SQL statements to grant access has the user 'roundcubemail' instead.
Title: Re: setup-roundcube script
Post by: tochits on 2017-05-17, 10:23:23
To add, this is original code from setup-roundcube.php:

Code: [Select]
        if (file_exists("{$path}/config/roundcube_config.inc.php")) {
                lxfile_cp("{$path}/config/roundcube_config.inc.php", "{$path}/config/config.inc.php");
                $cfgfile = "{$path}/config/config.inc.php";
                $content = lfile_get_contents($cfgfile);
                $content = str_replace("mysql://roundcube:roundcube", "mysql://roundcube:" . $pass, $content);
                $content = str_replace("mysql://roundcube:pass", "mysql://roundcube:" . $pass, $content);
                $content = str_replace("mysql://roundcube:@", "mysql://roundcube:" . $pass . "@", $content);
                lfile_put_contents($cfgfile, $content);
        }


        $result = $link->query("GRANT ALL ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY '{$pass}'");
        $link->query("flush privileges");

As shown, both config files and SQL grant query consistently have the user as 'roundcube'.
Title: Re: setup-roundcube script
Post by: MRatWork on 2017-05-17, 12:41:03
Will be fixed in next update.
Title: Re: setup-roundcube script
Post by: neo76 on 2017-06-02, 15:29:10
Thx in advanced!  :D