<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
/** @var IManagePersonalConfigValues */
private $pConfig;
+ /**
+ * Sets the X-Account-Management-Status header
+ *
+ * mainly extracted to make it overridable for tests
+ *
+ * @param array $user_record
+ */
+ protected function setXAccMgmtStatusHeader(array $user_record)
+ {
+ header('X-Account-Management-Status: active; name="' . $user_record['username'] . '"; id="' . $user_record['nickname'] . '"');
+ }
+
/**
* Authentication constructor.
*
$this->session->set('cid', $contact['id']);
}
- header('X-Account-Management-Status: active; name="' . $user_record['username'] . '"; id="' . $user_record['nickname'] . '"');
+ $this->setXAccMgmtStatusHeader($user_record);
if ($login_initial || $login_refresh) {
$this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $user_record['uid']]);
if ($login_initial) {
Hook::callAll('logged_in', $user_record);
- if (DI::module()->getName() !== 'home' && $this->session->exists('return_path')) {
+ if (DI::args()->getModuleName() !== 'home' && $this->session->exists('return_path')) {
$this->baseUrl->redirect($this->session->get('return_path'));
}
}