Exemple #1
0
                $license_content = addslashes_deep($license_content);
                $license_arr = explode('|', $license_content);
            }
        }
    }
    /* 恢复证书 */
    if (count($license_arr) != 2 || $license_arr[0] == '' || $license_arr[1] == '') {
        $links[] = array('text' => $_LANG['back'], 'href' => 'license.php?act=list_edit');
        sys_msg($_LANG['fail_license'], 1, $links);
    } else {
        include_once ROOT_PATH . 'includes/cls_transport.php';
        include_once ROOT_PATH . 'includes/cls_json.php';
        include_once ROOT_PATH . 'includes/lib_main.php';
        include_once ROOT_PATH . 'includes/lib_license.php';
        // 证书登录
        $login_result = license_login();
        if ($login_result['flag'] != 'login_succ') {
            $links[] = array('text' => $_LANG['back'], 'href' => 'license.php?act=list_edit');
            sys_msg($_LANG['fail_license_login'], 1, $links);
        }
        $sql = "UPDATE " . $ecs->table('shop_config') . "\n                SET value = '" . $license_arr[0] . "'\n                WHERE code = 'certificate_id'";
        $db->query($sql);
        $sql = "UPDATE " . $ecs->table('shop_config') . "\n                SET value = '" . $license_arr[1] . "'\n                WHERE code = 'token'";
        $db->query($sql);
        $links[] = array('text' => $_LANG['back'], 'href' => 'license.php?act=list_edit');
        sys_msg($_LANG['recover_license'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'del') {
    /* 检查权限 */
    admin_priv('shop_authorized');
    $sql = "UPDATE " . $ecs->table('shop_config') . "\n            SET value = ''\n            WHERE code IN('certificate_id', 'token')";
Exemple #2
0
/**
 * license check
 * @return  bool
 */
function license_check()
{
    // return 返回数组
    $return_array = array();

    // 取出网店 license
    $license = get_shop_license();

    // 检测网店 license
    if (!empty($license['certificate_id']) && !empty($license['token']) && !empty($license['certi']))
    {
        // license(登录)
        $return_array = license_login();
    }
    else
    {
        // license(注册)
        $return_array = license_reg();
    }

    return $return_array;
}
Exemple #3
0
/**
 * license check
 * @return  bool
 */
function license_check()
{
    // return 杩斿洖鏁扮粍
    $return_array = array();
    // 鍙栧嚭缃戝簵 license
    $license = get_shop_license();
    // 妫€娴嬬綉搴 license
    if (!empty($license['certificate_id']) && !empty($license['token']) && !empty($license['certi'])) {
        // license锛堢櫥褰曪級
        $return_array = license_login();
    } else {
        // license锛堟敞鍐岋級
        $return_array = license_reg();
    }
    return $return_array;
}