Example #1
0
     }
 }
 if ($all_ok) {
     //send email
     //generate random password
     $activationcode = mb_strtoupper(mb_substr(md5(uniqid('')), 0, 13));
     $country_name = tr($country);
     $uuid = create_uuid();
     if (strtotime("2008-11-01 00:00:00") <= strtotime(date("Y-m-d h:i:s"))) {
         $rules_conf_req = 1;
     } else {
         $rules_conf_req = 0;
     }
     //insert the user
     XDb::xSql("INSERT INTO `user` ( `user_id`, `username`, `password`, `email`, `latitude`,\n                                          `longitude`, `last_modified`, `login_faults`, `login_id`, `is_active_flag`,\n                                          `was_loggedin`, `country`, `date_created`,\n                                          `uuid`, `activation_code`, `node`, `rules_confirmed` )\n                    VALUES ('', ?, ?, ?, NULL, NULL, NOW(), '0', '0', '0', '0', ?, NOW(), ?, ?, ?, ?)", $username, hash('sha512', md5($password)), $email, $country, $uuid, $activationcode, $oc_nodeid, $rules_conf_req);
     EmailSender::sendActivationMessage(__DIR__ . '/tpl/stdstyle/email/user_activation.email.html', $username, $country, $activationcode, $email, $uuid);
     //display confirmationpage
     $tplname = 'register_confirm';
     tpl_set_var('country', htmlspecialchars($country_name, ENT_COMPAT, 'UTF-8'));
 } else {
     //set error strings
     if ($email_not_ok) {
         tpl_set_var('email_message', $error_email_not_ok);
     }
     if ($username_not_ok) {
         tpl_set_var('username_message', $error_username_not_ok);
     }
     if ($email_exists) {
         tpl_set_var('email_message', $error_email_exists);
     }
     if ($username_exists) {