Changeset 23028


Ignore:
Timestamp:
Jun 3, 2013, 9:51:59 PM (7 years ago)
Author:
Eric
Message:

Next version is 2.5.3:
Bug fixed - On new user registration, user should submit his NBM choice twice in his profile page for it to be considered

Location:
extensions/NBM_Subscriber
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBM_Subscriber/changelog.txt.php

    r22873 r23028  
    69692013-05-25:
    7070-- 2.5.2 : Add pt_PT, thanks to : ANO
     71
     722013-06-03:
     73-- 2.5.3 : Bug fixed - On new user registration, user should submit his NBM choice twice in his profile page for it to be considered
    7174*/
    7275?>
  • extensions/NBM_Subscriber/main.inc.php

    r20822 r23028  
    5353WHERE user_id = \''.$user['id'].'\'
    5454';
    55  
     55
    5656  $count = pwg_db_num_rows(pwg_query($query));
    57  
     57
    5858  if ($count == 0)
    5959  {
    6060    $inserts = array();
    6161    $check_key_list = array();
    62    
     62
    6363    // Calculate key
    6464    $nbm_user['check_key'] = find_available_check_key();
     
    6666    // Save key
    6767    array_push($check_key_list, $nbm_user['check_key']);
    68    
     68
    6969    // Insert new nbm_users
    7070    array_push
     
    7575          'user_id' => $user['id'],
    7676          'check_key' => $nbm_user['check_key'],
    77           'enabled' => 'false' // By default if false, set to true with specific functions
     77          'enabled' => $_POST['NBM_Subscription']
    7878        )
    7979    );
    8080
    81     mass_inserts(USER_MAIL_NOTIFICATION_TABLE, array('user_id', 'check_key', 'enabled'), $inserts); 
     81    mass_inserts(USER_MAIL_NOTIFICATION_TABLE, array('user_id', 'check_key', 'enabled'), $inserts);
    8282  }
    8383  elseif ($count != 0 and !empty($_POST['NBM_Subscription']) && in_array($_POST['NBM_Subscription'], array('true', 'false')))
     
    108108 
    109109  $values = $data['enabled'];
     110 
     111  if (is_null($values))
     112    $values = 'false';
    110113
    111114  $template->assign('radio_options',
    112115    array(
    113116      'true' => l10n('Yes'),
    114       'false'=> l10n('No')));
     117      'false'=> l10n('No')
     118    )
     119  );
    115120
    116121  $template->assign(
    117122    array(
    118123      'NBMS'=>$values
    119     ));
     124    )
     125  );
    120126     
    121127  $template->set_prefilter('profile_content', 'NBMS_prefilter');
Note: See TracChangeset for help on using the changeset viewer.