Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Flerex committed Jun 30, 2019
1 parent e61c26a commit d349807
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions acp/main_module.php
Expand Up @@ -51,6 +51,9 @@ class main_module
/** @var string $phpEx */
protected $phpEx;

/** @var string $phpbb_admin_path */
protected $phpbb_admin_path;

public function main($id, $mode)
{
global $config, $request, $template, $user, $db, $phpbb_container;
Expand Down
4 changes: 2 additions & 2 deletions event/main_listener.php
Expand Up @@ -90,7 +90,7 @@ static public function getSubscribedEvents()
'core.page_header' => 'add_switchable_accounts',
'core.delete_user_after' => 'cleanup_table',
'core.posting_modify_template_vars' => 'posting_as_template',
'core.modify_posting_parameters' => 'posting_as_logic',
'core.modify_posting_parameters' => array('posting_as_logic', 100),
'core.modify_posting_auth' => 'posting_as_error_override',
'core.memberlist_view_profile' => 'profile_linked_accounts_list',
);
Expand Down Expand Up @@ -215,7 +215,7 @@ public function posting_as_template($event)
* - Can reply to a post in this forum (if we are replying to a topic)
* - Are accessible (are not banned or inactive)
*/
$available_accounts = array_filter($this->utils->get_linked_accounts(), function ($user) use (&$event, &$is_first_post) {
$available_accounts = array_filter($this->utils->get_linked_accounts(), function ($user) use ($event) {
return $this->utils->can_switch_to($user['user_id'])
&& $this->utils->user_can_post_on_forum(
$user['user_id'],
Expand Down
8 changes: 5 additions & 3 deletions service/utils.php
Expand Up @@ -159,6 +159,7 @@ public function can_switch_to($account_id)
* Obtain a list of the accounts linked
* to the current user.
*
* @param int|null $id
* @return array An array of (int) IDs
*/
public function get_linked_accounts($id = null)
Expand Down Expand Up @@ -232,8 +233,9 @@ public function get_account_count()
* Returns an array with the accounts
* that are part of a link
*
* @param int $start
* @param int $limit
* @return array
*
*/
public function get_accounts($start, $limit)
{
Expand Down Expand Up @@ -354,7 +356,7 @@ public function get_linked_accounts_of_array($account, $accounts)
* ID, username, password,
* email and type
*
* @param string $usename The user's name
* @param string $username The user's name
*
* @return array
*/
Expand All @@ -379,7 +381,7 @@ public function get_user_auth_info($username)
*
* @param int $account_id The linked account id
*
* @return array
* @return void
*/
public function switch_to_linked_account($account_id)
{
Expand Down

0 comments on commit d349807

Please sign in to comment.