mirror of
https://github.com/friendica/friendica
synced 2025-04-27 23:10:12 +00:00
Move Login/Logout/TwoFactor to bundled submodule "Security"
This commit is contained in:
parent
d30e8665e1
commit
aa5771cf3e
27 changed files with 31 additions and 26 deletions
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Module/Logout.php
|
||||
*/
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\App\Authentication;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Profile;
|
||||
|
||||
/**
|
||||
* Logout module
|
||||
*
|
||||
* @author Hypolite Petovan <hypolite@mrpetovan.com>
|
||||
*/
|
||||
class Logout extends BaseModule
|
||||
{
|
||||
/**
|
||||
* @brief Process logout requests
|
||||
*/
|
||||
public static function init(array $parameters = [])
|
||||
{
|
||||
$visitor_home = null;
|
||||
if (remote_user()) {
|
||||
$visitor_home = Profile::getMyURL();
|
||||
Cache::delete('zrlInit:' . $visitor_home);
|
||||
}
|
||||
|
||||
Hook::callAll("logging_out");
|
||||
Session::clear();
|
||||
|
||||
if ($visitor_home) {
|
||||
System::externalRedirect($visitor_home);
|
||||
} else {
|
||||
info(L10n::t('Logged out.'));
|
||||
self::getApp()->internalRedirect();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue