Example #1
1
function login_receive()
{
    login_check();
    if (isset($_GET['lostpassword'])) {
        login_password_recovery_receive();
    }
    if (isset($_GET['reg']) && isset($_POST['upsign'])) {
        user_register();
    }
}
Example #2
0
function registration($login, $password1, $password2, $email)
{
    //++
    $verification_data_err = verification_reg_data($login, $password1, $password2, $email);
    if ($verification_data_err) {
        $feedback = $verification_data_err;
    } else {
        $password = $password1;
        prepare_reg_data(&$login, &$password, &$email);
        $salt = salting();
        $hash = crypt($password, $salt);
        $feedback = user_register($login, $hash, $salt, $email);
    }
    return $feedback;
}
Example #3
0
        if (!empty($role)) {
            $role_perms = explode(',', $role['perms']);
        }
        $user_perms = explode(',', $item['perms']);
    }
    if ($_W['isajax'] && $_W['ispost']) {
        $data = array('uniacid' => $_W['uniacid'], 'username' => trim($_GPC['username']), 'realname' => trim($_GPC['realname']), 'mobile' => trim($_GPC['mobile']), 'password' => user_hash($_GPC['password'], random(8)), 'roleid' => intval($_GPC['roleid']), 'status' => intval($_GPC['status']), 'perms' => is_array($_GPC['perms']) ? implode(',', $_GPC['perms']) : '');
        if (!empty($id)) {
            user_update(array('uid' => $data['uid'], 'password' => $_GPC['password']));
            pdo_update('ewei_shop_perm_user', $data, array('id' => $id, 'uniacid' => $_W['uniacid']));
            plog('perm.user.edit', "编辑操作员 ID: {$id} 用户名: {$data['username']} ");
        } else {
            if (user_check(array('username' => $data['username']))) {
                die(json_encode(array('result' => 0, 'message' => '非常抱歉,此用户名已经被注册,你需要更换注册名称!')));
            }
            $data['uid'] = user_register(array('username' => $data['username'], 'password' => $_GPC['password']));
            pdo_insert('ewei_shop_perm_user', $data);
            pdo_insert('uni_account_users', array('uid' => $data['uid'], 'uniacid' => $data['uniacid'], 'role' => 'operator'));
            $id = pdo_insertid();
            plog('perm.user.add', "添加操作员 ID: {$id} 用户名: {$data['username']} ");
        }
        die(json_encode(array('result' => 1)));
    }
} elseif ($operation == 'delete') {
    ca('perm.user.delete');
    $id = intval($_GPC['id']);
    $item = pdo_fetch("SELECT id,uid,username FROM " . tablename('ewei_shop_perm_user') . " WHERE id = '{$id}'");
    if (empty($item)) {
        message('抱歉,操作员不存在或是已经被删除!', $this->createPluginWebUrl('perm/user', array('op' => 'display')), 'error');
    }
    pdo_delete('users', array('uid' => $item['uid']));
Example #4
0
        $error = '<div style="margin-top:-10px;margin-left:10px;">Your password needs to be <br>atleast 5 characters</div>';
        include 'index.php';
        exit;
    }
    // Check if the passwords match
    if ($_POST['email'] != $_POST['confirmemail']) {
        // Reshow the form with an error
        $error = 'Your emails do not match';
        include 'index.php';
        exit;
    }
    $username = $_POST['username'];
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE username = '******'"))) {
        $error = 'The username already exists';
        include 'index.php';
        exit;
    }
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE email = '{$email}'"))) {
        $error = 'The email already exists';
        include 'index.php';
        exit;
    }
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE youtubeUserName = '******'"))) {
        $error = 'The youtube name already exists';
        include 'index.php';
        exit;
    }
    // Everything is ok, register
    user_register($_POST['username'], $_POST['password'], $_POST['email'], $_POST['youtubeUserName']);
    header('Location: index.php?f=sf');
}
Example #5
0
            $subject = $lang_module['account_register'];
            $message = sprintf($lang_module['account_register_info'], $array_register['first_name'], $global_config['site_name'], NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true), $array_register['username']);
            nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
            if (!empty($global_config['auto_login_after_reg'])) {
                // Auto login
                $array_user = array('userid' => $userid, 'last_agent' => '', 'last_ip' => '', 'last_login' => 0, 'last_openid' => '');
                validUserLog($array_user, 1, '');
                $nv_redirect = nv_redirect_decrypt($nv_redirect);
                $url = !empty($nv_redirect) ? $nv_redirect : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            } else {
                $url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=login';
                if (!empty($nv_redirect)) {
                    $url .= '&nv_redirect=' . $nv_redirect;
                }
            }
            $nv_redirect = '';
            die(reg_result(array('status' => 'ok', 'input' => nv_url_rewrite($url, true), 'mess' => $lang_module['register_ok'])));
        }
    }
}
if ($nv_Request->isset_request('get_usage_terms', 'post')) {
    $sql = "SELECT content FROM " . NV_USERS_GLOBALTABLE . "_config WHERE config='siteterms_" . NV_LANG_DATA . "'";
    $siteterms = $db->query($sql)->fetchColumn();
    include NV_ROOTDIR . '/includes/header.php';
    echo $siteterms;
    include NV_ROOTDIR . '/includes/footer.php';
}
$contents = user_register($gfx_chk, $array_register['checkss'], $data_questions, $array_field_config, $custom_fields);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Example #6
0
*/
//error_reporting(E_ALL);
//ini_set('display_errors', 'On');
$rootdir = "/";
include $_SERVER['DOCUMENT_ROOT'] . $rootdir . "/php/base.php";
$connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dblogin) or die("ERROR: Can't connect to MySQL DB: " . mysql_error());
if (isset($_GET["action"])) {
    switch ($_GET["action"]) {
        case "check":
            user_check();
            break;
        case "login":
            user_login();
            break;
        case "register":
            user_register();
            break;
        case "remind":
            user_remind();
            break;
        case "update":
            user_update();
            break;
        case "logout":
            user_logout();
            break;
    }
}
function user_check()
{
    if ($_SESSION['LoggedIn'] == 1) {
Example #7
0
 case 'login_openid2':
     user_login_openid_agree(isset($_POST['agree']));
     log_timing();
     header('Location:index.php');
     exit;
 case 'logout':
     user_logout();
     if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'login.php') === false) {
         header('Location:' . $_SERVER['HTTP_REFERER']);
     } else {
         header('Location:index.php');
     }
     log_timing();
     exit;
 case 'reg_done':
     $reg_status = user_register($_POST);
     if ($reg_status == 1) {
         header("Location:index.php");
         exit;
     } else {
         $smarty->assign('reg_status', $reg_status);
     }
     break;
 case 'change_pw':
     $smarty->assign('change_status', user_change_password($_POST));
     break;
 case 'change_email':
     $smarty->assign('change_status', user_change_email($_POST));
     break;
 case 'generate_passwd':
     $smarty->assign('gen_status', user_generate_password($_POST['email']));
Example #8
0
function activate_user($usname, $pwd, $email, $member_type, $mobile)
{
    global $timestamp, $online_ip;
    if (defined('UC_API')) {
        include_once QISHI_ROOT_PATH . 'uc_client/client.php';
        list($activateuid, $username, $password, $email) = uc_user_login($usname, $pwd);
        if ($activateuid > 0) {
            return user_register(4, $pwd, $member_type, $email, $mobile, false, $usname);
        } else {
            return -10;
        }
    }
    return false;
}
Example #9
0
     if (in_array("email", $reg_com_config) && $reg_type == 1) {
         $com_setarr['email'] = $_POST['reg_email'] ? trim($_POST['reg_email']) : showmsg("请输入企业联系邮箱");
     }
     if (in_array("address", $reg_com_config)) {
         $com_setarr['address'] = $_POST['address'] ? trim($_POST['address']) : showmsg("请输入企业详细地址");
     }
     if (in_array("contents", $reg_com_config)) {
         $com_setarr['contents'] = $_POST['contents'] ? trim($_POST['contents']) : showmsg("请输入企业介绍");
     }
 }
 if ($reg_type == 1) {
     $mobile = $_POST['mobile'] ? trim($_POST['mobile']) : showmsg("注册手机号丢失");
     $rst = user_register($reg_type, $password, $member_type, "", $mobile, false);
 } else {
     $email = $_POST['email'] ? trim($_POST['email']) : showmsg("注册邮箱号丢失");
     $rst = user_register($reg_type, $password, $member_type, $email, "", $uc_reg = true);
 }
 if ($rst > 0) {
     $user = get_user_inid($rst);
     // 企业信息
     if ($member_type == 1 && !empty($com_setarr)) {
         $com_setarr['uid'] = intval($rst);
         $com_setarr['audit'] = intval($_CFG['audit_add_com']);
         $com_setarr['addtime'] = $timestamp;
         $com_setarr['refreshtime'] = $timestamp;
         $db->inserttable(table('company_profile'), $com_setarr);
     }
     $login_js = user_login($user['username'], $password);
     $mailconfig = get_cache('mailconfig');
     if ($mailconfig['set_reg'] == "1") {
         switch ($user['utype']) {
Example #10
0
    } elseif ($password != $_POST['password1']) {
        $err = "两次输入的密码不同";
    } elseif (empty($email) || !ereg("^[-a-zA-Z0-9_\\.]+\\@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}\$", $email)) {
        $err = "电子邮箱格式错误";
    }
    if (get_user_inusername($username)) {
        $err = "用户名已经存在";
    }
    if (get_user_inemail($email)) {
        $err = "电子邮箱已经存在";
    }
    if ($err) {
        $smarty->assign('err', $err);
        $smarty->assign('type', $member_type);
        $smarty->display("wap/reg_form.html");
        exit;
    }
    $register = user_register(3, $password, $member_type, $email, $mobile = "", true, $username, "");
    if ($register > 0) {
        $login_js = wap_user_login($username, $password);
        $mailconfig = get_cache('mailconfig');
        if ($mailconfig['set_reg'] == "1") {
            dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $_SESSION['uid'] . "&key=" . asyn_userkey($_SESSION['uid']) . "&sendemail=" . $email . "&sendusername="******"&sendpassword="******"&act=reg");
        }
        if ($login_js) {
            header("location:" . $login_js['qs_login']);
        }
    } else {
        header("location:wap_user_reg.php");
    }
}
Example #11
0
# For details see the file LICENSE.html in the top level of the source.
require_once "../database.inc";
require_once "user.inc";
$user_name = mysql_real_escape_string($_POST["user_name"]);
$password1 = mysql_real_escape_string($_POST["password1"]);
$password2 = mysql_real_escape_string($_POST["password2"]);
$email = mysql_real_escape_string($_POST["email"]);
$real_name = mysql_real_escape_string($_POST["real_name"]);
$submit = mysql_real_escape_string($_POST["submit"]);
if (user_isloggedin()) {
    user_logout();
    $user_name = '';
}
$ok = false;
if ($submit) {
    $ok = user_register($user_name, $password1, $password2, $email, $real_name);
}
$title = "Sign up for Newsletter, Forum and Policies";
$onload = "givefocus('real_name')";
pw_header();
if ($feedback) {
    if ($ok) {
        echo "<p>{$feedback}</p>";
    } else {
        echo "<div class=\"error\"><h2>Registration not complete,\n        please try again</h2><p>{$feedback}</div>";
    }
} else {
    print "<p>\n    Quickly fill in the information below, and we'll send you\n    a confirmation email.  You will then receive the Public\n    Whip newsletter, which will be at most once a month.\n    Occasionally we will send an extra small topical newsletter.\n    You will also be able to edit division descriptions and policies.  After\n    signing up you can unsubscribe from the newsletter, but still\n    edit divisions and policies.";
    print "<p><a href=\"../newsletters/archive.php\">Read archive of previous newsletters</a>";
    print "<br><a href=\"settings.php\">Log in to change settings if you already signed up</a>";
}
Example #12
0
<?php

require 'js/parse/autoload.php';
require_once "config.php";
require_once "common.php";
use Parse\ParseException;
use Parse\ParseUser;
use Parse\ParseSessionStorage;
use Parse\ParseClient;
use Parse\ParseQuery;
use Parse\ParseObject;
$func = $_POST['check'];
if ($func == 'register') {
    echo user_register($_POST['username'], $_POST['first'], $_POST['last'], $_POST['password'], $_POST['email'], $_POST['location'], $_POST['lat'], $_POST['lng']);
    mail_box($_POST['email'], 'Register', 'Thank  you for registering', 'register');
}
if ($func == 'guest') {
    (string) ($uniq = uniqid());
    $name = "Guest-" . $uniq;
    $user = new ParseUser();
    $user->set("username", $name);
    $user->set("password", $uniq);
    $user->setArray("connected", []);
    $user->set("status", 0);
    $user->set("avatar", "img/profile_default_male.jpg");
    $response = new Response();
    try {
        $user->signUp();
        //user_register_create_chat($user);
        $_SESSION['user'] = $user;
        $_SESSION['notification'] = true;
Example #13
0
                } else {
                    if (strlen($userpass) < 8) {
                        $errors[] = "votre mot de passe doit comporter au minimum 8 caractères";
                    } else {
                        $sql = 'SELECT user_name , user_email FROM users where user_name=:user OR user_email=:email';
                        try {
                            $stmt = $db_connexion->prepare($sql);
                            $stmt->execute(array(':user' => $username, ':email' => $usermail));
                            $row = $stmt->fetch();
                            if ($row["user_name"] == $username) {
                                $errors[] = "le pseudo a déjà été pris";
                            } else {
                                if ($row["user_email"] == $usermail) {
                                    $errors[] = "L'email a déjà été renseigné";
                                } else {
                                    if (user_register($username, $usermail, $userpass, $db_connexion)) {
                                        header("Location:inscription.php?succes");
                                    }
                                }
                            }
                        } catch (PDOException $e) {
                            echo $e->getMessage();
                        }
                    }
                }
            }
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//
Example #14
0
    }
} elseif ($act == 'phone_reg') {
    $_POST = array_map("utf8_to_gbk", $_POST);
    require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $mobile = trim($_POST['mobile']);
    $password_mobile = isset($_POST['password_mobile']) ? trim($_POST['password_mobile']) : "";
    $member_type = intval($_POST['utype']);
    $agreement_mobile = isset($_POST['agreement_mobile']) ? intval($_POST['agreement_mobile']) : "";
    if (empty($mobile) || empty($password_mobile) || empty($member_type)) {
        exit("信息不完整!");
    } elseif (empty($agreement_mobile)) {
        exit("需要同意注册协议");
    }
    //验证验证码是否正确
    $verifycode = trim($_POST['verifycode']);
    if (empty($verifycode) || empty($_SESSION['mobile_rand']) || $verifycode != $_SESSION['mobile_rand']) {
        exit("验证码错误!");
    }
    //手机号注册
    $register = user_register(1, $password_mobile, $member_type, $email = "", $mobile, false, $username = "", "");
    if ($register > 0) {
        $user_info = get_user_inmobile($mobile);
        $login_js = wap_user_login($user_info['username'], $password_mobile);
        if ($login_js) {
            exit($login_js['qs_login']);
        }
    } else {
        exit("user_reg.php");
    }
}
Example #15
0
/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.qdaygroup.com/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$_W['page']['title'] = '添加用户 - 用户管理 - 用户管理';
if (checksubmit()) {
    load()->model('user');
    $user = array();
    $user['username'] = trim($_GPC['username']);
    if (!preg_match(REGULAR_USERNAME, $user['username'])) {
        message('必须输入用户名,格式为 3-15 位字符,可以包括汉字、字母(不区分大小写)、数字、下划线和句点。');
    }
    if (user_check(array('username' => $user['username']))) {
        message('非常抱歉,此用户名已经被注册,你需要更换注册名称!');
    }
    $user['password'] = $_GPC['password'];
    if (istrlen($user['password']) < 8) {
        message('必须输入密码,且密码长度不得低于8位。');
    }
    $user['remark'] = $_GPC['remark'];
    $user['groupid'] = intval($_GPC['groupid']) ? intval($_GPC['groupid']) : message('请选择所属用户组');
    $uid = user_register($user);
    if ($uid > 0) {
        unset($user['password']);
        message('用户增加成功!', url('user/edit', array('uid' => $uid)));
    }
    message('增加用户失败,请稍候重试或联系网站管理员解决!');
}
$groups = pdo_fetchall("SELECT id, name FROM " . tablename('users_group') . " ORDER BY id ASC");
template('user/create');
Example #16
0
                message('“' . $row['title'] . '”此项为必填项,请返回填写完整!');
            }
            $profile[$row['field']] = $_GPC[$row['field']];
        }
    }
    if (!empty($setting['register']['code'])) {
        $code = $_GPC['code'];
        $hash = md5($code . $_W['config']['setting']['authkey']);
        if ($_GPC['__code'] != $hash) {
            message('你输入的验证码不正确, 请重新输入.');
        }
    }
    $member['status'] = !empty($setting['register']['verify']) ? -1 : 0;
    $member['remark'] = '';
    $member['groupid'] = intval($setting['register']['groupid']);
    $uid = user_register($member);
    if ($uid > 0) {
        unset($member['password']);
        $member['uid'] = $uid;
        if (!empty($profile)) {
            $profile['uid'] = $uid;
            $profile['createtime'] = TIMESTAMP;
            pdo_insert('users_profile', $profile);
        }
        pdo_update('users_invitation', array('inviteuid' => $uid), array('id' => $invite['id']));
        message('注册成功' . (!empty($setting['register']['verify']) ? ',請等待管理员审核!' : ',请重新登录!'), url('user/login', array('uid' => $uid, 'username' => $member['username'])));
    }
    message('增加用户失败,请稍候重试或联系网站管理员解决!');
}
load()->func('tpl');
template('user/register');
Example #17
0
     /* SERVICE: Register */
 } else {
     if (isset($_GET['action']) && $_GET['action'] == 'register') {
         if (!isset($_POST["username"]) || !isset($_POST["password"])) {
             $xml_output .= "<code>Missing info</code>";
         } else {
             $username = $_POST["username"];
             $password = $_POST["password"];
             //die($username.$password);
             if (!isset($_POST["email"])) {
                 $email = "";
             } else {
                 $email = $_POST["email"];
             }
             //die($email);
             $result = user_register($username, $password, $email, $mysqli);
             //$result = user_register($username, $password, $email, $mysqli);
             $xml_output .= "<code>" . $result . "</code>";
         }
         /* SERVICE: Query user basic information */
     } else {
         if (isset($_GET['action']) && $_GET['action'] == 'query') {
             if (isset($_GET['username'])) {
                 $username = $_GET['username'];
                 $user = user_query($username, $mysqli);
                 if ($user != null) {
                     $xml_output .= "<code>OK</code>";
                     $xml_output .= "<user_info>";
                     $xml_output .= "<id>" . $user['id'] . "</id>";
                     $xml_output .= "<username>" . $user['username'] . "</username>";
                     $xml_output .= "<email>" . $user['email'] . "</email>";
Example #18
0
     switch ($url_parts[3]) {
         case "listmode":
             preferences_list_mode();
             header("Location: " . $_SERVER["HTTP_REFERER"]);
             break;
         case "tilemode":
             preferences_tile_mode();
             header("Location: " . $_SERVER["HTTP_REFERER"]);
             break;
     }
     break;
 case "user":
     require_once "lib/api/users.php";
     switch ($url_parts[3]) {
         case "register":
             $result = user_register();
             if ($result > 0) {
                 header("Location: /welcome");
             } else {
                 header("Location: /register/failure/" . $result);
                 //print $result;
             }
             break;
         case "logout":
             user_logout();
             header("Location: /");
             break;
         case "login":
             if (user_login()) {
                 header("Location: /" . $_SESSION["user_name"]);
             } else {
Example #19
0
 $member_type = isset($_POST['member_type']) ? intval($_POST['member_type']) : exit("err");
 $email = isset($_POST['email']) ? trim($_POST['email']) : exit("err");
 if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
     $username = utf8_to_gbk($username);
     $password = utf8_to_gbk($password);
 }
 if (defined('UC_API')) {
     include_once QISHI_ROOT_PATH . 'uc_client/client.php';
     if (uc_user_checkname($username) < 0) {
         exit("err");
     }
     if (uc_user_checkemail($email) < 0) {
         exit("err");
     }
 }
 $register = user_register($username, $password, $member_type, $email);
 if ($register > 0) {
     $login_js = user_login($username, $password);
     $mailconfig = get_cache('mailconfig');
     if ($mailconfig['set_reg'] == "1") {
         dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $_SESSION['uid'] . "&key=" . asyn_userkey($_SESSION['uid']) . "&sendemail=" . $email . "&sendusername="******"&sendpassword="******"&act=reg");
     }
     $ucjs = $login_js['uc_login'];
     $qsurl = $login_js['qs_login'];
     $qsjs = "<script language=\"javascript\" type=\"text/javascript\">window.location.href=\"" . $qsurl . "\";</script>";
     if ($ucjs || $qsurl) {
         exit($ucjs . $qsjs);
     } else {
         exit("err");
     }
 } else {
Example #20
0
 public function doWebbusment()
 {
     global $_W, $_GPC;
     checklogin();
     load()->func('tpl');
     $uniacid = $_W['uniacid'];
     $op = $_GPC['op'] ? $_GPC['op'] : 'display';
     if ($op == 'display') {
         $pindex = max(1, intval($_GPC['page']));
         $psize = 20;
         $goodses = pdo_fetchall("SELECT * FROM " . tablename('eso_sale_busment') . " WHERE uniacid = '{$_W['uniacid']}' ORDER BY uid DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
         $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('eso_sale_busment') . " WHERE uniacid = '{$_W['uniacid']}'");
         $pager = pagination($total, $pindex, $psize);
         include $this->template('busment_show');
     } elseif ($op == 'add') {
         $uid = intval($_GPC['uid']);
         if (!empty($uid)) {
             $sql = 'SELECT * FROM ' . tablename('eso_sale_busment') . ' WHERE uid=:uid AND uniacid=:uniacid LIMIT 1';
             $params = array(':uid' => $uid, ':uniacid' => $_W['uniacid']);
             $goods = pdo_fetch($sql, $params);
             if (empty($goods)) {
                 message('未找到指定的商户.', $this->createWebUrl('busment'));
             }
         }
         if (checksubmit()) {
             $data = $_GPC['goods'];
             // 获取打包值
             empty($data['title']) && message('请填写商户名称');
             empty($data['bond']) && message('请填写商户保证金');
             empty($data['username']) && message('请填写登陆账号');
             empty($data['password']) && message('请填写登陆密码');
             if (empty($goods)) {
                 //添加管理人员
                 load()->model('user');
                 $user = array();
                 $user['username'] = trim($data['username']);
                 if (!preg_match(REGULAR_USERNAME, $user['username'])) {
                     message('必须输入用户名,格式为 3-15 位字符,可以包括汉字、字母(不区分大小写)、数字、下划线和句点。');
                 }
                 if (user_check(array('username' => $user['username']))) {
                     message('非常抱歉,此用户名已经被注册,你需要更换注册名称!');
                 }
                 $user['password'] = $data['password'];
                 if (istrlen($user['password']) < 8) {
                     message('必须输入密码,且密码长度不得低于8位。');
                 }
                 $user['remark'] = '';
                 $user['groupid'] = 1;
                 $uid = user_register($user);
                 //分配权限
                 $per_data['uniacid'] = $_W['uniacid'];
                 $per_data['uid'] = $uid;
                 $per_data['url'] = 'c=home&a=welcome&do=ext&m=feng_business';
                 $ret = pdo_insert('users_permission', $per_data);
                 //分配所属公众号
                 $acc_data['uniacid'] = $_W['uniacid'];
                 $acc_data['uid'] = $uid;
                 $acc_data['role'] = 'operator';
                 $ret = pdo_insert('uni_account_users', $acc_data);
                 //保存商户信息
                 $bus_data['uniacid'] = $_W['uniacid'];
                 $bus_data['title'] = $data['title'];
                 $bus_data['bond'] = $data['bond'];
                 $bus_data['status'] = $data['status'];
                 $bus_data['createtime'] = time();
                 $bus_data['uid'] = $uid;
                 $ret = pdo_insert('eso_sale_busment', $bus_data);
             } else {
                 $bus_data['title'] = $data['title'];
                 $bus_data['bond'] = $data['bond'];
                 $bus_data['status'] = $data['status'];
                 $ret = pdo_update('eso_sale_busment', $bus_data, array('uid' => $uid));
             }
             if (!empty($ret)) {
                 message('商户信息保存成功', $this->createWebUrl('busment', array('op' => 'add', 'uid' => $uid)), 'success');
             } else {
                 message('商户信息保存失败');
             }
         }
         include $this->template('busment_add');
     } elseif ($op == 'delete') {
         $uid = intval($_GPC['uid']);
         if (empty($uid)) {
             message('未找到指定商户');
         }
         $result = pdo_delete('users', array('uid' => $uid));
         $result = pdo_delete('users_permission', array('uid' => $uid));
         $result = pdo_delete('uni_account_users', array('uid' => $uid));
         $result = pdo_delete('eso_sale_busment', array('uid' => $uid, 'uniacid' => $_W['uniacid']));
         if (intval($result) == 1) {
             message('删除商户成功.', $this->createWebUrl('busment'), 'success');
         } else {
             message('删除商户失败.');
         }
     }
 }
Example #21
0
    SELECT * FROM User WHERE name = '{$userName}';
EOF;
    $ret = $db->query($sql);
    if (!$ret) {
        echo $db->lastErrorMsg();
    } else {
        if ($row = $ret->fetchArray(SQLITE3_ASSOC)) {
            header("Location: http://www.kmoving.com/user/register.php?Error=userExist");
        } else {
            $sql = <<<EOF
            INSERT INTO User (name, password, last, doctor, gender, height, weight, country, city, address)
            VALUES ('{$userName}', '{$userPassword}', '{$userName}', '{$checkbox}', '--', '--', '--', '--', '--', '--');
EOF;
            $ret = $db->exec($sql);
            if (!$ret) {
                echo $db->lastErrorMsg();
            } else {
                $db->close();
                setcookie("username", $userName, null, "/");
                header("Location: http://www.kmoving.com/server/user/user_details.php");
            }
        }
    }
    $db->close();
}
$userName = strval($_POST["username"]);
$userPassword = strval($_POST["password"]);
$checkbox = $_POST['checkbox'];
if ($userName != null && $userPassword != null) {
    user_register($userName, $userPassword, $checkbox);
}
Example #22
0
                $db->query('UPDATE ' . NV_GROUPS_GLOBALTABLE . ' SET numbers = numbers+1 WHERE group_id=4');
                $subject = $lang_module['account_register'];
                $message = sprintf($lang_module['account_register_info'], $array_register['first_name'], $global_config['site_name'], NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, $array_register['username']);
                nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
                $info = $lang_module['register_ok'] . "<br /><br />\n";
                $info .= "<img border=\"0\" src=\"" . NV_BASE_SITEURL . "images/load_bar.gif\"><br /><br />\n";
                $info .= '[<a href="' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '">' . $lang_module['redirect_to_login'] . '</a>]';
                $contents = user_info_exit($info);
                $contents .= '<meta http-equiv="refresh" content="5;url=' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true) . '" />';
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['register'], $array_register['username'] . ' | ' . $client_info['ip'] . ' | Simple', 0);
                include NV_ROOTDIR . '/includes/header.php';
                echo nv_site_theme($contents);
                include NV_ROOTDIR . '/includes/footer.php';
                exit;
            }
        }
    }
    $array_register['info'] = '<span style="color:#fb490b;">' . $error . '</span>';
} else {
    $array_register['first_name'] = $array_register['username'] = $array_register['email'] = '';
    $array_register['password'] = $array_register['re_password'] = $array_register['your_question'] = $array_register['answer'] = '';
    $array_register['question'] = $array_register['agreecheck'] = 0;
    $array_register['info'] = $lang_module['info'];
}
$array_register['agreecheck'] = $array_register['agreecheck'] ? ' checked="checked"' : '';
$sql = "SELECT content FROM " . NV_USERS_GLOBALTABLE . "_config WHERE config='siteterms_" . NV_LANG_DATA . "'";
$siteterms = $db->query($sql)->fetchColumn();
$contents = user_register($gfx_chk, $array_register, $siteterms, $data_questions, $array_field_config, $custom_fields);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Example #23
0
            $message = sprintf($lang_module['account_register_info'], $array_register['full_name'], $global_config['site_name'], NV_MY_DOMAIN . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name, $array_register['username'], $array_register['password']);
            $message .= "<br /><br />------------------------------------------------<br /><br />";
            $message .= nv_EncString($message);
            nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
            $info = $lang_module['register_ok'] . "<br /><br />\n";
            $info .= "<img border=\"0\" src=\"" . NV_BASE_SITEURL . "images/load_bar.gif\"><br /><br />\n";
            $info .= "[<a href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "\">" . $lang_module['redirect_to_login'] . "</a>]";
            $contents = user_info_exit($info);
            $contents .= "<meta http-equiv=\"refresh\" content=\"5;url=" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "\" />";
            include NV_ROOTDIR . "/includes/header.php";
            echo nv_site_theme($contents);
            include NV_ROOTDIR . "/includes/footer.php";
            exit;
        }
    }
    $array_register['info'] = "<span style=\"color:#fb490b;\">" . $error . "</span>";
} else {
    $array_register['full_name'] = $array_register['username'] = $array_register['email'] = "";
    $array_register['password'] = $array_register['re_password'] = $array_register['your_question'] = $array_register['answer'] = "";
    $array_register['question'] = $array_register['agreecheck'] = 0;
    $array_register['info'] = $lang_module['info'];
}
$array_register['agreecheck'] = $array_register['agreecheck'] ? " checked=\"checked\"" : "";
$sql = "SELECT `content` FROM `" . NV_USERS_GLOBALTABLE . "_config` WHERE `config`='siteterms_" . NV_LANG_DATA . "'";
$result = $db->sql_query($sql);
list($siteterms) = $db->sql_fetchrow($result);
$db->sql_freeresult();
$contents = user_register($gfx_chk, $array_register, $siteterms, $data_questions);
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
Example #24
0
        $smarty->display('user/connect_activate.htm');
    }
} elseif ($act == 'reg_save') {
    if (empty($_SESSION["openid"])) {
        exit("openid is empty");
    }
    $val['qq_nick'] = trim(utf8_to_gbk($_POST['nickname']));
    $val['email'] = !empty($_POST['email']) ? trim($_POST['email']) : exit("err");
    $val['mobile'] = !empty($_POST['mobile']) ? trim($_POST['mobile']) : exit("err");
    $val['member_type'] = intval($_POST['utype']);
    $val['password'] = !empty($_POST['password']) ? trim($_POST['password']) : exit("err");
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    unset($dbhost, $dbuser, $dbpass, $dbname);
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $userid = user_register(3, $val['password'], $val['member_type'], $val['email'], $val['mobile'], $uc_reg = true);
    if ($userid) {
        $time = time();
        $db->query("UPDATE " . table('members') . " SET qq_openid = '{$_SESSION[openid]}', qq_nick = '{$val[qq_nick]}', qq_binding_time = '{$time}' WHERE uid='{$userid}' AND qq_openid='' LIMIT 1");
        update_user_info($userid);
        $userurl = get_member_url($val['member_type']);
        header("Location:{$userurl}");
    } else {
        require_once QISHI_ROOT_PATH . 'include/tpl.inc.php';
        $link[0]['text'] = "返回首页";
        $link[0]['href'] = "{$_CFG['site_dir']}";
        showmsg('注册失败!', 0, $link);
    }
} elseif ($act == 'binding') {
    if (empty($_SESSION['uid']) || empty($_SESSION['utype']) || !empty($_SESSION['uqqid'])) {
        exit("error");
Example #25
0
                displayRegister($pageName);
            } else {
                // Check if any of the fields are missing
                if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['confirmpass'])) {
                    // Reshow the form with an error
                    $reg_error = 'One or more fields missing';
                    displayRegister($pageName);
                }
                // Check if the passwords match
                if ($_POST['password'] != $_POST['confirmpass']) {
                    // Reshow the form with an error
                    $reg_error = 'Your passwords do not match';
                    displayRegister($pageName);
                }
                // Everything is ok, register
                user_register($_POST['username'], $_POST['password'], $_POST['email']);
                echo "Thank you for Registering. <br />";
                echo "<a href='" . $pageName . ".html?user=login'>Click here to LOG IN</a> using this information.";
            }
        }
    } else {
        echo 'Currently logged in as ';
        echo strtoupper($_SESSION['username']) . ".<br/>";
        echo "Please <a href='" . $pageName . ".html?user=logout'>LOGOUT</a> before you register as a new user.";
    }
}
// LOGOUT
if ($user == 'logout') {
    if (!is_authed()) {
        die("You are not currently logged in. <br/><a href='" . $pageName . ".html?user=login'>Click here to LOG IN</a> or <a href='" . $pageName . ".html?user=register'>here to REGISTER</a>.");
    }
Example #26
0
    $val['email'] = !empty($_POST['email']) ? trim($_POST['email']) : exit("输入邮箱");
    $val['member_type'] = intval($_POST['member_type']);
    $val['password'] = !empty($_POST['password']) ? trim($_POST['password']) : exit("输入密码");
    if ($val['password'] != trim($_POST['rpassword'])) {
        exit("密码不一致");
    }
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    unset($dbhost, $dbuser, $dbpass, $dbname);
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $sql = "select * from " . table("members") . " where username='******'username']}' or email='{$val['email']}'";
    $row = $db->getall($sql);
    if (!empty($row)) {
        exit("用户名或邮箱已经存在!");
    }
    $userid = user_register($val['username'], $val['password'], $val['member_type'], $val['email']);
    if ($userid) {
        $db->query("UPDATE " . table('members') . " SET qq_openid = '{$_SESSION['openid']}'  WHERE uid='{$userid}' AND qq_openid='' LIMIT 1");
        update_user_info($userid);
        exit("ok");
    } else {
        require_once QISHI_ROOT_PATH . 'include/tpl.inc.php';
        exit("reg_err");
    }
} elseif ($act == 'binding') {
    $url = "https://graph.qq.com/oauth2.0/authorize?response_type=token&client_id={$_CFG['qq_appid']}&redirect_uri={$_CFG['wap_domain']}/connect_qq_client.php" . urlencode('?act=binding_check');
    header("Location:{$url}");
} elseif ($act == 'binding_check') {
    $html = "<script type=\"text/javascript\" src=\"http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js\" charset=\"utf-8\" data-callback=\"true\"></script> ";
    $html .= "<script type=\"text/javascript\">";
    $html .= "if(QC.Login.check())";
Example #27
0
        $access_token = get_access_token();
        $w_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $weixin_openid . "&lang=zh_CN";
        $w_result = https_request($w_url);
        $w_userinfo = json_decode($w_result, true);
        $w_userinfo = array_map('utf8_to_gbk', $w_userinfo);
        // 微信扫码注册用户名类型   前缀+随机字符
        $username = $_CFG['third_reg_prefix'] . randusername();
        // 微信扫码注册用户密码类型  1->与用户名相同       2->随机密码      3->指定密码
        if ($_CFG['reg_weixin_password_tpye'] == "1") {
            $password = $username;
        } elseif ($_CFG['reg_weixin_password_tpye'] == "2") {
            $password = randusername();
        } else {
            $password = $_CFG['reg_weixin_password'];
        }
        $insert_id = user_register(3, $password, $utype, "", "", false, $username, $weixin_openid, $w_userinfo['nickname']);
        if ($insert_id > 0) {
            $smarty->assign('utype_cn', $utype == 1 ? '企业会员' : '个人会员');
            $smarty->assign('username', $username);
            $smarty->assign('password', $password);
            weixin_login($weixin_openid, $insert_id, $event_key);
            $smarty->display('m/scan/scan_reg_success.html');
        } else {
            exit('err');
        }
    } else {
        exit('err');
    }
}
function weixin_login($openid, $uid, $event_key)
{