diff --git example/dialog_example.module example/dialog_example.module
index 1e44ce5..5d6a221 100644
--- example/dialog_example.module
+++ example/dialog_example.module
@@ -35,12 +35,22 @@ function dialog_example_menu() {
 }
 
 function dialog_example_page() {
+  global $user;
+
   dialog_add_js();
+  $output = '';
   $links = array();
   $links[] = l('Simple test', 'dialog/nojs/example', array('attributes' => array('class' => 'ctools-use-dialog')));
-  $links[] = l('User login', 'user/login/nojs', array('attributes' => array('class' => 'ctools-use-dialog')));
-  $links[] = l('User registration', 'user/register/nojs', array('attributes' => array('class' => 'ctools-use-dialog')));
-  return theme('item_list', $links);
+
+  // Show login/ register only to anonymous users.
+  if (!$user->uid) {
+    $links[] = l('User login', 'user/login/nojs', array('attributes' => array('class' => 'ctools-use-dialog')));
+    $links[] = l('User registration', 'user/register/nojs', array('attributes' => array('class' => 'ctools-use-dialog')));
+  }
+  else {
+    $output = t('<a href="@logout">Logout</a> in order to be able to login or register using Dialog.', array('@logout' => url('logout', array('query' => array('destination' => 'dialog/example')))));
+  }
+  return $output . theme('item_list', $links);
 }
 
 function dialog_example_ajax_callback($ajax = FALSE) {
@@ -51,7 +61,7 @@ function dialog_example_ajax_callback($ajax = FALSE) {
       'position' => 'center',
     );
     dialog_ajax_render('test', dialog_example_page(), $options);
-    return;    
+    return;
   }
 
   return 'hello world';
@@ -90,7 +100,7 @@ function dialog_login_callback($type, $js) {
         if ($command['command'] == 'dialog_display') {
           $output[$i]['options']['height'] = 'auto';
           $output[$i]['options']['width'] = 600;
-          
+
           $output[$i]['options']['position'] = 'center';
           $output[$i]['options']['resizable'] = FALSE;
         }
@@ -110,5 +120,5 @@ function dialog_example_form_alter(&$form, $form_state, $form_id) {
   elseif ($form_id == 'user_register' && !empty($form_state['ajax'])) {
     $form['submit']['#attributes']['class'] = 'ctools-dialog-button';
   }
-  
+
 }
\ No newline at end of file
