Avoid creating unneccesary databases.
This commit is contained in:
parent
9aec568360
commit
8a03cbfbf6
|
@ -1592,12 +1592,18 @@ $logfile=$logdir.'/newsportal.log';
|
|||
|
||||
function get_user_mail_auth_data($user) {
|
||||
global $spooldir;
|
||||
$userdata = array("$user");
|
||||
$user = strtolower($user);
|
||||
$pkey_config = get_user_config($user, "pkey");
|
||||
$pkey_cookie = $_COOKIE['pkey'];
|
||||
if($pkey_config == false || $pkey_cookie == false) {
|
||||
return false;
|
||||
}
|
||||
if($pkey_config == $pkey_cookie) {
|
||||
$userfile=$spooldir.'/'.$user.'-articleviews.dat';
|
||||
$userdata = unserialize(file_get_contents($userfile));
|
||||
if(is_file($userfile)) {
|
||||
$userdata = unserialize(file_get_contents($userfile));
|
||||
}
|
||||
return $userdata;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -42,10 +42,12 @@
|
|||
$dbh = null;
|
||||
if($CONFIG['article_database'] == '1') {
|
||||
$database = $spooldir.'/'.$group.'-articles.db3';
|
||||
$articles_dbh = article_db_open($database);
|
||||
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE newsgroup=:newsgroup AND date<:expireme');
|
||||
$articles_query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
|
||||
$articles_dbh = null;
|
||||
if(is_file($database)) {
|
||||
$articles_dbh = article_db_open($database);
|
||||
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE newsgroup=:newsgroup AND date<:expireme');
|
||||
$articles_query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
|
||||
$articles_dbh = null;
|
||||
}
|
||||
}
|
||||
$grouppath = preg_replace('/\./', '/', $group);
|
||||
|
||||
|
|
|
@ -108,10 +108,12 @@ function delete_message($messageid, $group) {
|
|||
}
|
||||
if($CONFIG['article_database'] == '1') {
|
||||
$database = $spooldir.'/'.$group.'-articles.db3';
|
||||
$articles_dbh = article_db_open($database);
|
||||
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE msgid=:messageid');
|
||||
$articles_query->execute(['messageid' => $messageid]);
|
||||
$articles_dbh = null;
|
||||
if(is_file($database)) {
|
||||
$articles_dbh = article_db_open($database);
|
||||
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE msgid=:messageid');
|
||||
$articles_query->execute(['messageid' => $messageid]);
|
||||
$articles_dbh = null;
|
||||
}
|
||||
}
|
||||
$this_overview=$spooldir.'/'.$group.'-overview';
|
||||
if(false === (is_file($this_overview))) {
|
||||
|
|
Loading…
Reference in New Issue