MidCOM svn: r21665 - in trunk/midcom/midcom_core: services/authentication templates

bergie midcom-commits at lists.midgard-project.org
Tue Apr 7 12:21:37 CEST 2009


Author: bergie
Date: Tue Apr  7 12:21:37 2009
New Revision: 21665
URL: http://trac.midgard-project.org/changeset/21665

Log:
Pass login error message to the form


Modified:
   trunk/midcom/midcom_core/services/authentication/sessionauth.php
   trunk/midcom/midcom_core/templates/midcom-login-form.xhtml
   trunk/midcom/midcom_core/templates/midcom-show-error.xhtml

Modified: trunk/midcom/midcom_core/services/authentication/sessionauth.php
==============================================================================
--- trunk/midcom/midcom_core/services/authentication/sessionauth.php	(original)
+++ trunk/midcom/midcom_core/services/authentication/sessionauth.php	Tue Apr  7 12:21:37 2009
@@ -331,16 +331,20 @@
             }
         }
         
-        if (   is_null($this->user) 
-            || !$this->user)
-        {
-            $_MIDCOM->context->set_item('template_entry_point', 'midcom-login-form');
-            $_MIDCOM->context->set_item('cache_enabled', false);
-            $_MIDCOM->templating->template();
-            $_MIDCOM->templating->display();
-            exit();
-        }
-    
+        // Pass some data to the handler
+        $data = array();
+        $data['message'] = $exception->getMessage();
+        $data['exception'] = $exception;
+        $_MIDCOM->context->set_item('midcom_core_exceptionhandler', $data);
+        
+        // Set entry point and disable cache
+        $_MIDCOM->context->set_item('template_entry_point', 'midcom-login-form');
+        $_MIDCOM->context->set_item('cache_enabled', false);
+        
+        // Do normal templating
+        $_MIDCOM->templating->template();
+        $_MIDCOM->templating->display();
+        exit();
     }
 
 }

Modified: trunk/midcom/midcom_core/templates/midcom-login-form.xhtml
==============================================================================
--- trunk/midcom/midcom_core/templates/midcom-login-form.xhtml	(original)
+++ trunk/midcom/midcom_core/templates/midcom-login-form.xhtml	Tue Apr  7 12:21:37 2009
@@ -15,6 +15,9 @@
                     <a href="/"><img src="/midcom-static/midcom_core/midgard/midgard.gif" alt="Midgard" width="135" height="138" /></a>
                 </div>
             </header>
+            
+            <div class="errors" tal:content="midcom_core_exceptionhandler/message">Lorem ipsum</div>
+            
             <form method='post' action=''>
                 <table>
                 	<tr>

Modified: trunk/midcom/midcom_core/templates/midcom-show-error.xhtml
==============================================================================
--- trunk/midcom/midcom_core/templates/midcom-show-error.xhtml	(original)
+++ trunk/midcom/midcom_core/templates/midcom-show-error.xhtml	Tue Apr  7 12:21:37 2009
@@ -24,7 +24,7 @@
                         <img src="/midcom-static/midcom_core/midgard/error-200.png" />
                     </aside>
                     
-                    <p tal:content="midcom_core_exceptionhandler/message">Lorem ipsum</p>
+                    <div class="errors" tal:content="midcom_core_exceptionhandler/message">Lorem ipsum</div>
 
                     <ul tal:condition="midcom_core_exceptionhandler/trace">
                         <li tal:repeat="trace midcom_core_exceptionhandler/trace">


More information about the midcom-commits mailing list