} // END - if
// Load data
-$result = SQL_QUERY_ESC("SELECT `opt_in` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
-list($opt_in) = SQL_FETCHROW($result);
-
-// Free memory
-SQL_FREERESULT($result);
+if (!fetchUserData(getUserId())) {
+ // Something really bad happened
+ debug_report_bug('No user account ' . getUserId() . ' found.');
+} // END - if
// Check for mode in GET
$mode = '';
if (isGetRequestElementSet('mode')) $mode = getRequestElement('mode');
// Check for "faker"
-if (($opt_in != 'Y') && ($mode == 'new')) $mode = '';
+if ((getUserData('opt_in') != 'Y') && ($mode == 'new')) $mode = '';
switch ($mode) {
case 'new': // Start new transfer
array(postRequestElement('opt_in'), getUserId()), __FILE__, __LINE__);
// Rember for next switch() command
- $opt_in = substr(postRequestElement('opt_in'), 0, 1);
+ getUserData('opt_in') = substr(postRequestElement('opt_in'), 0, 1);
// "Settings saved..."
loadTemplate('admin_settings_saved', false, "<div class=\"member_done\">{--SETTINGS_SAVED--}</div>");
} // END - foreach
// Set current selection
- $content['allow_' . strtolower($opt_in)] = ' checked="checked"';
+ $content['allow_' . strtolower(getUserData('opt_in'))] = ' checked="checked"';
// Set 'new transfer' link according to above option
- switch ($opt_in) {
+ switch (getUserData('opt_in')) {
case 'Y':
$content['new_link'] = "<a href=\"{?URL?}/modules.php?module=login&what=transfer&mode=new\">{--TRANSFER_NOW_LINK--}</a>";
break;