Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 299968 Details for
Bug 426386
3.8.5: Check for javascript ability of client for all pages supporting ajax optimizations
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to add javascript enabled check to Bugzilla code (v1)
javascript_check.patch (text/plain), 6.99 KB, created by
David Lawrence
on 2008-04-01 21:05:01 UTC
(
hide
)
Description:
Patch to add javascript enabled check to Bugzilla code (v1)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-04-01 21:05:01 UTC
Size:
6.99 KB
patch
obsolete
>? bugzilla-3.2rh-20080401.1.tar.gz >? bugzilla.spec >? javascript_check.patch >? patches >Index: Bugzilla/User.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/User.pm,v >retrieving revision 1.7 >diff -u -r1.7 User.pm >--- Bugzilla/User.pm 25 Mar 2008 21:06:14 -0000 1.7 >+++ Bugzilla/User.pm 1 Apr 2008 20:57:08 -0000 >@@ -73,6 +73,9 @@ > 'showmybugslink' => 0, > 'disabledtext' => '', > 'disable_mail' => 0, >+ # REDHAT EXTENSION START 426386 >+ 'javascript' => 0, >+ # REDHAT EXTENSION END 426386 > }; > > use constant DB_TABLE => 'profiles'; >@@ -88,6 +91,9 @@ > 'profiles.mybugslink AS showmybugslink', > 'profiles.disabledtext', > 'profiles.disable_mail', >+ # REDHAT EXTENSION START 426386 >+ 'profiles.javascript', >+ # REDHAT EXTENSION END 426386 > ); > use constant NAME_FIELD => 'login_name'; > use constant ID_FIELD => 'userid'; >@@ -231,6 +237,10 @@ > sub email_disabled { $_[0]->{disable_mail}; } > sub email_enabled { !($_[0]->{disable_mail}); } > >+# REDHAT EXTENSION START 426386 >+sub javascript { $_[0]->{javascript}; } >+# REDHAT EXTENSION END 426386 >+ > sub set_authorizer { > my ($self, $authorizer) = @_; > $self->{authorizer} = $authorizer; >Index: Bugzilla/Auth/Login/Cookie.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Auth/Login/Cookie.pm,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 Cookie.pm >--- Bugzilla/Auth/Login/Cookie.pm 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ Bugzilla/Auth/Login/Cookie.pm 1 Apr 2008 20:57:08 -0000 >@@ -82,6 +82,25 @@ > # time on the login cookie > $dbh->do("UPDATE logincookies SET lastused = NOW() > WHERE cookie = ?", undef, $login_cookie); >+ >+ # REDHAT EXTENSION START 426386 >+ # Check for javascript cookie and update profiles >+ my $javascript_cookie = $cgi->cookie("Bugzilla_javascript"); >+ unless ($javascript_cookie) { >+ my $cookie = first {$_->name eq 'Bugzilla_javascript'} >+ @{$cgi->{'Bugzilla_cookie_list'}}; >+ $javascript_cookie = $cookie->value if $cookie; >+ } >+ if ($javascript_cookie) { >+ $dbh->do("UPDATE profiles SET javascript = 1 >+ WHERE userid = ?", undef, $user_id); >+ $cgi->remove_cookie('Bugzilla_javascript'); >+ } >+ else { >+ $dbh->do("UPDATE profiles SET javascript = 0 >+ WHERE userid = ?", undef, $user_id); >+ } >+ # REDHAT EXTENSION END 426386 > return { user_id => $user_id }; > } > } >Index: Bugzilla/DB/Schema.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/DB/Schema.pm,v >retrieving revision 1.14 >diff -u -r1.14 Schema.pm >--- Bugzilla/DB/Schema.pm 26 Mar 2008 18:53:00 -0000 1.14 >+++ Bugzilla/DB/Schema.pm 1 Apr 2008 20:57:10 -0000 >@@ -868,6 +868,9 @@ > mybugslink => {TYPE => 'BOOLEAN', NOTNULL => 1, > DEFAULT => 'TRUE'}, > extern_id => {TYPE => 'varchar(64)'}, >+ # REDHAT EXTENSION START 426386 >+ javascript => {TYPE => 'BOOLEAN', DEFAULT => 0 }, >+ # REDHAT EXTENSION END 426386 > ], > INDEXES => [ > profiles_login_name_idx => {FIELDS => ['login_name'], >Index: Bugzilla/Install/DB.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Install/DB.pm,v >retrieving revision 1.10 >diff -u -r1.10 DB.pm >--- Bugzilla/Install/DB.pm 26 Mar 2008 18:53:00 -0000 1.10 >+++ Bugzilla/Install/DB.pm 1 Apr 2008 20:57:14 -0000 >@@ -524,6 +524,10 @@ > > $dbh->bz_drop_index('longdescs', 'longdescs_thetext_idx'); > _populate_bugs_fulltext(); >+ >+ # 2008-04-01 dkl@redhat.com - Bug 426382 >+ $dbh->bz_add_column('profiles', 'javascript', >+ { TYPE => 'BOOLEAN', DEFAULT => 0 }); > > ################################################################ > # New --TABLE-- changes should go *** A B O V E *** this point # >Index: js/cookies.js >=================================================================== >RCS file: js/cookies.js >diff -N js/cookies.js >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ js/cookies.js 1 Apr 2008 20:57:15 -0000 >@@ -0,0 +1,47 @@ >+function getexpirydate(nodays) >+{ >+ var UTCstring; >+ Today = new Date(); >+ nomilli=Date.parse(Today); >+ Today.setTime(nomilli+nodays*24*60*60*1000); >+ UTCstring = Today.toUTCString(); >+ return UTCstring; >+} >+ >+function setcookie(name, value, expires, path, domain, secure) >+{ >+ var curCookie = name + "=" + escape(value) + >+ ((expires) ? "; expires=" + getexpirydate(expires) : "") + >+ ((path) ? "; path=" + path : "") + >+ ((domain) ? "; domain=" + domain : "") + >+ ((secure) ? "; secure" : ""); >+ document.cookie = curCookie; >+} >+ >+function getcookie(name) >+{ >+ var dc = document.cookie; >+ var prefix = name + "="; >+ var begin = dc.indexOf("; " + prefix); >+ if (begin == -1) { >+ begin = dc.indexOf(prefix); >+ if (begin != 0) >+ return null; >+ } else >+ begin += 2; >+ var end = document.cookie.indexOf(";", begin); >+ if (end == -1) >+ end = dc.length; >+ return unescape(dc.substring(begin + prefix.length, end)); >+} >+ >+function deletecookie(name, path, domain) >+{ >+ if (getcookie(name)) { >+ document.cookie = name + "=" + >+ ((path) ? "; path=" + path : "") + >+ ((domain) ? "; domain=" + domain : "") + >+ "; expires=Thu, 01-Jan-70 00:00:01 GMT"; >+ } >+} >+ >Index: template/en/default/global/header.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/global/header.html.tmpl,v >retrieving revision 1.5 >diff -u -r1.5 header.html.tmpl >--- template/en/default/global/header.html.tmpl 21 Feb 2008 17:03:57 -0000 1.5 >+++ template/en/default/global/header.html.tmpl 1 Apr 2008 20:57:15 -0000 >@@ -75,6 +75,11 @@ > </script> > [% END %] > >+ [%# REDHAT EXTENSION START 426382 >+ # Add setcookie() to track javascript capability %] >+ <script src="js/cookies.js" type="text/javascript" language="JavaScript"></script> >+ [%# REDHAT EXTENSION END 426382 %] >+ > [% IF javascript_urls %] > [% FOREACH javascript_url = javascript_urls %] > <script src="[% javascript_url FILTER html %]" type="text/javascript"></script> >@@ -227,7 +232,8 @@ > # but set the onload attribute in the DEFAULT directive above. > #%] > >- <body onload="[% onload %]" >+ [%# REDHAT EXTENSION 426382 Add setcookie() to track javascript capability %] >+ <body onload="setcookie('Bugzilla_javascript',1); [% onload %]" > class="[% urlbase.replace('^https?://','').replace('/$','').replace('[-~@:/.]+','-') %] > [% FOREACH class = bodyclasses %] > [% ' ' %][% class FILTER css_class_quote %]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 426386
:
299968
|
300139
|
302670
|
302676