- break;
-
- case 'img':
- GENERATE_IMAGE($img_code);
- break;
-
- case 'confirm':
- if ($code > 0) {
- // Export data into constants for the template
- define('_CODE_VALUE', $code);
- define('_UID_VALUE' , $url_uid );
- define('_TYPE_VALUE', $type);
- define('_DATA_VALUE', $urlId);
- define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
- if (getConfig('code_length') > 0) {
- // Generate Code
- define('_IMAGE_CODE', generateCaptchaCode($code, $type, $urlId, $url_uid));
- $templ = 'mailid_enter_code';
- } else {
- // Disabled code
- define('__GFX_CODE', $img_code);
- $templ = 'mailid_confirm_buttom';
- }
-
- // Load template
- LOAD_TEMPLATE($templ);
- }
- break;
-
- case '':
- // Ok, all data is valid and loaded. Finally let's output the timer... :-)
- // Export data into constants for the template
- define('_TIME_VALUE', $time);
- define('_TIM2_VALUE', strlen($time));
- define('_UID_VALUE' , $url_uid );
- define('_TYPE_VALUE', $type);
- define('_DATA_VALUE', $urlId);
- define('_RAND_VALUE', mt_rand(0, 99999));
- define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
-
- // Load template
- LOAD_TEMPLATE('mailid_timer');
- break;
- } // END - switch
- } else {
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (6)</div>");
- }
+ break;
+
+ case 'img':
+ generateImageOrCode($img_code);
+ break;
+
+ case 'confirm':
+ if ($code > 0) {
+ // Export data into constants for the template
+ $content['code'] = $code;
+ $content['userid'] = $userId;
+ $content['type'] = $type;
+ $content['data'] = $urlId;
+ $content['banner'] = loadTemplate('mailid_banner', true);
+ if (getConfig('code_length') > 0) {
+ // Generate Code
+ $content['image'] = generateCaptchaCode($code, $type, $urlId, $userId);
+ $templ = 'mailid_enter_code';
+ } else {
+ // Disabled code
+ $content['gfx'] = $img_code;
+ $templ = 'mailid_confirm_buttom';
+ }
+
+ // Load template
+ loadTemplate($templ, false, $content);
+ } else {
+ // Cannot confirm!
+ debug_report_bug(__FILE__, __LINE__, 'No code given.');
+ }
+ break;
+
+ case '':
+ // Ok, all data is valid and loaded. Finally let's output the timer... :-)
+ // Export data into constants for the template
+ $content['time'] = $time;
+ $content['tim2'] = strlen($time);
+ $content['userid'] = $userId;
+ $content['type'] = $type;
+ $content['data'] = $urlId;
+ $content['rand'] = mt_rand(0, 99999);
+ $content['banner'] = loadTemplate('mailid_banner', true);
+
+ // Load template
+ loadTemplate('mailid_timer', false, $content);
+ break;
+
+ default: // Unknown mode
+ debug_report_bug(__FILE__, __LINE__, 'Unknown mode ' . $mode . ' detected.');
+ break;
+ } // END - switch