|
@@ -1,4 +1,4 @@
|
|
-<?php
|
|
|
|
|
|
+<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -131,9 +131,9 @@ function materio_user_block_view($delta = '') {
|
|
if( (isset($user->roles[6]) || isset($user->roles[8])) && $user->created < strtotime('01-12-2012') ){
|
|
if( (isset($user->roles[6]) || isset($user->roles[8])) && $user->created < strtotime('01-12-2012') ){
|
|
// dsm($user, 'user');
|
|
// dsm($user, 'user');
|
|
$block['subject'] = '';
|
|
$block['subject'] = '';
|
|
-
|
|
|
|
|
|
+
|
|
$path = 'http://base.materio.com';
|
|
$path = 'http://base.materio.com';
|
|
-
|
|
|
|
|
|
+
|
|
if($language->language == 'fr')
|
|
if($language->language == 'fr')
|
|
$path .= '/index_fr.html';
|
|
$path .= '/index_fr.html';
|
|
|
|
|
|
@@ -157,7 +157,7 @@ function materio_user_form_alter(&$form, &$form_state, $form_id) {
|
|
// dsm($form);
|
|
// dsm($form);
|
|
$form['account']['pass']['#type'] = 'password';
|
|
$form['account']['pass']['#type'] = 'password';
|
|
$form['account']['pass']['#title'] = t('Password');
|
|
$form['account']['pass']['#title'] = t('Password');
|
|
-
|
|
|
|
|
|
+
|
|
$form['actions']['#type'] = "container";
|
|
$form['actions']['#type'] = "container";
|
|
$form['actions']['submit']['#value'] = t('Join');
|
|
$form['actions']['submit']['#value'] = t('Join');
|
|
|
|
|
|
@@ -172,12 +172,12 @@ function materio_user_form_alter(&$form, &$form_state, $form_id) {
|
|
}
|
|
}
|
|
if($form_id == "user_login" ){
|
|
if($form_id == "user_login" ){
|
|
// dsm($form);
|
|
// dsm($form);
|
|
-
|
|
|
|
|
|
+
|
|
$form['actions']['#type'] = "container";
|
|
$form['actions']['#type'] = "container";
|
|
// $form['actions']['submit']['#value'] = t('Join');
|
|
// $form['actions']['submit']['#value'] = t('Join');
|
|
|
|
|
|
// if( $_GET['q'] == 'node/11187' ){
|
|
// if( $_GET['q'] == 'node/11187' ){
|
|
- // $form['#submit'][] = "materio_user_user_login_form_submit";
|
|
|
|
|
|
+ // $form['#submit'][] = "materio_user_user_login_form_submit";
|
|
// }
|
|
// }
|
|
|
|
|
|
}
|
|
}
|
|
@@ -209,7 +209,7 @@ function materio_user_form_alter(&$form, &$form_state, $form_id) {
|
|
// 'fragment' => $_GET['q'] == 'node/11187' ? 'content-bottom' : '', // if we register from the membership page, then go directly to the form
|
|
// 'fragment' => $_GET['q'] == 'node/11187' ? 'content-bottom' : '', // if we register from the membership page, then go directly to the form
|
|
// )
|
|
// )
|
|
// );
|
|
// );
|
|
-
|
|
|
|
|
|
+
|
|
// $frontlink = l('continue with basic', '<front>');
|
|
// $frontlink = l('continue with basic', '<front>');
|
|
// // drupal_get_messages('status');
|
|
// // drupal_get_messages('status');
|
|
// drupal_set_message(t('Welcome, you just join materiO\'! now you can choose the membership that\'s right for you, or !link', array('!link'=>$frontlink)));
|
|
// drupal_set_message(t('Welcome, you just join materiO\'! now you can choose the membership that\'s right for you, or !link', array('!link'=>$frontlink)));
|
|
@@ -241,13 +241,13 @@ function materio_user_webform_client_111186_validate($form, &$form_state){
|
|
// TODO : tester si les email ne sont pas deja inscrit sur le site
|
|
// TODO : tester si les email ne sont pas deja inscrit sur le site
|
|
|
|
|
|
|
|
|
|
- form_set_error($field_name, t('You must provide a value for the !name field.', array('!name'=>$human_field_name)));
|
|
|
|
|
|
+ form_set_error($field_name, t('You must provide a value for the !name field.', array('!name'=>$human_field_name)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// function materio_user_webform_client_111186_submit($form, &$form_state){
|
|
// function materio_user_webform_client_111186_submit($form, &$form_state){
|
|
@@ -263,7 +263,7 @@ function materio_user_webform_client_111186_validate($form, &$form_state){
|
|
// // $field_name = 'submitted][collaborators]['.$coll_key.']['.$field_key;
|
|
// // $field_name = 'submitted][collaborators]['.$coll_key.']['.$field_key;
|
|
// // // dsm($field_name, 'field_name');
|
|
// // // dsm($field_name, 'field_name');
|
|
|
|
|
|
-// // form_set_error($field_name, t('You must provide a value for the !name field.', array('!name'=>$human_field_name)));
|
|
|
|
|
|
+// // form_set_error($field_name, t('You must provide a value for the !name field.', array('!name'=>$human_field_name)));
|
|
// // }
|
|
// // }
|
|
// // }
|
|
// // }
|
|
// $userinfo = array(
|
|
// $userinfo = array(
|
|
@@ -281,9 +281,9 @@ function materio_user_webform_client_111186_validate($form, &$form_state){
|
|
// // module_invoke_all('user_insert', $edit, $account);
|
|
// // module_invoke_all('user_insert', $edit, $account);
|
|
// $i++;
|
|
// $i++;
|
|
// }
|
|
// }
|
|
-
|
|
|
|
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
|
|
+// }
|
|
|
|
|
|
// enregistrer le type d'adonnement chez les user
|
|
// enregistrer le type d'adonnement chez les user
|
|
|
|
|
|
@@ -299,7 +299,7 @@ function materio_user_help($path, $arg) {
|
|
if($arg[1] == 11187 ){
|
|
if($arg[1] == 11187 ){
|
|
global $user;
|
|
global $user;
|
|
// dsm($user, 'user');
|
|
// dsm($user, 'user');
|
|
-
|
|
|
|
|
|
+
|
|
if(isset($user->roles[1])){ // anonyme
|
|
if(isset($user->roles[1])){ // anonyme
|
|
$message = t('Please create first a free account and join materio or log in with your existing account,<br />then we\'ll provide you our membership form.', array());
|
|
$message = t('Please create first a free account and join materio or log in with your existing account,<br />then we\'ll provide you our membership form.', array());
|
|
$content = '<p>' . $message . '</p>';
|
|
$content = '<p>' . $message . '</p>';
|
|
@@ -340,16 +340,16 @@ function _materio_user_user_update(&$edit, $account, $category){
|
|
// dsm($edit, 'edit');
|
|
// dsm($edit, 'edit');
|
|
// dsm($account, 'account');
|
|
// dsm($account, 'account');
|
|
// dsm($category, 'category');
|
|
// dsm($category, 'category');
|
|
-
|
|
|
|
|
|
+
|
|
// This is only fired when a user confirms their email address, logintoboggan style
|
|
// This is only fired when a user confirms their email address, logintoboggan style
|
|
- if (isset($account->logintoboggan_email_validated) && $account->logintoboggan_email_validated == TRUE) {
|
|
|
|
- $confirmed_rid = materio_user_get_role_by_name(MATERIO_USER_CONFIRMED_USER_ROLE);
|
|
|
|
|
|
+ if (isset($account->logintoboggan_email_validated) && $account->logintoboggan_email_validated == TRUE) {
|
|
|
|
+ $confirmed_rid = materio_user_get_role_by_name(MATERIO_USER_CONFIRMED_USER_ROLE);
|
|
$roles = $account->roles + array($confirmed_rid => MATERIO_USER_CONFIRMED_USER_ROLE);
|
|
$roles = $account->roles + array($confirmed_rid => MATERIO_USER_CONFIRMED_USER_ROLE);
|
|
-
|
|
|
|
|
|
+
|
|
// we have to do this to stop an infinite loop, and also to allow lower weighted modules to possibly do something here
|
|
// we have to do this to stop an infinite loop, and also to allow lower weighted modules to possibly do something here
|
|
$user = $account;
|
|
$user = $account;
|
|
unset($user->logintoboggan_email_validated);
|
|
unset($user->logintoboggan_email_validated);
|
|
-
|
|
|
|
|
|
+
|
|
user_save($user, array('roles' => $roles));
|
|
user_save($user, array('roles' => $roles));
|
|
|
|
|
|
drupal_go_to('user/'.$user->uid.'/edit');
|
|
drupal_go_to('user/'.$user->uid.'/edit');
|
|
@@ -367,5 +367,5 @@ function _materio_user_user_update(&$edit, $account, $category){
|
|
*/
|
|
*/
|
|
function materio_user_get_role_by_name($name) {
|
|
function materio_user_get_role_by_name($name) {
|
|
return array_search($name, user_roles());
|
|
return array_search($name, user_roles());
|
|
-}
|
|
|
|
|
|
+}
|
|
|
|
|