diff --git a/.env.example b/.env.example index 8eec3e9..4810b0f 100644 --- a/.env.example +++ b/.env.example @@ -53,4 +53,10 @@ ACCESS_GROUPS="notify,friends,photos,audio,video,stories,pages,status,notes,mess USERAGENT = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36' # ID приложения ВК по умолчанию -APP_ID = '6660888' \ No newline at end of file +APP_ID = '6660888' + +# Домен сервера для подключения CallBack API +SERVER_DOMAIN = + +# Произвольный ключ для подключения к CallBack серверу +CALLBACK_SECRET_KEY = \ No newline at end of file diff --git a/system/API/CallBack.php b/system/API/CallBack.php new file mode 100644 index 0000000..5488433 --- /dev/null +++ b/system/API/CallBack.php @@ -0,0 +1,48 @@ +secret_key = $_ENV['CALLBACK_SECRET_KEY']; + $this->url = $_ENV['SERVER_DOMAIN']; + $this->group_id = $group->id; + $this->group_id->request('groups.addCallbackServer', [ + 'group_id' => $this->group_id, + 'url' => $this->url, + 'title' => $this->group_id . 'CallBackServer', + 'secret_key' => $this->secret_key + ]); + $this->confirmation_token = request('groups.getCallbackConfirmationCode', [$this->group_id]); + Curl::post($vk, [$this->confirmation_token]); + } +} \ No newline at end of file diff --git a/system/API/CallBackAbstract.php b/system/API/CallBackAbstract.php new file mode 100644 index 0000000..0b10c39 --- /dev/null +++ b/system/API/CallBackAbstract.php @@ -0,0 +1,10 @@ +