本文整理匯總了PHP中make_shopex_ac函數的典型用法代碼示例。如果您正苦於以下問題:PHP make_shopex_ac函數的具體用法?PHP make_shopex_ac怎麽用?PHP make_shopex_ac使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了make_shopex_ac函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: check_auth
/**
* 權限校驗函數
*/
function check_auth()
{
$license = get_shop_license();
// 取出網店 license信息
if (empty($license['certificate_id']) || empty($license['token']) || empty($license['certi'])) {
api_err('0x006', 'no certificate');
//沒有證書數據,輸出係統級錯誤:用戶權限不夠
}
if (!check_shopex_ac($_POST, $license['token'])) {
api_err('0x009');
//輸出係統級錯誤:簽名無效
}
/* 對應用申請的session進行驗證 */
$certi['certificate_id'] = $license['certificate_id'];
// 網店證書ID
$certi['app_id'] = 'ecshop_b2c';
// 說明客戶端來源
$certi['app_instance_id'] = 'webcollect';
// 應用服務ID
$certi['version'] = VERSION . '#' . RELEASE;
// 網店軟件版本號
$certi['format'] = 'json';
// 官方返回數據格式
$certi['certi_app'] = 'sess.valid_session';
// 證書方法
$certi['certi_session'] = $_POST['app_session'];
//應用服務器申請的session值
$certi['certi_ac'] = make_shopex_ac($certi, $license['token']);
// 網店驗證字符串
$request_arr = exchange_shop_license($certi, $license);
if ($request_arr['res'] != 'succ') {
api_err('0x001', 'session is invalid');
//輸出係統級錯誤:身份驗證失敗
}
}
示例2: license_reg
/**
* 功能:license 注冊
*
* @param array $certi_added 配置信息補充數組 array_key 登錄信息的key;array_key => array_value;
* @return array $return_array['flag'] = reg_succ、reg_fail、reg_ping_fail;
* $return_array['request'];
*/
function license_reg($certi_added = '')
{
// 登錄信息配置
$certi['certi_app'] = '';
// 證書方法
$certi['app_id'] = 'ecshop_b2c';
// 說明客戶端來源
$certi['app_instance_id'] = '';
// 應用服務ID
$certi['version'] = LICENSE_VERSION;
// license接口版本號
$certi['shop_version'] = VERSION . '#' . RELEASE;
// 網店軟件版本號
$certi['certi_url'] = sprintf($GLOBALS['ecs']->url());
// 網店URL
$certi['certi_session'] = $GLOBALS['sess']->get_session_id();
// 網店SESSION標識
$certi['certi_validate_url'] = sprintf($GLOBALS['ecs']->url() . 'certi.php');
// 網店提供於官方反查接口
$certi['format'] = 'json';
// 官方返回數據格式
$certi['certificate_id'] = '';
// 網店證書ID
// 標識
$certi_back['succ'] = 'succ';
$certi_back['fail'] = 'fail';
// return 返回數組
$return_array = array();
if (is_array($certi_added)) {
foreach ($certi_added as $key => $value) {
$certi[$key] = $value;
}
}
// 取出網店 license
$license = get_shop_license();
// 注冊
$certi['certi_app'] = 'certi.reg';
// 證書方法
$certi['certi_ac'] = make_shopex_ac($certi, '');
// 網店驗證字符串
unset($certi['certificate_id']);
$request_arr = exchange_shop_license($certi, $license);
if (is_array($request_arr) && $request_arr['res'] == $certi_back['succ']) {
// 注冊信息入庫
$sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "\n SET value = '" . $request_arr['info']['certificate_id'] . "' WHERE code = 'certificate_id'";
$GLOBALS['db']->query($sql);
$sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "\n SET value = '" . $request_arr['info']['token'] . "' WHERE code = 'token'";
$GLOBALS['db']->query($sql);
$return_array['flag'] = 'reg_succ';
$return_array['request'] = $request_arr;
clear_cache_files();
} elseif (is_array($request_arr) && $request_arr['res'] == $certi_back['fail']) {
$return_array['flag'] = 'reg_fail';
$return_array['request'] = $request_arr;
} else {
$return_array['flag'] = 'reg_ping_fail';
$return_array['request'] = array('res' => 'fail');
}
return $return_array;
}
示例3: license_login
/**
* 功能:license 登錄
*
* @param array $certi_added 配置信息補充數組 array_key 登錄信息的key;array_key => array_value;
* @return array $return_array['flag'] = login_succ、login_fail、login_ping_fail、login_param_fail;
* $return_array['request'];
*/
function license_login($certi_added = '') {
// 登錄信息配置
$certi['certi_app'] = ''; // 證書方法
$certi['app_id'] = 'ectouch_free'; // 說明客戶端來源
$certi['app_instance_id'] = ''; // 應用服務ID
$certi['version'] = LICENSE_VERSION; // license接口版本號
$certi['shop_version'] = VERSION . '#' . RELEASE; // 網店軟件版本號
$certi['certi_url'] = sprintf(__URL__); // 網店URL
$certi['certi_session'] = ECTouch::sess()->get_session_id(); // 網店SESSION標識
$certi['certi_validate_url'] = sprintf(__URL__ . url('api/certi')); // 網店提供於官方反查接口
$certi['format'] = 'json'; // 官方返回數據格式
$certi['certificate_id'] = ''; // 網店證書ID
// 標識
$certi_back['succ'] = 'succ';
$certi_back['fail'] = 'fail';
// return 返回數組
$return_array = array();
if (is_array($certi_added)) {
foreach ($certi_added as $key => $value) {
$certi[$key] = $value;
}
}
// 取出網店 license
$license = model('LicenseBase')->get_shop_license();
// 檢測網店 license
if (!empty($license['certificate_id']) && !empty($license['token']) && !empty($license['certi'])) {
// 登錄
$certi['certi_app'] = 'certi.login'; // 證書方法
$certi['app_instance_id'] = 'cert_auth'; // 應用服務ID
$certi['certificate_id'] = $license['certificate_id']; // 網店證書ID
$certi['certi_ac'] = make_shopex_ac($certi, $license['token']); // 網店驗證字符串
$request_arr = exchange_shop_license($certi, $license);
if (is_array($request_arr) && $request_arr['res'] == $certi_back['succ']) {
$return_array['flag'] = 'login_succ';
$return_array['request'] = $request_arr;
} elseif (is_array($request_arr) && $request_arr['res'] == $certi_back['fail']) {
$return_array['flag'] = 'login_fail';
$return_array['request'] = $request_arr;
} else {
$return_array['flag'] = 'login_ping_fail';
$return_array['request'] = array('res' => 'fail');
}
} else {
$return_array['flag'] = 'login_param_fail';
$return_array['request'] = array('res' => 'fail');
}
return $return_array;
}
示例4: license_reg
/**
* 功能:license 注冊
*
* @param array $certi_added 配置信息補充數組 array_key 登錄信息的key;array_key => array_value;
* @return array $return_array['flag'] = reg_succ、reg_fail、reg_ping_fail;
* $return_array['request'];
*/
function license_reg($certi_added = '')
{
// 登錄信息配置
$certi['certi_app'] = '';
// 證書方法
$certi['app_id'] = 'ectouch_free';
// 說明客戶端來源
$certi['app_instance_id'] = '';
// 應用服務ID
$certi['version'] = LICENSE_VERSION;
// license接口版本號
$certi['shop_version'] = VERSION . '#' . RELEASE;
// 網店軟件版本號
$certi['certi_url'] = sprintf(__URL__);
// 網店URL
$certi['certi_session'] = ECTouch::sess()->get_session_id();
// 網店SESSION標識
$certi['certi_validate_url'] = sprintf(__URL__ . url('api/certi'));
// 網店提供於官方反查接口
$certi['format'] = 'json';
// 官方返回數據格式
$certi['certificate_id'] = '';
// 網店證書ID
// 標識
$certi_back['succ'] = 'succ';
$certi_back['fail'] = 'fail';
// return 返回數組
$return_array = array();
if (is_array($certi_added)) {
foreach ($certi_added as $key => $value) {
$certi[$key] = $value;
}
}
// 取出網店 license
$license = model('LicenseBase')->get_shop_license();
// 注冊
$certi['certi_app'] = 'certi.reg';
// 證書方法
$certi['certi_ac'] = make_shopex_ac($certi, '');
// 網店驗證字符串
unset($certi['certificate_id']);
$request_arr = exchange_shop_license($certi, $license);
if (is_array($request_arr) && $request_arr['res'] == $certi_back['succ']) {
// 注冊信息入庫
$data['value'] = $request_arr['info']['certificate_id'];
$condition['code'] = 'certificate_id';
model('Base')->table('touch_shop_config')->data($data)->where($condition)->update();
$data['value'] = $request_arr['info']['token'];
$condition['code'] = 'certificate_id';
model('Base')->table('touch_shop_config')->data($data)->where($condition)->update();
$return_array['flag'] = 'reg_succ';
$return_array['request'] = $request_arr;
clear_cache_files();
} elseif (is_array($request_arr) && $request_arr['res'] == $certi_back['fail']) {
$return_array['flag'] = 'reg_fail';
$return_array['request'] = $request_arr;
} else {
$return_array['flag'] = 'reg_ping_fail';
$return_array['request'] = array('res' => 'fail');
}
return $return_array;
}
示例5: make_shopex_ac
//收錄商品詳情
} else {
$smarty->assign('msg', $request_arr['info']);
//提示信息
$smarty->assign('case', 0);
//開通服務頁麵
}
} else {
$smarty->assign('msg', $_LANG['no-open']);
//提示信息
$smarty->assign('case', 0);
//開通服務頁麵
}
//合作網站列表
$certi['certi_app'] = 'co.show_se';
// 證書方法
$certi['certi_ac'] = make_shopex_ac($certi, $license['token']);
// 網店驗證字符串
$request_arr = exchange_shop_license($certi, $license, 1);
if ($request_arr['res'] == 'succ') {
$smarty->assign('site_arr', $request_arr['info']['se']);
} else {
$smarty->assign('site_msg', $request_arr['info']);
}
} else {
$smarty->assign('msg', $_LANG['no-open']);
//提示信息
$smarty->assign('case', 0);
//開通服務頁麵
}
$smarty->display('webcollect.htm');