-
Notifications
You must be signed in to change notification settings - Fork 3
/
VKontakte.xml
82 lines (74 loc) · 2.97 KB
/
VKontakte.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>
<plugin name="VKontakte" version_long="10000" version_human="1.0.0" author="Sijad aka Mr.Wosi" website="http://skinod.com" update_check="http://skinod.com/updatechk/sodvkontakte">
<hooks>
<hook type="C" class="\IPS\Member"><![CDATA[//<?php
class hook8 extends _HOOK_CLASS_
{
/**
* Set Default Values
*
* @return void
*/
public function setDefaultValues()
{
try
{
parent::setDefaultValues();
static::$databaseIdFields[] = 'vk_id';
}
catch ( \RuntimeException $e )
{
return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
}
}
}]]></hook>
</hooks>
<uninstall><![CDATA[<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
\IPS\Db::i()->dropColumn( 'core_members', 'vk_id' );
\IPS\Db::i()->dropColumn( 'core_members', 'vk_token' );
\IPS\Db::i()->delete( 'core_login_handlers', array( 'login_key=?', 'VK'));]]></uninstall>
<htmlFiles>
<html filename="sodvk.phtml">PGlwczp0ZW1wbGF0ZSBwYXJhbWV0ZXJzPSIkdXJsIiAvPg0KDQo8YSBocmVmPSd7JHVybH0nIGNsYXNzPSdpcHNCdXR0b24gaXBzQnV0dG9uX3ZlcnlTbWFsbCBpcHNCdXR0b25fZnVsbFdpZHRoIGlwc1NvY2lhbCcsIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiAjNGM3NWEzJz4NCgk8c3BhbiBjbGFzcz0naXBzU29jaWFsX2ljb24nPjxpIGNsYXNzPSdmYSBmYS12ayc+PC9pPjwvc3Bhbj4NCgk8c3BhbiBjbGFzcz0naXBzU29jaWFsX3RleHQnPntsYW5nPSJsb2dpbl9zb2R2ayJ9PC9zcGFuPg0KPC9hPg==</html>
</htmlFiles>
<cssFiles />
<jsFiles />
<resourcesFiles />
<lang>
<word key="login_handler_VK" js="0">VKontakte</word>
<word key="login_sodvk" js="0">Sign in with VK</word>
<word key="profilesync__VK" js="0">VK</word>
<word key="login_vk_app" js="0">App ID</word>
<word key="login_vk_secret" js="0">App Secret</word>
</lang>
<versions>
<version long="10000" human="1.0.0"><![CDATA[//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Install Code
*/
class ips_plugins_setup_install
{
/**
* ...
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->addColumn( 'core_members', array( 'name' => "vk_id", 'type' => 'bigint', 'length' => 20, 'null' => TRUE, 'default' => null ) );
\IPS\Db::i()->addColumn( 'core_members', array( 'name' => "vk_token", 'type' => 'varchar', 'length' => 200, 'null' => TRUE, 'default' => null ) );
\IPS\Db::i()->insert( 'core_login_handlers', array( 'login_settings' => json_encode( array() ), 'login_key' => 'VK', 'login_enabled' => 0, 'login_order' => 1 ) );
}
}]]></version></versions>
</plugin>