ECSHOP 驗(yàn)證郵箱送積分、送可用資金、送凍結(jié)余額 插件

字號:

,p>修改user.php
    找到
    /* 驗(yàn)證用戶注冊郵件*/
    elseif ($action == 'validate_email')
    {
    $hash = empty($_GET['hash']) ? '' : trim($_GET['hash']);
    if ($hash)
    {
    include_once(ROOT_PATH . 'includes/lib_passport.php');
    $id = register_hash('decode', $hash);
    if ($id > 0)
    {
    $sql = "UPDATE " . $ecs->table('users') . " SET is_validated = 1 WHERE user_id='$id'";
    $db->query($sql);
    $sql = 'SELECT user_name, email FROM ' . $ecs->table('users') . " WHERE user_id = '$id'";
    $row = $db->getRow($sql);
    show_message(sprintf($_LANG['validate_ok'], $row['user_name'], $row['email']),$_LANG['profile_lnk'], 'user.php');
    }
    }
    show_message($_LANG['validate_fail']);
    }
    修改為
    /* 驗(yàn)證用戶注冊郵件 */
    elseif ($action == 'validate_email')
    {
    $hash = empty($_GET['hash']) ? '' : trim($_GET['hash']);
    if ($hash)
    {
    include_once(ROOT_PATH . 'includes/lib_passport.php');
    $id = register_hash('decode', $hash);
    if ($id > 0)
    {
    $sql = 'SELECT is_validated FROM '.$ecs->table('users')." WHERE user_id='$id'";
    $row = $db->getRow($sql);
    if($row['is_validated'] == 0)
    {
    $sql = "UPDATE " . $ecs->table('users') . " SET is_validated = 1 WHERE user_id='$id'";
    $db->query($sql);
    $sql = 'SELECT user_name, email FROM ' . $ecs->table('users') . " WHERE user_id = '$id'";
    $row = $db->getRow($sql);
    //驗(yàn)證完成 送積分 by gaojin 201003300850
    include_once(ROOT_PATH .'includes/lib_common.php');
    log_account_change($id, 0, 0, 0, 100,$GLOBALS['_LANG']['register_points']);
    show_message(sprintf($_LANG['validate_ok'], $row['user_name'], $row['email']),$_LANG['profile_lnk'], 'user.php');
    }
    else
    {
    show_message(sprintf('請不要重復(fù)驗(yàn)證', $row['user_name'], $row['email']),$_LANG['profile_lnk'], 'user.php');
    }
    }
    }
    show_message($_LANG['validate_fail']);
    }