Bug 9008: warn if user is logged-in with admin account
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 2 Nov 2012 11:49:32 +0000 (12:49 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 5 Nov 2012 14:13:08 +0000 (09:13 -0500)
Test plan:
* log-in staff interface with admin (mysql) account => there's a large warning on the homepage
* log-in with another account => nothing displayed

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
mainpage.pl

index 38658dd..e1fe25e 100644 (file)
    <div id="bd" role="main">
     <div id="yui-main">
     <div class="yui-b"><div class="yui-g">
+    [% IF adminWarning %]
+        <div id="adminwarning"i class="alert">
+            <p>Warning: you're logged-in with the admin login. This a a bad idea, and you are likely to encounter problems.</p>
+            <p>You should <a href="/cgi-bin/koha/members/memberentry.pl?op=add">create a patron</a> and give it superlibrarian permissions.</p>
+        </div>
+    [% END %]
     <div class="yui-u first">
+
             <div id="area-list-left">
                 <ul class="biglinks-list">
                     [% IF ( CAN_user_circulate ) %]
index f834985..78daf38 100755 (executable)
@@ -60,4 +60,11 @@ $template->param(
     pendingsuggestions => $pendingsuggestions
 );
 
+#
+# warn user if he is using mysql/admin login
+#
+unless ($loggedinuser) {
+    $template->param(adminWarning => 1);
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;