From 55e774f5d8d919a6142aac9bc06882de2a971f63 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 26 Oct 2016 11:34:08 -0300 Subject: [PATCH] Bug 17504: Make the installer show the right dmbs help if wrong permissions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch changes the installer template for step 2 (DB rights check) so it correctly displays MySQL-related message. The previous code was doing the wrong comparisson, thus yielding PostgreSQL documentation. To test: - Run: $ sudo koha-mysql kohadev > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev; > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost'; > FLUSH PRIVILEGES; \q - Run the webinstaller through step 2 => FAIL: You get the message in the attached screenshot - Apply the patch, reload => SUCCESS: You are displayed a different warning message, with a link to up-to-date MySQL docs on GRANT - Fix permissions for the user: $ sudo koha-mysql kohadev > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost'; > FLUSH PRIVILEGES; \q - Reload => SUCCESS: All checks are correct and you can move on - Sign off :-D Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 1191ea4f448dd9ae994cf703e8e0a4970fdbb57e) Signed-off-by: Frédéric Demians --- .../intranet-tmpl/prog/en/modules/installer/step2.tt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt index 4a02f18dd5..d7194b91b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt @@ -20,8 +20,15 @@ [% IF ( checkgrantaccess ) %]

User [% user %] has all required privileges on database [% dbname %].

[% ELSE %] -

user [% user %] doesn't have enough privilege on database [% dbname %]

-

Ask for or make a change in the user's privileges. Need help? See [% IF ( mysql ) %][% ELSE %]http://www.postgresql.org/docs/8.2/interactive/sql-createrole.html[% END %]this page. User [% user %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on [% dbname %]

+

user [% user %] doesn't have enough privilege on database [% dbname %]

+

Ask for or make a change in the user's privileges. Need help? See + [% IF dbms == 'mysql' %] + [% ELSE %] + [% END %]this page. +

+

+ User [% user %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on [% dbname %] +

[% END %] [% ELSE %]

No database named [% dbname %] detected.

-- 2.39.5