unset($_SESSION['comes_from_view_time']);
     unset($_SESSION['submitted_when']);
 }
 //Brachialer Spamschutz
 include '../inc/spamfilter.inc.php';
 $hpstart = substr($thesite, 0, 7);
 if ($hpstart != 'http://') {
     $thesite = 'http://' . $thesite;
 }
 if ($thesite == 'http://') {
     $thesite = '';
 }
 $show_link = $settings['default_link'];
 $commented_when = topics_localtime();
 if ($wb->is_authenticated() == true) {
     $commented_by = $wb->get_user_id();
 } else {
     $commented_by = '';
 }
 //Sending an Email:
 $admin_email = '';
 $query_topicauthor = $database->query("SELECT email FROM " . TABLE_PREFIX . "users WHERE user_id = '" . $topicauthornr . "'");
 if ($query_topicauthor->numRows() > 0) {
     $authorfetch = $query_topicauthor->fetchRow();
     $admin_email = $authorfetch['email'];
 }
 //Der spamfilter könnte $active verändert haben, deswegen $commentextra erst hier vergeben:
 $commentextra = '';
 if ($active == 0) {
     $commentextra = rand(1000000, 9999999);
 }
Esempio n. 2
0
 if (in_array($_POST['timezone_string'], $timezone_table)) {
     $timezone_string = $_POST['timezone_string'];
 }
 // language must be 2 upercase letters only
 $language = strtoupper($wb_inst->get_post('language'));
 $language = preg_match('/^[A-Z]{2}$/', $language) ? $language : DEFAULT_LANGUAGE;
 // email should be validatet by core
 $email = $wb_inst->get_post('email') == null ? '' : $wb_inst->get_post('email');
 if (!$wb_inst->validate_email($email)) {
     $email = '';
     $errors[] = $MESSAGE['USERS_INVALID_EMAIL'];
 } else {
     // check that email is unique in whoole system
     $email = addslashes($email);
     $sql = 'SELECT COUNT(*) FROM `' . TABLE_PREFIX . 'users` ';
     $sql .= 'WHERE `user_id` <> ' . (int) $wb_inst->get_user_id() . ' AND `email` LIKE "' . $email . '"';
     if ($database->get_one($sql) > 0) {
         $errors[] = $MESSAGE['USERS_EMAIL_TAKEN'];
     }
 }
 $display_name = addslashes($wb_inst->get_post('display_name'));
 $pattern = array('/[^A-Za-z0-9@\\.\\ _-]/');
 $display_name = preg_replace($pattern, "", $display_name);
 if (strlen($display_name) < AUTH_MIN_LOGIN_LENGTH) {
     $errors[] = $MESSAGE['USERS_USERNAME_TOO_SHORT'];
 }
 // date_format must be a key from /interface/date_formats
 $date_format = $wb_inst->get_post('date_format');
 $date_format_key = str_replace(' ', '|', $date_format);
 $user_time = true;
 require_once LEPTON_PATH . '/framework/var.date_formats.php';