Added plugin-call to Session
This commit is contained in:
parent
43df706e66
commit
2400564a79
@ -25,7 +25,6 @@ if (!empty($_POST['function'])||!empty($_GET['function'])) {
|
|||||||
require('modules/db.php');
|
require('modules/db.php');
|
||||||
require('modules/misc.php');
|
require('modules/misc.php');
|
||||||
require('modules/photo.php');
|
require('modules/photo.php');
|
||||||
require('modules/_session.php');
|
|
||||||
require('modules/settings.php');
|
require('modules/settings.php');
|
||||||
require('modules/upload.php');
|
require('modules/upload.php');
|
||||||
|
|
||||||
|
@ -41,6 +41,9 @@ class Session {
|
|||||||
|
|
||||||
if (!isset($this->settings, $public, $version)) return false;
|
if (!isset($this->settings, $public, $version)) return false;
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
|
||||||
global $configVersion;
|
global $configVersion;
|
||||||
|
|
||||||
# Update
|
# Update
|
||||||
@ -74,6 +77,9 @@ class Session {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 1, func_get_args());
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -82,6 +88,9 @@ class Session {
|
|||||||
|
|
||||||
if (!isset($this->settings, $username, $password)) return false;
|
if (!isset($this->settings, $username, $password)) return false;
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
|
||||||
# Check login
|
# Check login
|
||||||
if ($username===$this->settings['username']&&$password===$this->settings['password']) {
|
if ($username===$this->settings['username']&&$password===$this->settings['password']) {
|
||||||
$_SESSION['login'] = true;
|
$_SESSION['login'] = true;
|
||||||
@ -94,13 +103,23 @@ class Session {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 1, func_get_args());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logout() {
|
public function logout() {
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 0, func_get_args());
|
||||||
|
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
|
||||||
|
# Call plugins
|
||||||
|
$this->plugins(__METHOD__, 1, func_get_args());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user