Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
731b5775
Commit
731b5775
authored
Feb 09, 2003
by
bbaetz%acm.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 192393 - $::dbwritesallowed never set
r, a=justdave
parent
3c5a0ebc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
Bugzilla.pm
Bugzilla.pm
+17
-1
CGI.pl
CGI.pl
+2
-2
globals.pl
globals.pl
+1
-1
No files found.
Bugzilla.pm
View file @
731b5775
...
...
@@ -46,7 +46,6 @@ sub cgi {
my
$_dbh
;
my
$_dbh_main
;
my
$_dbh_shadow
;
sub
dbh
{
my
$class
=
shift
;
...
...
@@ -58,6 +57,17 @@ sub dbh {
return
$_dbh
;
}
sub
dbwritesallowed
{
my
$class
=
shift
;
# We can write if we are connected to the main database.
# Note that if we don't have a shadowdb, then we claim that its ok
# to write even if we're nominally connected to the shadowdb.
# This is OK because this method is only used to test if misc
# updates can be done, rather than anything complicated.
return
$class
->
dbh
==
$_dbh_main
;
}
sub
switch_to_shadow_db
{
my
$class
=
shift
;
...
...
@@ -175,6 +185,12 @@ method for those scripts/templates which are only use via CGI, though.
The current database handle. See L<DBI>.
=item C<dbwritesallowed>
Determines if writes to the database are permitted. This is usually used to
determine if some general cleanup needs to occur (such as clearing the token
table)
=item C<switch_to_shadow_db>
Switch from using the main database to using the shadow database.
...
...
CGI.pl
View file @
731b5775
...
...
@@ -611,7 +611,7 @@ Content-type: text/html
# This seems like as good as time as any to get rid of old
# crufty junk in the logincookies table. Get rid of any entry
# that hasn't been used in a month.
if
(
$::
dbwritesallowed
)
{
if
(
Bugzilla
->
dbwritesallowed
)
{
SendSQL
(
"DELETE FROM logincookies "
.
"WHERE TO_DAYS(NOW()) - TO_DAYS(lastused) > 30"
);
}
...
...
@@ -620,7 +620,7 @@ Content-type: text/html
}
# Update the timestamp on our logincookie, so it'll keep on working.
if
(
$::
dbwritesallowed
)
{
if
(
Bugzilla
->
dbwritesallowed
)
{
SendSQL
(
"UPDATE logincookies SET lastused = null "
.
"WHERE cookie = $::COOKIE{'Bugzilla_logincookie'}"
);
}
...
...
globals.pl
View file @
731b5775
...
...
@@ -352,7 +352,7 @@ sub GetVersionTable {
}
if
(
time
()
-
$mtime
>
3600
)
{
use
Token
;
Token::
CleanTokenTable
()
if
$::
dbwritesallowed
;
Token::
CleanTokenTable
()
if
Bugzilla
->
dbwritesallowed
;
GenerateVersionTable
();
}
require
'data/versioncache'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment