Browse Source

old database link

Signed-off-by: bachy <git@g-u-i.net>
bachy 12 years ago
parent
commit
1e40a74e1a
1 changed files with 18 additions and 0 deletions
  1. 18 0
      materio_user.module

+ 18 - 0
materio_user.module

@@ -30,6 +30,10 @@ function materio_user_block_info() {
     'info' => t('Register block'),
     'cache' => DRUPAL_NO_CACHE
   );
+  $blocks['old_database_link'] = array(
+    'info' => t('Old data base link'),
+    'cache' => DRUPAL_NO_CACHE
+  );
 
   return $blocks;
 }
@@ -46,6 +50,20 @@ function materio_user_block_view($delta = '') {
         $block['subject'] = t('Your projects will born from here');
         $block['content'] = drupal_render(drupal_get_form('user_register_form'));
       }
+      break;
+    case 'old_database_link':
+      if( (isset($user->roles[6]) || isset($user->roles[8])) && $user->created < strtotime('01-12-2012') ){
+        // dsm($user, 'user');
+        $block['subject'] = '';
+        
+        $path = 'http://base.materio.com';
+        
+        if($language->language == 'fr')
+          $path .= '/index_fr.html';
+
+        $block['content'] = l(t('return to the old database'), $path);
+      }
+      
       break;
   }
   return $block;