Added plugin-call to Session

This commit is contained in:
Tobias Reich 2014-04-04 21:12:49 +02:00
parent 43df706e66
commit 2400564a79
2 changed files with 19 additions and 1 deletions

View File

@ -25,7 +25,6 @@ if (!empty($_POST['function'])||!empty($_GET['function'])) {
require('modules/db.php');
require('modules/misc.php');
require('modules/photo.php');
require('modules/_session.php');
require('modules/settings.php');
require('modules/upload.php');

View File

@ -41,6 +41,9 @@ class Session {
if (!isset($this->settings, $public, $version)) return false;
# Call plugins
$this->plugins(__METHOD__, 0, func_get_args());
global $configVersion;
# Update
@ -74,6 +77,9 @@ class Session {
}
# Call plugins
$this->plugins(__METHOD__, 1, func_get_args());
return $return;
}
@ -82,6 +88,9 @@ class Session {
if (!isset($this->settings, $username, $password)) return false;
# Call plugins
$this->plugins(__METHOD__, 0, func_get_args());
# Check login
if ($username===$this->settings['username']&&$password===$this->settings['password']) {
$_SESSION['login'] = true;
@ -94,13 +103,23 @@ class Session {
return true;
}
# Call plugins
$this->plugins(__METHOD__, 1, func_get_args());
return false;
}
public function logout() {
# Call plugins
$this->plugins(__METHOD__, 0, func_get_args());
session_destroy();
# Call plugins
$this->plugins(__METHOD__, 1, func_get_args());
return true;
}