mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-22 18:35:35 +08:00
52 lines
2.5 KiB
PHP
52 lines
2.5 KiB
PHP
<?php
|
||
/**
|
||
* Copyright © ShopeX (http://www.shopex.cn). All rights reserved.
|
||
* See LICENSE file for license details.
|
||
*/
|
||
|
||
|
||
class desktop_ctl_shoprelation extends desktop_controller{
|
||
|
||
var $workground = 'desktop_ctl_shoprelation';
|
||
|
||
function index($method='apply', $app_id='b2c', $callback='', $api_url='', $user_id='', $user_name=''){
|
||
$this->Certi = base_certificate::get('certificate_id');
|
||
$_node_token = base_shopnode::get('token',$app_id);
|
||
$this->Token = $_node_token ? $_node_token : base_certificate::get('token');;
|
||
$this->Node_id = base_shopnode::node_id($app_id);
|
||
$token = $this->Token;
|
||
$sess_id = kernel::single('base_session')->sess_id();
|
||
$apply['certi_id'] = $this->Certi;
|
||
if ($this->Node_id)
|
||
$apply['node_idnode_id'] = $this->Node_id;
|
||
$apply['sess_id'] = $sess_id;
|
||
$apply['certi_ac'] = base_certificate::getCertiAC($apply);
|
||
if ($method == 'apply')
|
||
{
|
||
if ($apply['node_idnode_id'])
|
||
$_url = MATRIX_RELATION_URL . '?source=apply&certi_id='.$apply['certi_id'].'&node_id=' . $apply['node_idnode_id'] . '&sess_id='.$apply['sess_id'].'&certi_ac='.$apply['certi_ac'].'&callback=' . $callback . '&api_url=' . $api_url . '&op_id=' . $user_id . '&op_user=' . $user_name;
|
||
else
|
||
$_url =MATRIX_RELATION_URL . '?source=apply&certi_id='.$apply['certi_id'].'&sess_id='.$apply['sess_id'].'&certi_ac='.$apply['certi_ac'].'&callback=' . $callback . '&api_url=' . $api_url . '&op_id=' . $user_id . '&op_user=' . $user_name;
|
||
}
|
||
elseif ($method == 'accept')
|
||
{
|
||
if ($apply['node_idnode_id'])
|
||
$_url = MATRIX_RELATION_URL . '?source=accept&certi_id='.$apply['certi_id'].'&node_id=' . $apply['node_idnode_id'] . '&sess_id='.$apply['sess_id'].'&certi_ac='.$apply['certi_ac'].'&callback=' . $callback . '&api_url=' . $api_url . '&op_id=' . $user_id . '&op_user=' . $user_name;
|
||
else
|
||
$_url = MATRIX_RELATION_URL . '?source=accept&certi_id='.$apply['certi_id'].'&sess_id='.$apply['sess_id'].'&certi_ac='.$apply['certi_ac'].'&callback=' . $callback . '&api_url=' . $api_url . '&op_id=' . $user_id . '&op_user=' . $user_name;
|
||
}
|
||
else
|
||
{
|
||
$this->pagedata['_PAGE_CONTENT'] = "";
|
||
}
|
||
if($_url){
|
||
echo "<script>new Dialog('$_url',{iframe:true,title:'TITLE',width:.8,height:.8});</script>";
|
||
}
|
||
|
||
//$this->page();
|
||
}
|
||
|
||
|
||
|
||
}
|