Exemplo n.º 1
0
         if ($mybb->input[$setting] == 1) {
             $settingsToAdd[$setting] = 1;
         } else {
             $settingsToAdd[$setting] = 0;
         }
     }
     // Register him
     $user = $TwitterConnect->register($newuser);
     // Insert options and extra data and login
     if (!$user['error']) {
         $db->update_query('users', $settingsToAdd, 'uid = ' . (int) $user['uid']);
         // Sync
         $newUser = array_merge($user, $settingsToAdd);
         $TwitterConnect->sync($newUser);
         // Login
         $TwitterConnect->login($user);
         // Redirect
         $TwitterConnect->redirect($mybb->input['redUrl'], $lang->sprintf($lang->mytwconnect_redirect_title, $user['username']), $lang->mytwconnect_redirect_registered);
     } else {
         $errors = inline_error($user['error']);
     }
 }
 $options = '';
 $settingsToBuild = array();
 // Checking if we want to sync that stuff (admin)
 $settingsToCheck = array('twavatar', 'twbio', 'twlocation');
 foreach ($settingsToCheck as $setting) {
     $tempKey = 'mytwconnect_' . $setting;
     if ($mybb->settings[$tempKey]) {
         $settingsToBuild[] = $setting;
     }