This repository was archived by the owner on May 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +21
-6
lines changed
Expand file tree Collapse file tree 4 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public function actionGet(ParameterBag $params)
4040
4141 $ finder = \XF ::finder ('YogstationPermissions:LinkedAccount ' );
4242
43- $ linked_account = $ finder ->where ('account_id ' , $ params ->account_type )
43+ $ linked_account = $ finder ->where ('account_id ' , $ params ->account_id )
4444 ->where ('account_type ' , $ params ->account_type )
4545 ->with ('User ' )->fetchOne ();
4646
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public function installStep1()
2424 $ table ->addColumn ('user_id ' , 'int ' );
2525 $ table ->addColumn ('account_type ' , 'varchar ' , 64 );
2626 $ table ->addColumn ('account_id ' , 'varchar ' , 255 );
27- $ table ->addPrimaryKey ('user_id ' );
27+ $ table ->addPrimaryKey ([ 'user_id ' , ' account_type ' ] );
2828 });
2929
3030 $ this ->schemaManager ()->createTable ('yg_linking_key ' , function (\XF \Db \Schema \Create $ table )
@@ -35,5 +35,12 @@ public function installStep1()
3535 $ table ->addColumn ('expires ' , 'int ' );
3636 $ table ->addPrimaryKey ('linking_key ' );
3737 });
38- }
38+ }
39+
40+ public function uninstallStep1 ()
41+ {
42+ $ this ->schemaManager ()->dropTable ('yg_linked_account ' );
43+ $ this ->schemaManager ()->dropTable ('yg_linking_key ' );
44+ }
45+
3946}
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ protected function setupApiResultData(
3535 parent ::setupApiResultData ($ result , $ verbosity , $ options );
3636
3737 $ result ->permissions = $ this ->getPermissions ();
38- $ result ->linked_accounts = $ this ->LinkedAccounts ;
38+
39+ $ linked_accounts = [];
40+
41+ foreach ($ this ->LinkedAccounts as $ account )
42+ {
43+ $ linked_accounts [$ account ->account_type ] = $ account ->account_id ;
44+ }
45+
46+ $ result ->linked_account = $ linked_accounts ;
3947 }
4048}
Original file line number Diff line number Diff line change 22 "legacy_addon_id" : " " ,
33 "title" : " Yogstation Permissions" ,
44 "description" : " " ,
5- "version_id" : 20201007 ,
6- "version_string" : " 20201007 " ,
5+ "version_id" : 20201008 ,
6+ "version_string" : " 20201008 " ,
77 "dev" : " " ,
88 "dev_url" : " " ,
99 "faq_url" : " " ,
You can’t perform that action at this time.
0 commit comments