예제 #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');
예제 #2
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);
예제 #3
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 {
예제 #4
0
     $invite = Table::FetchForce('invite', $id);
     ZFlow::CreateFromInvite($invite);
     Session::Set('notice', '邀请返利操作成功');
     json(null, 'refresh');
 } else {
     if ('inviteremove' == $action) {
         need_auth('admin');
         Table::UpdateCache('invite', $id, array('pay' => 'C', 'admin_id' => $login_user_id));
         Session::Set('notice', '不合法邀请记录取消成功!');
         json(null, 'refresh');
     } else {
         if ('subscriberemove' == $action) {
             need_auth('admin');
             $subscribe = Table::Fetch('subscribe', $id);
             if ($subscribe) {
                 ZSubscribe::Unsubscribe($subscribe);
                 Session::Set('notice', "邮件地址:{$subscribe['email']}退订成功");
             }
             json(null, 'refresh');
         } else {
             if ('smssubscriberemove' == $action) {
                 need_auth('admin');
                 $subscribe = Table::Fetch('smssubscribe', $id);
                 if ($subscribe) {
                     ZSMSSubscribe::Unsubscribe($subscribe['mobile']);
                     Session::Set('notice', "手机号码:{$subscribe['mobile']}退订成功");
                 }
                 json(null, 'refresh');
             } else {
                 if ('partnerremove' == $action) {
                     need_auth('market');
예제 #5
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');