$sql .= returnDefault($default_lat, 'text') . ", ";
                $sql .= returnDefault($default_lng, 'text') . ", ";
                $sql .= returnDefault($default_zoom, 'text') . ", ";
                $sql .= returnDefault($activation_code, 'text') . ")";
                $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
                $new_id = $req['mysql_insert_id'];
                $defaultUserGroup = 3;
                $sql = "INSERT INTO `" . $_SESSION['Application_host'] . "`.`J_caver_group` ";
                $sql .= "(`Id_caver`, `Id_group`)";
                $sql .= " VALUES (";
                $sql .= $new_id . ", " . $defaultUserGroup . ") ";
                $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
                if (!defined('NO_PHPBB_INSTALLED')) {
                    addphpBBuser($login, $password, $contact, $language);
                }
                sendActivationMail($contact, $login, $password, $new_id, $activation_code);
                trackAction("insert_user", $new_id, "T_caver");
                $save_failed = false;
            } else {
                $choose_another_login = true;
                $save_failed = true;
            }
        } else {
            $save_failed = true;
        }
    }
}
//Connection of a user
if (isset($_POST['connection']) && !USER_IS_CONNECTED) {
    $login = isset($_POST['l_caver_login']) ? $_POST['l_caver_login'] : '';
    $password = isset($_POST['l_caver_password']) ? $_POST['l_caver_password'] : '';
Beispiel #2
0
/**
 * Sends the activation email for the user and updates the activation_code.
 * @author Raafat
 * @param  integer $user_id The unique ID of the user.
 * @return boolean True if the email was sent and false otherwise.
 */
function accountActivation($user_id)
{
    $user = getFullUserById($user_id);
    return sendActivationMail($user["email"], $user_id, updateCode($user_id));
}