Exemplo n.º 1
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
    $u = array();
    $u['username'] = $_POST['username'];
    $u['password'] = $_POST['password'];
    $u['email'] = $_POST['email'];
    if ($_POST['subscribe']) {
        ZSubscribe::Create($_POST['email'], $city['id']);
    }
    if (!Utility::ValidEmail($_POST['email'], true)) {
        Session::Set('error', 'Email is not a valid email address');
        Utility::Redirect(WEB_ROOT . '/account/signup.php');
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if ($INI['system']['emailverify']) {
            $u['enable'] = 'N';
        }
        $usergroup = Table::Fetch('user_group', 'customer', 'name');
        if (!empty($usergroup)) {
            $u['user_group_id'] = $usergroup['id'];
        }
        if ($user_id = ZUser::Create($u)) {
            if ($INI['system']['emailverify']) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                Utility::Redirect(WEB_ROOT . '/account/verify.php');
            } else {
                ZLogin::Login($user_id);
                Utility::Redirect(WEB_ROOT . '/index.php');
Exemplo n.º 2
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
    $u = array();
    $u['username'] = strval($_POST['username']);
    $u['password'] = strval($_POST['password']);
    $u['email'] = strval($_POST['email']);
    $u['city_id'] = isset($_POST['city_id']) ? abs(intval($_POST['city_id'])) : abs(intval($city['id']));
    $u['mobile'] = strval($_POST['mobile']);
    if ($_POST['subscribe']) {
        ZSubscribe::Create($u['email'], abs(intval($u['city_id'])));
    }
    if (!Utility::ValidEmail($u['email'], true)) {
        Session::Set('error', 'Email地址为无效地址');
        redirect(WEB_ROOT . '/account/signup.php');
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if (option_yes('emailverify')) {
            $u['enable'] = 'N';
        }
        if ($user_id = ZUser::Create($u)) {
            if (option_yes('emailverify')) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                redirect(WEB_ROOT . '/account/signuped.php');
            } else {
                ZLogin::Login($user_id);
                redirect(get_loginpage(WEB_ROOT . '/index.php'));
            }
        } else {
Exemplo n.º 3
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('market');
$content = file_get_contents($_FILES['upload_txt']['tmp_name']);
$emails = preg_split('/([,;\\s\\r\\n])+/', $content, -1, PREG_SPLIT_NO_EMPTY);
$city_id = abs(intval($_POST['city_id']));
$create = 0;
foreach ($emails as $one) {
    $create += ZSubscribe::Create($one, $city_id) ? 1 : 0;
}
$cityname = $allcities[$city_id];
if ($create) {
    Session::Set('notice', "导入{$create}封订阅邮件成功!");
} else {
    Session::Set('error', "导入0封订阅邮件");
}
redirect(null);
Exemplo n.º 4
0
<?php

require_once dirname(__FILE__) . '/app.php';
$tip = strval($_GET['tip']);
if ($_POST) {
    $city_id = abs(intval($_POST['city_id']));
    ZSubscribe::Create($_POST['email'], $city_id);
    cookie_city($city = Table::Fetch('category', $city_id));
    die(include template('subscribe_success'));
}
include template('subscribe');