/
ext.php
48 lines (41 loc) · 1.05 KB
/
ext.php
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
<?php
namespace iiet\oauth;
class ext extends \phpbb\extension\base
{
function enable_step($old_state)
{
switch ($old_state)
{
case '':
$db = $this->container->get('dbal.conn');
$modules = array('UCP_PROFILE_REG_DETAILS', 'UCP_PROFILE_AUTOLOGIN_KEYS', 'UCP_AUTH_LINK_MANAGE');
$sql = 'UPDATE ' . MODULES_TABLE . '
SET module_enabled = 0
WHERE ' . $db->sql_in_set('module_langname', $modules);
$db->sql_query($sql);
return 'ucp_modules_disabled';
break;
default:
return parent::enable_step($old_state);
break;
}
}
function disable_step($old_state)
{
switch ($old_state)
{
case '':
$db = $this->container->get('dbal.conn');
$modules = array('UCP_PROFILE_REG_DETAILS', 'UCP_PROFILE_AUTOLOGIN_KEYS', 'UCP_AUTH_LINK_MANAGE');
$sql = 'UPDATE ' . MODULES_TABLE . '
SET module_enabled = 1
WHERE ' . $db->sql_in_set('module_langname', $modules);
$db->sql_query($sql);
return 'ucp_modules_disabled';
break;
default:
return parent::disable_step($old_state);
break;
}
}
}