File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515class fix_acp_module_auth extends migration
1616{
17+ public function effectively_installed ()
18+ {
19+ $ sql = 'SELECT module_id
20+ FROM ' . $ this ->table_prefix . "modules
21+ WHERE module_class = 'acp'
22+ AND module_langname = 'ACP_WEBPUSH_EXT_SETTINGS'
23+ AND module_auth = 'ext_phpbb/webpushnotifications && acl_a_server' " ;
24+ $ result = $ this ->db ->sql_query ($ sql );
25+ $ module_id = $ this ->db ->sql_fetchfield ('module_id ' );
26+ $ this ->db ->sql_freeresult ($ result );
27+
28+ return $ module_id !== false ;
29+ }
30+
1731 public static function depends_on ()
1832 {
1933 return ['\phpbb\webpushnotifications\migrations\add_webpush ' ];
@@ -30,8 +44,8 @@ public function set_acp_module_auth()
3044 {
3145 $ phpbb_modules_table = $ this ->table_prefix . 'modules ' ;
3246 $ sql = 'UPDATE ' . $ phpbb_modules_table . "
33- SET module_auth = ' " . $ this ->db ->sql_escape ('ext_phpbb/webpushnotifications && acl_a_server ' ) . "'
34- WHERE module_langname = ' " . $ this ->db ->sql_escape ('ACP_WEBPUSH_EXT_SETTINGS ' ) . "' " ;
47+ SET module_auth = ' " . $ this ->db ->sql_escape ('ext_phpbb/webpushnotifications && acl_a_server ' ) . "'
48+ WHERE module_langname = ' " . $ this ->db ->sql_escape ('ACP_WEBPUSH_EXT_SETTINGS ' ) . "' " ;
3549 $ this ->db ->sql_query ($ sql );
3650 }
3751}
You can’t perform that action at this time.
0 commit comments