Exemplo n.º 1
0
 $email_changed = $current_User->get('email') != $email;
 // check if we really needs to send a new validation email
 if (!$email_changed) {
     // the email was not changed
     $last_activation_email_date = $UserSettings->get('last_activation_email', $current_User->ID);
     if (!empty($last_activation_email_date)) {
         // at least one validation email was sent
         // convert date to timestamp
         $last_activation_email_ts = mysql2timestamp($last_activation_email_date);
         $activate_requests_limit = $Settings->get('activate_requests_limit');
         if ($servertimenow - $last_activation_email_ts < $activate_requests_limit) {
             // a validation email was sent to the same email address less then the x seconds, where x is the "Activation requests limit" value
             // get difference between local time and server time
             $time_difference = $Settings->get('time_difference');
             // get last activation email local date and time
             $last_email_date = date(locale_datetimefmt(), $last_activation_email_ts + $time_difference);
             $Messages->add(sprintf(T_("We have already sent you an activation message to %s at %s. Please allow %d minutes for delivery before requesting a new one."), $email, $last_email_date, $activate_requests_limit / 60));
         }
     }
 }
 // Call plugin event to allow catching input in general and validating own things from DisplayRegisterFormFieldset event
 $Plugins->trigger_event('ValidateAccountFormSent');
 if ($Messages->has_errors()) {
     break;
 }
 if ($email_changed) {
     // Update user's email:
     $current_User->set_email($email);
     if (!$current_User->dbupdate()) {
         // email address couldn't be updated
         $Messages->add(T_('Could not update your email address.'), 'error');
Exemplo n.º 2
0
        // show errors
        init_system_check(T_('Blog\'s cache errors'), implode('<br />', $error_messages));
        disp_system_check('error');
    }
}
$block_item_Widget->disp_template_raw('block_end');
/*
 * Time
 */
$block_item_Widget->title = T_('Time');
$block_item_Widget->disp_template_replaced('block_start');
init_system_check(T_('Server time'), date_i18n(locale_datetimefmt(' - '), $servertimenow));
disp_system_check('note');
init_system_check(T_('GMT / UTC time'), gmdate(locale_datetimefmt(' - '), $servertimenow));
disp_system_check('note');
init_system_check(T_('b2evolution time'), date_i18n(locale_datetimefmt(' - '), $localtimenow));
disp_system_check('note');
$block_item_Widget->disp_template_raw('block_end');
/*
 * MySQL Version
 */
$block_item_Widget->title = 'MySQL';
$block_item_Widget->disp_template_replaced('block_start');
// Version:
init_system_check(T_('MySQL version'), $DB->version_long);
if (version_compare($system_stats['db_version'], $required_mysql_version['application']) < 0) {
    disp_system_check('error', sprintf(T_('This version is too old. The minimum recommended MySQL version is %s.'), $required_mysql_version['application']));
} else {
    disp_system_check('ok');
}
// UTF8 support?