[dw-free] Negatives, multiform select checkbox out of place
[commit: http://hg.dwscoalition.org/dw-free/rev/9744cbe5ad6a]
http://bugs.dwscoalition.org/show_bug.cgi?id=906
Let's be positive! Let's don't not avoid double negatives! Part 1
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=906
Let's be positive! Let's don't not avoid double negatives! Part 1
Patch by
Files modified:
- bin/ljmaint.pl
- bin/maint/stats.pl
- bin/qbufferd.pl
- cgi-bin/Apache/LiveJournal.pm
- cgi-bin/DW/Logic/UserLinkBar.pm
- cgi-bin/DW/User/Edges/WatchTrust.pm
- cgi-bin/LJ/Console/Command/TagDisplay.pm
- cgi-bin/LJ/Console/Command/TagPermissions.pm
- cgi-bin/LJ/EmbedModule.pm
- cgi-bin/LJ/Event.pm
- cgi-bin/LJ/EventLogRecord.pm
- cgi-bin/LJ/Hooks/PingBack.pm
- cgi-bin/LJ/NotificationMethod.pm
- cgi-bin/LJ/Portal/Box/PopWithFriends.pm
- cgi-bin/LJ/S2.pm
- cgi-bin/LJ/S2/EntryPage.pm
- cgi-bin/LJ/S2/ReplyPage.pm
- cgi-bin/LJ/SMS/Message.pm
- cgi-bin/LJ/SMS/MessageHandler.pm
- cgi-bin/LJ/Subscription.pm
- cgi-bin/LJ/User.pm
- cgi-bin/LJ/Widget/InboxFolderNav.pm
- cgi-bin/LJ/Widget/UserpicDisplay.pm
- cgi-bin/cleanhtml.pl
- cgi-bin/communitylib.pl
- cgi-bin/ljfeed.pl
- cgi-bin/ljmemories.pl
- cgi-bin/ljprotocol.pl
- cgi-bin/ljrelation.pl
- cgi-bin/modperl_subs.pl
- cgi-bin/taglib.pl
- cgi-bin/talklib.pl
- cgi-bin/weblib.pl
- htdocs/admin/schools/edit.bml
- htdocs/admin/schools/merge.bml
- htdocs/admin/schools/pending.bml
- htdocs/admin/schools/rename.bml
- htdocs/changepassword.bml
- htdocs/editjournal.bml
- htdocs/editpics.bml
- htdocs/editprivacy.bml
- htdocs/edittags.bml
- htdocs/inbox/compose.bml
- htdocs/inbox/index.bml
- htdocs/interests.bml
- htdocs/login.bml
- htdocs/lostinfo.bml
- htdocs/manage/emailpost.bml
- htdocs/manage/profile/index.bml
- htdocs/manage/subscriptions/comments.bml
- htdocs/manage/subscriptions/entry.bml
- htdocs/manage/subscriptions/user.bml
- htdocs/manage/tags.bml
- htdocs/schools/index.bml
- htdocs/schools/manage.bml
- htdocs/stats.bml
- htdocs/support/faqbrowse.bml
- htdocs/tools/tellafriend.bml
- htdocs/update.bml
- t/esn-end2end.t
--------------------------------------------------------------------------------
diff -r 8a1365af63d4 -r 9744cbe5ad6a bin/ljmaint.pl
--- a/bin/ljmaint.pl Thu May 07 16:33:04 2009 +0000
+++ b/bin/ljmaint.pl Fri May 08 13:04:45 2009 +0000
@@ -14,7 +14,7 @@ unless (-d $ENV{'LJHOME'}) {
require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl";
-if ($LJ::DISABLED{ljmaint_tasks}) {
+unless ( LJ::is_enabled('ljmaint_tasks') ) {
print "ljmaint.pl tasks disabled, exiting\n";
exit 0;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a bin/maint/stats.pl
--- a/bin/maint/stats.pl Thu May 07 16:33:04 2009 +0000
+++ b/bin/maint/stats.pl Fri May 08 13:04:45 2009 +0000
@@ -55,7 +55,7 @@ require "$ENV{'LJHOME'}/cgi-bin/statslib
my $db = $db_getter->();
return undef unless $db;
- return {} if $LJ::DISABLED{'interests-popular'};
+ return {} unless LJ::is_enabled('interests-popular');
# see what the previous min was, then subtract 20% of max from it
my ($prev_min, $prev_max) = $db->selectrow_array("SELECT MIN(statval), MAX(statval) " .
@@ -90,7 +90,7 @@ require "$ENV{'LJHOME'}/cgi-bin/statslib
my $db = $db_getter->();
return undef unless $db;
- return {} if $LJ::DISABLED{'clientversionlog'};
+ return {} unless LJ::is_enabled('clientversionlog');
my $usertotal = $db->selectrow_array("SELECT MAX(userid) FROM user");
my $blocks = LJ::Stats::num_blocks($usertotal);
diff -r 8a1365af63d4 -r 9744cbe5ad6a bin/qbufferd.pl
--- a/bin/qbufferd.pl Thu May 07 16:33:04 2009 +0000
+++ b/bin/qbufferd.pl Fri May 08 13:04:45 2009 +0000
@@ -18,7 +18,7 @@ exit 1 unless GetOptions('foreground' =>
'stop' => \$opt_stop,
);
-if ($LJ::DISABLED{qbufferd_jobs}) {
+unless ( LJ::is_enabled('qbufferd_jobs') ) {
print "qbufferd.pl jobs disabled, exiting\n";
exit 0;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/Apache/LiveJournal.pm Fri May 08 13:04:45 2009 +0000
@@ -129,7 +129,7 @@ sub handler
}
# reload libraries that might've changed
- if ($LJ::IS_DEV_SERVER && !$LJ::DISABLED{'module_reload'}) {
+ if ( $LJ::IS_DEV_SERVER && LJ::is_enabled('module_reload') ) {
my %to_reload;
while (my ($file, $mod) = each %LJ::LIB_MOD_TIME) {
my $cur_mod = (stat($file))[9];
@@ -675,9 +675,9 @@ sub trans
or return 404;
my ($type, $nodeid) =
- $LJ::DISABLED{'named_permalinks'} ? () :
+ LJ::is_enabled('named_permalinks') ?
$u->selectrow_array("SELECT nodetype, nodeid FROM urimap WHERE journalid=? AND uri=?",
- undef, $u->{userid}, $key);
+ undef, $u->{userid}, $key) : ();
if ($type eq "L") {
$ljentry = LJ::Entry->new($u, ditemid => $nodeid);
if ($GET{'mode'} eq "reply" || $GET{'replyto'} || $GET{'edit'}) {
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/DW/Logic/UserLinkBar.pm
--- a/cgi-bin/DW/Logic/UserLinkBar.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/DW/Logic/UserLinkBar.pm Fri May 08 13:04:45 2009 +0000
@@ -393,7 +393,7 @@ sub tellafriend {
my $remote = $self->{remote};
my $user = $u->user;
- if ( $remote && $u->{journaltype} ne 'I' && ! $LJ::DISABLED{tellafriend} )
+ if ( $remote && $u->{journaltype} ne 'I' && LJ::is_enabled('tellafriend') )
{
my $link = {
url => "tools/tellafriend.bml?user=$user",
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/DW/User/Edges/WatchTrust.pm
--- a/cgi-bin/DW/User/Edges/WatchTrust.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/DW/User/Edges/WatchTrust.pm Fri May 08 13:04:45 2009 +0000
@@ -138,7 +138,7 @@ sub _add_wt_edge {
# fire notifications if we have theschwartz
if ( my $sclient = LJ::theschwartz() ) {
- my $notify = !$LJ::DISABLED{esn} &&
+ my $notify = LJ::is_enabled('esn') &&
!$from_u->equals( $to_u ) &&
$from_u->is_visible &&
( $from_u->is_personal || $from_u->is_identity ) &&
@@ -217,7 +217,7 @@ sub _del_wt_edge {
# fire notifications if we have theschwartz
if ( my $sclient = LJ::theschwartz() ) {
- my $notify = !$LJ::DISABLED{esn} &&
+ my $notify = LJ::is_enabled('esn') &&
!$from_u->equals( $to_u ) &&
$from_u->is_visible &&
( $from_u->is_personal || $from_u->is_identity ) &&
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Console/Command/TagDisplay.pm
--- a/cgi-bin/LJ/Console/Command/TagDisplay.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Console/Command/TagDisplay.pm Fri May 08 13:04:45 2009 +0000
@@ -22,7 +22,7 @@ sub execute {
my ($self, @args) = @_;
return $self->error("Sorry, the tag system is currently disabled.")
- if $LJ::DISABLED{tags};
+ unless LJ::is_enabled('tags');
return $self->error("This command takes either two or four arguments. Consult the reference.")
unless scalar(@args) == 2 || scalar(@args) == 4;
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Console/Command/TagPermissions.pm
--- a/cgi-bin/LJ/Console/Command/TagPermissions.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Console/Command/TagPermissions.pm Fri May 08 13:04:45 2009 +0000
@@ -22,7 +22,7 @@ sub execute {
my ($self, @args) = @_;
return $self->error("Sorry, the tag system is currently disabled.")
- if $LJ::DISABLED{tags};
+ unless LJ::is_enabled('tags');
return $self->error("This command takes either two or four arguments. Consult the reference.")
unless scalar(@args) == 2 || scalar(@args) == 4;
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/EmbedModule.pm
--- a/cgi-bin/LJ/EmbedModule.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/EmbedModule.pm Fri May 08 13:04:45 2009 +0000
@@ -220,7 +220,7 @@ sub module_iframe_tag {
sub module_iframe_tag {
my ($class, $u, $moduleid, %opts) = @_;
- return '' if $LJ::DISABLED{embed_module};
+ return '' unless LJ::is_enabled('embed_module');
my $journalid = $u->userid;
$moduleid += 0;
@@ -372,7 +372,7 @@ sub module_content {
LJ::text_uncompress(\$content) if $content =~ s/^C-//;
# clean js out of content
- unless ($LJ::DISABLED{'embedmodule-cleancontent'}) {
+ if ( LJ::is_enabled('embedmodule-cleancontent') ) {
LJ::CleanHTML::clean(\$content, {
addbreaks => 0,
tablecheck => 0,
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Event.pm
--- a/cgi-bin/LJ/Event.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Event.pm Fri May 08 13:04:45 2009 +0000
@@ -234,7 +234,7 @@ sub process_fired_events {
# are no subscriptions for the event.
sub fire {
my $self = shift;
- return 0 if $LJ::DISABLED{'esn'};
+ return 0 unless LJ::is_enabled('esn');
my $sclient = LJ::theschwartz( { role => $self->schwartz_role } );
return 0 unless $sclient;
@@ -251,7 +251,7 @@ sub fire {
# return undef.
sub fire_job {
my $self = shift;
- return if $LJ::DISABLED{'esn'};
+ return unless LJ::is_enabled('esn');
if (my $val = $LJ::DEBUG{'firings'}) {
if (ref $val eq "CODE") {
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/EventLogRecord.pm
--- a/cgi-bin/LJ/EventLogRecord.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/EventLogRecord.pm Fri May 08 13:04:45 2009 +0000
@@ -40,7 +40,7 @@ sub params {
# creates a job to insert into the schwartz to process this firing
sub fire_job {
my $self = shift;
- return if $LJ::DISABLED{'eventlogrecord'};
+ return unless LJ::is_enabled('eventlogrecord');
my $params = $self->params;
$params->{_event_type} = $self->event_type;
@@ -53,7 +53,7 @@ sub fire_job {
# inserts a job into the schwartz to process this event
sub fire {
my $self = shift;
- return if $LJ::DISABLED{'eventlogrecord'};
+ return unless LJ::is_enabled('eventlogrecord');
my $sclient = LJ::theschwartz()
or die "Could not get TheSchwartz client";
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Hooks/PingBack.pm
--- a/cgi-bin/LJ/Hooks/PingBack.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Hooks/PingBack.pm Fri May 08 13:04:45 2009 +0000
@@ -4,8 +4,8 @@ use LJ::PingBack;
sub has_pingback {
my $u = shift;
- return 0 if $LJ::DISABLED{'pingback'};
- return 0 unless $u->is_in_beta("pingback");
+ return 0 unless LJ::is_enabled('pingback');
+ return 0 unless $u->is_in_beta('pingback');
return 1;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/NotificationMethod.pm
--- a/cgi-bin/LJ/NotificationMethod.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/NotificationMethod.pm Fri May 08 13:04:45 2009 +0000
@@ -108,7 +108,7 @@ sub all_available_methods {
croak "all_classes is a class method" unless $class;
return grep {
- ! $LJ::DISABLED{$_} &&
+ LJ::is_enabled($_) &&
$_->configured
} @LJ::NOTIFY_TYPES;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Portal/Box/PopWithFriends.pm
--- a/cgi-bin/LJ/Portal/Box/PopWithFriends.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Portal/Box/PopWithFriends.pm Fri May 08 13:04:45 2009 +0000
@@ -57,9 +57,7 @@ sub generate_content {
my $LIMIT=300;
- if ($LJ::DISABLED{'friendspopwithfriends'}) {
- return 'Sorry, this feature is disabled.';
- }
+ return 'Sorry, this feature is disabled.' unless LJ::is_enabled('friendspopwithfriends');
unless (LJ::get_cap($u, "friendspopwithfriends")) {
return BML::ml("portal.popwithfriends.accttype");
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/S2.pm Fri May 08 13:04:45 2009 +0000
@@ -1856,10 +1856,10 @@ sub Entry
$e->{'depth'} = 0; # Entries are always depth 0. Comments are 1+.
my $link_keyseq = $e->{'link_keyseq'};
- push @$link_keyseq, 'mem_add' unless $LJ::DISABLED{'memories'};
- push @$link_keyseq, 'tell_friend' unless $LJ::DISABLED{'tellafriend'};
- push @$link_keyseq, 'watch_comments' unless $LJ::DISABLED{'esn'};
- push @$link_keyseq, 'unwatch_comments' unless $LJ::DISABLED{'esn'};
+ push @$link_keyseq, 'mem_add' if LJ::is_enabled('memories');
+ push @$link_keyseq, 'tell_friend' if LJ::is_enabled('tellafriend');
+ push @$link_keyseq, 'watch_comments' if LJ::is_enabled('esn');
+ push @$link_keyseq, 'unwatch_comments' if LJ::is_enabled('esn');
# Note: nav_prev and nav_next are not included in the keyseq anticipating
# that their placement relative to the others will vary depending on
@@ -2232,7 +2232,7 @@ sub UserLite
};
my $lks = $o->{link_keyseq};
push @$lks, qw(manage_membership trust watch post_entry track message);
- push @$lks, 'tell_friend' unless $LJ::DISABLED{tellafriend};
+ push @$lks, 'tell_friend' if LJ::is_enabled('tellafriend');
# TODO: Figure out some way to use the userinfo_linkele hook here?
@@ -2923,7 +2923,7 @@ sub _Comment__get_link
if ($key eq "watch_thread" || $key eq "unwatch_thread" || $key eq "watching_parent") {
- return $null_link if $LJ::DISABLED{'esn'};
+ return $null_link unless LJ::is_enabled('esn');
return $null_link unless $remote && $remote->can_use_esn;
if ($key eq "unwatch_thread") {
@@ -3123,7 +3123,7 @@ sub _print_quickreply_link
}
$onclick = "" unless $page->{'_type'} eq 'EntryPage';
- $onclick = "" if $LJ::DISABLED{'s2quickreply'};
+ $onclick = "" unless LJ::is_enabled('s2quickreply');
# See if we want to force them to change their password
my $bp = LJ::bad_password_redirect({ 'returl' => 1 });
@@ -3498,7 +3498,7 @@ sub _Entry__get_link
LJ::S2::Image("$LJ::IMGPREFIX/silk/entry/tag_edit.png", 16, 16));
}
if ($key eq "tell_friend") {
- return $null_link if $LJ::DISABLED{'tellafriend'};
+ return $null_link unless LJ::is_enabled('tellafriend');
my $entry = LJ::Entry->new($journalu->{'userid'}, ditemid => $this->{'itemid'});
return $null_link unless $entry->can_tellafriend($remote);
return LJ::S2::Link("$LJ::SITEROOT/tools/tellafriend.bml?journal=$journal&itemid=$this->{'itemid'}",
@@ -3506,7 +3506,7 @@ sub _Entry__get_link
LJ::S2::Image("$LJ::IMGPREFIX/silk/entry/tellafriend.png", 16, 16));
}
if ($key eq "mem_add") {
- return $null_link if $LJ::DISABLED{'memories'};
+ return $null_link unless LJ::is_enabled('memories');
return LJ::S2::Link("$LJ::SITEROOT/tools/memadd.bml?journal=$journal&itemid=$this->{'itemid'}",
$ctx->[S2::PROPS]->{"text_mem_add"},
LJ::S2::Image("$LJ::IMGPREFIX/silk/entry/memories_add.png", 16, 16));
@@ -3547,7 +3547,7 @@ sub _Entry__get_link
}
if ($key eq "watch_comments") {
- return $null_link if $LJ::DISABLED{'esn'};
+ return $null_link unless LJ::is_enabled('esn');
return $null_link unless $remote && $remote->can_use_esn;
return $null_link if $remote->has_subscription(
journal => LJ::load_user($journal),
@@ -3578,7 +3578,7 @@ sub _Entry__get_link
'class' => 'TrackButton'));
}
if ($key eq "unwatch_comments") {
- return $null_link if $LJ::DISABLED{'esn'};
+ return $null_link unless LJ::is_enabled('esn');
return $null_link unless $remote && $remote->can_use_esn;
my @subs = $remote->has_subscription(
journal => LJ::load_user($journal),
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/S2/EntryPage.pm Fri May 08 13:04:45 2009 +0000
@@ -71,7 +71,7 @@ sub EntryPage
stc/lj_base.css
js/datasource.js
js/selectable_table.js
- )) if ! $LJ::DISABLED{userpicselect} && $remote && $remote->get_cap('userpicselect');
+ )) if LJ::is_enabled('userpicselect') && $remote && $remote->get_cap('userpicselect');
LJ::need_res(qw(
js/x_core.js
@@ -263,10 +263,10 @@ sub EntryPage
my $link_keyseq = $s2com->{'link_keyseq'};
push @$link_keyseq, $s2com->{'screened'} ? 'unscreen_comment' : 'screen_comment';
push @$link_keyseq, $s2com->{'frozen'} ? 'unfreeze_thread' : 'freeze_thread';
- push @$link_keyseq, "watch_thread" unless $LJ::DISABLED{'esn'};
- push @$link_keyseq, "unwatch_thread" unless $LJ::DISABLED{'esn'};
- push @$link_keyseq, "watching_parent" unless $LJ::DISABLED{'esn'};
- unshift @$link_keyseq, "edit_comment" if LJ::is_enabled("edit_comments");
+ push @$link_keyseq, "watch_thread" if LJ::is_enabled('esn');
+ push @$link_keyseq, "unwatch_thread" if LJ::is_enabled('esn');
+ push @$link_keyseq, "watching_parent" if LJ::is_enabled('esn');
+ unshift @$link_keyseq, "edit_comment" if LJ::is_enabled('edit_comments');
$s2com->{'thread_url'} = LJ::Talk::talkargs($permalink, "thread=$dtalkid", $style_arg) . "#t$dtalkid";
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/S2/ReplyPage.pm
--- a/cgi-bin/LJ/S2/ReplyPage.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/S2/ReplyPage.pm Fri May 08 13:04:45 2009 +0000
@@ -194,10 +194,10 @@ sub ReplyPage
my $link_keyseq = $replyto->{'link_keyseq'};
push @$link_keyseq, $replyto->{'screened'} ? 'unscreen_comment' : 'screen_comment';
push @$link_keyseq, $replyto->{'frozen'} ? 'unfreeze_thread' : 'freeze_thread';
- push @$link_keyseq, "watch_thread" unless $LJ::DISABLED{'esn'};
- push @$link_keyseq, "unwatch_thread" unless $LJ::DISABLED{'esn'};
- push @$link_keyseq, "watching_parent" unless $LJ::DISABLED{'esn'};
- unshift @$link_keyseq, "edit_comment" if LJ::is_enabled("edit_comments");
+ push @$link_keyseq, "watch_thread" if LJ::is_enabled('esn');
+ push @$link_keyseq, "unwatch_thread" if LJ::is_enabled('esn');
+ push @$link_keyseq, "watching_parent" if LJ::is_enabled('esn');
+ unshift @$link_keyseq, "edit_comment" if LJ::is_enabled('edit_comments');
}
$p->{'replyto'} = $replyto;
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/SMS/Message.pm
--- a/cgi-bin/LJ/SMS/Message.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/SMS/Message.pm Fri May 08 13:04:45 2009 +0000
@@ -851,7 +851,7 @@ sub send {
};
# is SMS disabled?
- return $err->("SMS is disabled") if $LJ::DISABLED{sms};
+ return $err->("SMS is disabled") unless LJ::is_enabled('sms');
# verify type of this message
$self->type('outgoing');
@@ -863,7 +863,7 @@ sub send {
# do not send a message to a user with no quota remaining
return $err->("no quota remaining")
- unless $LJ::DISABLED{sms_quota_check} || $opts{no_quota} || $to_u->sms_quota_remaining || $LJ::_T_NO_SMS_QUOTA;
+ unless ! LJ::is_enabled('sms_quota_check') || $opts{no_quota} || $to_u->sms_quota_remaining || $LJ::_T_NO_SMS_QUOTA;
# do not send message to this user unless they are confirmed and active
return $err->("sms not active for user: $to_u->{user}")
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/SMS/MessageHandler.pm
--- a/cgi-bin/LJ/SMS/MessageHandler.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/SMS/MessageHandler.pm Fri May 08 13:04:45 2009 +0000
@@ -22,9 +22,7 @@ sub handle {
# this is the master switch, not a code ref... if it's set we
# won't even attempt to save/process SMS messages
- if ($LJ::DISABLED{sms}) {
- die "SMS globally disabled\n";
- }
+ die "SMS globally disabled\n" unless LJ::is_enabled('sms');
# save msg to the db
$msg->save_to_db
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Subscription.pm
--- a/cgi-bin/LJ/Subscription.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Subscription.pm Fri May 08 13:04:45 2009 +0000
@@ -546,7 +546,7 @@ sub process {
# pass along debugging information from the schwartz job
$note->{_debug_headers} = $self->{_debug_headers} if $LJ::DEBUG{esn_email_headers};
- return 1 if $self->etypeid == LJ::Event::OfficialPost->etypeid && $LJ::DISABLED{"officialpost_esn"};
+ return 1 if $self->etypeid == LJ::Event::OfficialPost->etypeid && ! LJ::is_enabled('officialpost_esn');
# significant events (such as SecurityAttributeChanged) must be processed even for inactive users.
return 1
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/User.pm Fri May 08 13:04:45 2009 +0000
@@ -995,7 +995,7 @@ sub note_activity {
return undef unless @LJ::MEMCACHE_SERVERS;
# Also disable via config flag
- return undef if $LJ::DISABLED{active_user_tracking};
+ return undef unless LJ::is_enabled('active_user_tracking');
my $now = time();
my $uid = $u->{userid}; # yep, lazy typist w/ rsi
@@ -1276,7 +1276,7 @@ sub note_transition {
my ($u, $what, $from, $to) = @_;
croak "invalid user object" unless LJ::isu($u);
- return 1 if $LJ::DISABLED{user_transitions};
+ return 1 unless LJ::is_enabled('user_transitions');
# we don't want to insert if the requested transition is already
# the last noted one for this user... in that case there has been
@@ -1575,7 +1575,7 @@ sub can_use_stylealwaysmine {
my $u = shift;
my $ret = 0;
- return 0 if $LJ::DISABLED{stylealwaysmine};
+ return 0 unless LJ::is_enabled('stylealwaysmine');
$ret = LJ::run_hook("can_use_stylealwaysmine", $u);
return $ret;
}
@@ -2187,7 +2187,7 @@ sub show_thread_expander {
sub _lazy_migrate_infoshow {
my ($u) = @_;
- return 1 if $LJ::DISABLED{infoshow_migrate};
+ return 1 unless LJ::is_enabled('infoshow_migrate');
# 1) column exists, but value is migrated
# 2) column has died from 'user')
@@ -4537,7 +4537,7 @@ sub can_use_ebox_ui {
my $u = shift;
my $allow_ebox = 1;
- if ($LJ::DISABLED{ebox_option}) {
+ unless ( LJ::is_enabled('ebox_option') ) {
$allow_ebox = $u->prop('journal_box_entries');
}
@@ -4668,7 +4668,7 @@ sub show_control_strip {
sub show_control_strip {
my $u = shift;
- LJ::run_hook('control_strip_propcheck', $u, 'show_control_strip') unless $LJ::DISABLED{control_strip_propcheck};
+ LJ::run_hook('control_strip_propcheck', $u, 'show_control_strip') if LJ::is_enabled('control_strip_propcheck');
my $prop = $u->raw_prop('show_control_strip');
return 0 if $prop =~ /^off/;
@@ -4682,7 +4682,7 @@ sub view_control_strip {
sub view_control_strip {
my $u = shift;
- LJ::run_hook('control_strip_propcheck', $u, 'view_control_strip') unless $LJ::DISABLED{control_strip_propcheck};
+ LJ::run_hook('control_strip_propcheck', $u, 'view_control_strip') if LJ::is_enabled('control_strip_propcheck');
my $prop = $u->raw_prop('view_control_strip');
return 0 if $prop =~ /^off/;
@@ -4854,7 +4854,7 @@ sub message_url {
my $u = shift;
croak "invalid user object passed" unless LJ::isu($u);
- return undef if $LJ::DISABLED{user_messaging};
+ return undef unless LJ::is_enabled('user_messaging');
return "$LJ::SITEROOT/inbox/compose.bml?user=$u->{'user'}";
}
@@ -6019,7 +6019,7 @@ sub get_remote
# keep track of activity for the user we just loaded from db/memcache
# - if necessary, this code will actually run in Apache's cleanup handler
# so latency won't affect the user
- if (@LJ::MEMCACHE_SERVERS && ! $LJ::DISABLED{active_user_tracking}) {
+ if ( @LJ::MEMCACHE_SERVERS && LJ::is_enabled('active_user_tracking') ) {
push @LJ::CLEANUP_HANDLERS, sub { $u->note_activity('A') };
}
@@ -7935,7 +7935,7 @@ sub bad_password_redirect {
my $remote = LJ::get_remote();
return undef unless $remote;
- return undef if $LJ::DISABLED{'force_pass_change'};
+ return undef unless LJ::is_enabled('force_pass_change');
return undef unless $remote->prop('badpassword');
@@ -8497,7 +8497,7 @@ sub make_journal
# error if disabled
return $error->("Sorry, the tag system is currently disabled.", "404 Not Found")
- if $LJ::DISABLED{tags};
+ unless LJ::is_enabled('tags');
# throw an error if we're rendering in S1, but not for renamed accounts
return $error->("Sorry, tag filtering is not supported within S1 styles.", "404 Not Found")
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Widget/InboxFolderNav.pm
--- a/cgi-bin/LJ/Widget/InboxFolderNav.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Widget/InboxFolderNav.pm Fri May 08 13:04:45 2009 +0000
@@ -47,21 +47,21 @@ sub render_body {
$message_button = qq{
<form action="./compose.bml" method="GET">
<input type="submit" value="<?_ml inbox.menu.new_message.btn _ml?>" style="width: 100%">
- </form>} unless $LJ::DISABLED{user_messaging};
+ </form>} if LJ::is_enabled('user_messaging');
$body .= qq{
$message_button
<div class="folders"><p>
<a href="." id="esn_folder_all"><?_ml inbox.menu.all _ml?>$unread_all</a>};
- $body .= qq{<a href=".?view=usermsg_recvd" class="subs" id="esn_folder_usermsg_recvd"><?_ml inbox.menu.messages _ml?>$unread_usermsg_recvd</a>} unless $LJ::DISABLED{user_messaging};
+ $body .= qq{<a href=".?view=usermsg_recvd" class="subs" id="esn_folder_usermsg_recvd"><?_ml inbox.menu.messages _ml?>$unread_usermsg_recvd</a>} if LJ::is_enabled('user_messaging');
$body .= qq{<a href=".?view=friendplus" class="subs" id="esn_folder_friendplus"><?_ml inbox.menu.friend_updates _ml?>$unread_friend</a>
<a href=".?view=birthday" class="subsubs" id="esn_folder_birthday"><?_ml inbox.menu.birthdays _ml?></a>
<a href=".?view=befriended" class="subsubs" id="esn_folder_befriended"><?_ml inbox.menu.new_friends _ml?></a><a href=".?view=entrycomment" class="subs" id="esn_folder_entrycomment"><?_ml inbox.menu.entries_and_comments _ml?>$unread_entrycomment</a>
<span class="subs">---</span>
<a href=".?view=bookmark" class="subs" id="esn_folder_bookmark"><?_ml inbox.menu.bookmarks _ml?> <img src="$LJ::IMGPREFIX/flag_on.gif" width="12" height="14" border="0" /></a>};
- $body .= qq{<a href=".?view=usermsg_sent" class="subs" id="esn_folder_usermsg_sent"><?_ml inbox.menu.sent _ml?>$unread_usermsg_sent</a>\n} unless $LJ::DISABLED{user_messaging};
- $body .= qq{<a href=".?view=archived" class="subs" id="esn_folder_archived"><?_ml inbox.menu.archive _ml?></a>\n} unless $LJ::DISABLED{esn_archive};
+ $body .= qq{<a href=".?view=usermsg_sent" class="subs" id="esn_folder_usermsg_sent"><?_ml inbox.menu.sent _ml?>$unread_usermsg_sent</a>\n} if LJ::is_enabled('user_messaging');
+ $body .= qq{<a href=".?view=archived" class="subs" id="esn_folder_archived"><?_ml inbox.menu.archive _ml?></a>\n} if LJ::is_enabled('esn_archive');
$body .= qq{
</p></div> <br />
};
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/LJ/Widget/UserpicDisplay.pm
--- a/cgi-bin/LJ/Widget/UserpicDisplay.pm Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/LJ/Widget/UserpicDisplay.pm Fri May 08 13:04:45 2009 +0000
@@ -201,7 +201,7 @@ sub render_body {
userpic_preview();
};
$$picform .= "insertViewThumbs()"
- if (!$LJ::DISABLED{userpicselect} && $u->get_cap('userpicselect'));
+ if LJ::is_enabled('userpicselect') && $u->get_cap('userpicselect');
$$picform .= "</script>\n";
} elsif (!$u) {
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/cleanhtml.pl
--- a/cgi-bin/cleanhtml.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/cleanhtml.pl Fri May 08 13:04:45 2009 +0000
@@ -470,7 +470,7 @@ sub clean
elsif ($tag eq "style") {
my $style = $p->get_text("/style");
$p->get_tag("/style");
- unless ($LJ::DISABLED{'css_cleaner'}) {
+ if ( LJ::is_enabled('css_cleaner') ) {
my $cleaner = LJ::CSS::Cleaner->new;
$style = $cleaner->clean($style);
LJ::run_hook('css_cleaner_transform', \$style);
@@ -648,7 +648,7 @@ sub clean
}
}
- if ($opts->{'clean_js_css'} && ! $LJ::DISABLED{'css_cleaner'}) {
+ if ( $opts->{'clean_js_css'} && LJ::is_enabled('css_cleaner') ) {
# and then run it through a harder CSS cleaner that does a full parse
my $css = LJ::CSS::Cleaner->new;
$hash->{style} = $css->clean_property($hash->{style});
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/communitylib.pl
--- a/cgi-bin/communitylib.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/communitylib.pl Fri May 08 13:04:45 2009 +0000
@@ -119,7 +119,7 @@ sub send_comm_invite {
}
# Fire community invite event
- LJ::Event::CommunityInvite->new($u, $mu, $cu)->fire unless $LJ::DISABLED{esn};
+ LJ::Event::CommunityInvite->new($u, $mu, $cu)->fire if LJ::is_enabled('esn');
# step 7: error check database work
return LJ::error('db') if $u->err || $cu->err;
@@ -414,7 +414,7 @@ sub approve_pending_member {
unless ($u->has_subscription(%params)) {
$u->subscribe(%params, method => 'Email');
}
- LJ::Event::CommunityJoinApprove->new($u, $cu)->fire unless $LJ::DISABLED{esn};
+ LJ::Event::CommunityJoinApprove->new($u, $cu)->fire if LJ::is_enabled('esn');
return 1;
}
@@ -445,7 +445,7 @@ sub reject_pending_member {
unless ($u->has_subscription(%params)) {
$u->subscribe(%params, method => 'Email');
}
- LJ::Event::CommunityJoinReject->new($u, $cu)->fire unless $LJ::DISABLED{esn};
+ LJ::Event::CommunityJoinReject->new($u, $cu)->fire if LJ::is_enabled('esn');
return 1;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/ljfeed.pl
--- a/cgi-bin/ljfeed.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/ljfeed.pl Fri May 08 13:04:45 2009 +0000
@@ -712,7 +712,7 @@ sub create_view_foaf {
# user schools
if ($u->{'journaltype'} ne 'Y' &&
- !$LJ::DISABLED{'schools'} &&
+ LJ::is_enabled('schools') &&
($u->{'opt_showschools'} eq '' || $u->{'opt_showschools'} eq 'Y')) {
my $schools = LJ::Schools::get_attended($u);
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/ljmemories.pl
--- a/cgi-bin/ljmemories.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/ljmemories.pl Fri May 08 13:04:45 2009 +0000
@@ -316,7 +316,7 @@ sub _get_memcache_keyword_counts {
# Loop over our memcache results, get counts and total them as we go
my (%output_counts, @missing_keys);
- my $memcache_counts = $LJ::DISABLED{'memkwcnt_memcaching'} ? {} : LJ::MemCache::get_multi(map { [$userid, $_] } @memcache_keys);
+ my $memcache_counts = LJ::is_enabled('memkwcnt_memcaching') ? LJ::MemCache::get_multi(map { [$userid, $_] } @memcache_keys) : {};
foreach my $memcache_key (@memcache_keys) {
my $counts = $memcache_counts->{$memcache_key};
if ($counts) { # Add these memcache counts to totals
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/ljprotocol.pl Fri May 08 13:04:45 2009 +0000
@@ -460,7 +460,7 @@ sub sendmessage
{
my ($req, $err, $flags) = @_;
- return fail($err, 315) if $LJ::DISABLED{user_messaging};
+ return fail($err, 315) unless LJ::is_enabled('user_messaging');
return undef unless authenticate($req, $err, $flags);
my $u = $flags->{'u'};
@@ -625,7 +625,7 @@ sub login
## update or add to clientusage table
if ($req->{'clientversion'} =~ /^\S+\/\S+$/ &&
- ! $LJ::DISABLED{'clientversionlog'})
+ LJ::is_enabled('clientversionlog'))
{
my $client = $req->{'clientversion'};
@@ -1500,8 +1500,8 @@ sub postevent
my @jobs; # jobs to add into TheSchwartz
# notify weblogs.com of post if necessary
- if (!$LJ::DISABLED{'weblogs_com'} && $u->{'opt_weblogscom'} && LJ::get_cap($u, "weblogscom") &&
- $security eq "public" && !$req->{'props'}->{'opt_backdated'}) {
+ if ( LJ::is_enabled('weblogs_com') && $u->{'opt_weblogscom'} && LJ::get_cap($u, "weblogscom") &&
+ ($security eq "public") && !$req->{'props'}->{'opt_backdated'} ) {
push @jobs, TheSchwartz::Job->new_from_array("LJ::Worker::Ping::WeblogsCom", {
'user' => $u->{'user'},
'title' => $u->{'journaltitle'} || $u->{'name'},
@@ -1539,7 +1539,7 @@ sub postevent
# but still fire the logging events
unless ( $flags->{nonotify} ) {
push @jobs, LJ::Event::JournalNewEntry->new($entry)->fire_job;
- push @jobs, LJ::Event::UserNewEntry->new($entry)->fire_job if (!$LJ::DISABLED{'esn-userevents'} || $LJ::_T_FIRE_USERNEWENTRY);
+ push @jobs, LJ::Event::UserNewEntry->new($entry)->fire_job if ( LJ::is_enabled('esn-userevents') || $LJ::_T_FIRE_USERNEWENTRY );
push @jobs, LJ::Event::OfficialPost->new($entry)->fire_job if $uowner->is_official;
}
push @jobs, LJ::EventLogRecord::NewEntry->new($entry)->fire_job;
@@ -2000,7 +2000,7 @@ sub getevents
}
elsif ($req->{'selecttype'} eq "syncitems")
{
- return fail($err,506) if $LJ::DISABLED{'syncitems'};
+ return fail($err,506) unless LJ::is_enabled('syncitems');
my $date = $req->{'lastsync'} || "0000-00-00 00:00:00";
return fail($err,203,"Invalid syncitems date format")
unless ($date =~ /^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/);
@@ -2386,7 +2386,7 @@ sub syncitems
my ($req, $err, $flags) = @_;
return undef unless authenticate($req, $err, $flags);
return undef unless check_altusage($req, $err, $flags);
- return fail($err,506) if $LJ::DISABLED{'syncitems'};
+ return fail($err,506) unless LJ::is_enabled('syncitems');
my $ownerid = $flags->{'ownerid'};
my $uowner = $flags->{'u_owner'} || $flags->{'u'};
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/ljrelation.pl
--- a/cgi-bin/ljrelation.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/ljrelation.pl Fri May 08 13:04:45 2009 +0000
@@ -189,7 +189,7 @@ sub load_rel_target_cache
# </LJFUNC>
sub _get_rel_memcache {
return undef unless @LJ::MEMCACHE_SERVERS;
- return undef if $LJ::DISABLED{memcache_reluser};
+ return undef unless LJ::is_enabled('memcache_reluser');
my ($userid, $targetid, $type) = @_;
return undef unless $userid && $targetid && defined $type;
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/modperl_subs.pl
--- a/cgi-bin/modperl_subs.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/modperl_subs.pl Fri May 08 13:04:45 2009 +0000
@@ -178,7 +178,7 @@ DirectoryIndex index.html index.bml
});
}
- unless ($LJ::DISABLED{ignore_htaccess}) {
+ if ( LJ::is_enabled('ignore_htaccess') ) {
LJ::ModPerl::add_httpd_config(qq{
<Directory />
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/taglib.pl
--- a/cgi-bin/taglib.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/taglib.pl Fri May 08 13:04:45 2009 +0000
@@ -18,7 +18,7 @@ use strict;
# return value of LJ::Tags::get_usertags -- undef on failure
# </LJFUNC>
sub get_usertagsmulti {
- return {} if $LJ::DISABLED{tags};
+ return {} unless LJ::is_enabled('tags');
# options if provided
my $opts = {};
@@ -263,7 +263,7 @@ sub _get_usertagsmulti {
# returns: Hashref; key being tag id, value being a large hashref (FIXME: document)
# </LJFUNC>
sub get_usertags {
- return {} if $LJ::DISABLED{tags};
+ return {} unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift)
or return undef;
@@ -319,7 +319,7 @@ TAG: foreach my $tagid (keys %$res) {
# returns: Hashref; { jitemid => { tagid => tagname, tagid => tagname, ... }, ... }
# </LJFUNC>
sub get_logtags {
- return {} if $LJ::DISABLED{tags};
+ return {} unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
return undef unless $u;
@@ -350,7 +350,7 @@ sub get_logtags {
# { tagid => tagname, ... }
# </LJFUNC>
sub get_logtagsmulti {
- return {} if $LJ::DISABLED{tags};
+ return {} unless LJ::is_enabled('tags');
# get parameter (only one!)
my $idsbycluster = shift;
@@ -456,7 +456,7 @@ sub get_logtagsmulti {
# returns: 1 if allowed, 0 if not, undef on error
# </LJFUNC>
sub can_add_tags {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my $remote = LJ::want_user(shift);
@@ -481,7 +481,7 @@ sub can_add_tags {
# returns: 1 if allowed, 0 if not, undef on error
# </LJFUNC>
sub can_control_tags {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my $remote = LJ::want_user(shift);
@@ -535,7 +535,7 @@ sub _remote_satisfies_permission {
# </LJFUNC>
sub get_permission_levels {
return { add => 'none', control => 'none' }
- if $LJ::DISABLED{tags};
+ unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
return undef unless $u;
@@ -673,7 +673,7 @@ sub get_security_breakdown {
# returns: 1 on success, undef on error
# </LJFUNC>
sub update_logtags {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my $jitemid = shift() + 0;
@@ -970,7 +970,7 @@ sub update_logtags {
# returns: undef on error; 1 on success
# </LJFUNC>
sub delete_logtags {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my $jitemid = shift() + 0;
@@ -993,7 +993,7 @@ sub delete_logtags {
# returns: undef on error; 1 on success
# </LJFUNC>
sub reset_cache {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
while (my ($u, $jitemid) = splice(@_, 0, 2)) {
next unless
@@ -1031,7 +1031,7 @@ sub reset_cache {
# returns: undef on error, else a hashref of { keyword => tagid } for each keyword defined
# </LJFUNC>
sub create_usertag {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my $kw = shift;
@@ -1111,7 +1111,7 @@ sub validate_tag {
# returns: undef on error, 1 for success, 0 for tag not found
# </LJFUNC>
sub delete_usertag {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
return undef unless $u;
@@ -1181,7 +1181,7 @@ sub delete_usertag {
# returns: undef on error, 1 for success, 0 for tag not found
# </LJFUNC>
sub rename_usertag {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
# FIXME/TODO: make this function do merging?
@@ -1266,7 +1266,7 @@ sub rename_usertag {
# returns: 1 on success, undef on error
# </LJFUNC>
sub set_usertag_display {
- return undef if $LJ::DISABLED{tags};
+ return undef unless LJ::is_enabled('tags');
my $u = LJ::want_user(shift);
my ($type, $var, $val) = @_;
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/talklib.pl
--- a/cgi-bin/talklib.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/talklib.pl Fri May 08 13:04:45 2009 +0000
@@ -130,7 +130,7 @@ sub link_bar
$$headref .= "<link href='$LJ::SITEROOT/go.bml?${jargent}itemid=$itemid&dir=prev' rel='Previous' />\n";
# memories
- unless ($LJ::DISABLED{'memories'}) {
+ if ( LJ::is_enabled('memories') ) {
push @linkele, $mlink->("$LJ::SITEROOT/tools/memadd.bml?${jargent}itemid=$itemid", "memadd");
}
@@ -144,13 +144,13 @@ sub link_bar
}
# edit tags
- unless ($LJ::DISABLED{tags}) {
+ if ( LJ::is_enabled('tags') ) {
if (defined $remote && LJ::Tags::can_add_tags($u, $remote)) {
push @linkele, $mlink->("$LJ::SITEROOT/edittags.bml?${jargent}itemid=$itemid", "edittags");
}
}
- unless ($LJ::DISABLED{'tellafriend'}) {
+ if ( LJ::is_enabled('tellafriend') ) {
push @linkele, $mlink->("$LJ::SITEROOT/tools/tellafriend.bml?${jargent}itemid=$itemid", "tellfriend")
if ($entry->can_tellafriend($remote));
}
@@ -2658,13 +2658,13 @@ sub enter_comment {
LJ::Talk::update_commentalter($journalu, $itemid);
# fire events
- unless ($LJ::DISABLED{esn}) {
+ if ( LJ::is_enabled('esn') ) {
my $cmtobj = LJ::Comment->new($journalu, jtalkid => $jtalkid);
my @jobs;
push @jobs, LJ::Event::JournalNewComment->new($cmtobj)->fire_job;
push @jobs, LJ::Event::UserNewComment->new($cmtobj)->fire_job
- if $cmtobj->poster && ! $LJ::DISABLED{'esn-userevents'};
+ if $cmtobj->poster && LJ::is_enabled('esn-userevents');
push @jobs, LJ::EventLogRecord::NewComment->new($cmtobj)->fire_job;
my $sclient = LJ::theschwartz();
@@ -3458,12 +3458,12 @@ sub edit_comment {
LJ::mark_user_active($comment_obj->poster, 'comment');
# fire events
- unless ($LJ::DISABLED{esn}) {
+ if ( LJ::is_enabled('esn') ) {
my @jobs;
push @jobs, LJ::Event::JournalNewComment->new($comment_obj)->fire_job;
push @jobs, LJ::Event::UserNewComment->new($comment_obj)->fire_job
- if $comment_obj->poster && ! $LJ::DISABLED{'esn-userevents'};
+ if $comment_obj->poster && LJ::is_enabled('esn-userevents');
push @jobs, LJ::EventLogRecord::NewComment->new($comment_obj)->fire_job;
my $sclient = LJ::theschwartz();
diff -r 8a1365af63d4 -r 9744cbe5ad6a cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl Thu May 07 16:33:04 2009 +0000
+++ b/cgi-bin/weblib.pl Fri May 08 13:04:45 2009 +0000
@@ -133,7 +133,7 @@ sub valid_stylesheet_url {
my $cleanit = sub {
# allow tag, if we're doing no css cleaning
- return 1 if $LJ::DISABLED{'css_cleaner'};
+ return 1 unless LJ::is_enabled('css_cleaner');
# remove tag, if we have no CSSPROXY configured
return 0 unless $LJ::CSSPROXY;
@@ -1152,7 +1152,7 @@ sub entry_form {
stc/ups.css
js/datasource.js
js/selectable_table.js
- )) if ! $LJ::DISABLED{userpicselect} && $remote->get_cap('userpicselect');
+ )) if LJ::is_enabled('userpicselect') && $remote->get_cap('userpicselect');
$out .= "<div id='userpic' style='display: none;'><p id='userpic_preview'><a href='javascript:void(0);' id='lj_userpicselect_img'><img src='' alt='selected userpic' id='userpic_preview_image' /><span id='lj_userpicselect_img_txt'>$userpic_link_text</span></a></p></div>";
$out .= "\n";
@@ -1247,7 +1247,7 @@ sub entry_form {
@pickws) . "\n";
$out .= "<a href='javascript:void(0);' id='lj_userpicselect'> </a>";
# userpic browse button
- $$onload .= " insertViewThumbs();" if ! $LJ::DISABLED{userpicselect} && $remote->get_cap('userpicselect');
+ $$onload .= " insertViewThumbs();" if LJ::is_enabled('userpicselect') && $remote->get_cap('userpicselect');
$out .= LJ::help_icon_html("userpics", "", " ") . "\n";
$out .= "</p>\n\n";
@@ -1301,7 +1301,7 @@ sub entry_form {
$out .= "<li class='image'><a href='javascript:void(0);' onclick='InOb.handleInsertImage();' title='"
. BML::ml('fckland.ljimage') . "'>" . BML::ml('entryform.insert.image2') . "</a></li>\n";
$out .= "<li class='media'><a href='javascript:void(0);' onclick='InOb.handleInsertEmbed();' title='Embed Media'>"
- . "Embed Media</a></li>\n" unless $LJ::DISABLED{embed_module};
+ . "Embed Media</a></li>\n" if LJ::is_enabled('embed_module');
$out .= "</ul>\n";
my $format_selected = $opts->{'prop_opt_preformatted'} || $opts->{'event_format'} ? "checked='checked'" : "";
$out .= "<span id='linebreaks'><input type='checkbox' class='check' value='preformatted' name='event_format' id='event_format' $format_selected />
@@ -1376,7 +1376,7 @@ RTE
### Options
# Tag labeling
- unless ($LJ::DISABLED{tags}) {
+ if ( LJ::is_enabled('tags') ) {
$out .= "<p class='pkg'>";
$out .= "<label for='prop_taglist' class='left options'>" . BML::ml('entryform.tags') . "</label>";
$out .= LJ::html_text(
@@ -1943,7 +1943,7 @@ sub entry_form_tags_widget {
sub entry_form_tags_widget {
my $ret = '';
- return '' if $LJ::DISABLED{tags};
+ return '' unless LJ::is_enabled('tags');
$ret .= LJ::html_text({
'name' => 'prop_taglist',
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/admin/schools/edit.bml
--- a/htdocs/admin/schools/edit.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/admin/schools/edit.bml Fri May 08 13:04:45 2009 +0000
@@ -10,7 +10,7 @@ body<=
my $err = sub { return "<?h1 Error h1?><?p $_[0] p?>"; };
return $err->('The Schools Directory is currently disabled due to maintenance.')
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my %ierr;
my $bogus = sub {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/admin/schools/merge.bml
--- a/htdocs/admin/schools/merge.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/admin/schools/merge.bml Fri May 08 13:04:45 2009 +0000
@@ -12,7 +12,7 @@ body<=
};
return $err->('The Schools Directory is currently disabled due to maintenance.')
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my $remote = LJ::get_remote();
return "<?needlogin?>" unless $remote;
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/admin/schools/pending.bml
--- a/htdocs/admin/schools/pending.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/admin/schools/pending.bml Fri May 08 13:04:45 2009 +0000
@@ -10,7 +10,7 @@ body<=
my $err = sub { return "<?h1 Error h1?><?p $_[0] p?>"; };
return $err->('The Schools Directory is currently disabled due to maintenance.')
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my %ierr;
my $bogus = sub {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/admin/schools/rename.bml
--- a/htdocs/admin/schools/rename.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/admin/schools/rename.bml Fri May 08 13:04:45 2009 +0000
@@ -10,7 +10,7 @@ body<=
my $err = sub { return "<?errorbar $_[0] errorbar?>"; };
return $err->('The Schools Directory is currently disabled due to maintenance.')
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my $remote = LJ::get_remote();
return "<?needlogin?>" unless $remote;
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/changepassword.bml
--- a/htdocs/changepassword.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/changepassword.bml Fri May 08 13:04:45 2009 +0000
@@ -169,9 +169,7 @@ body<=
LJ::mark_authaction_used($aa) if $authu;
# If we forced them to change their password, mark them as now being good
- unless ($LJ::DISABLED{'force_pass_change'}) {
- $u->set_prop('badpassword', 0);
- }
+ $u->set_prop('badpassword', 0) if LJ::is_enabled('force_pass_change');
# Kill all sessions, forcing user to relogin
$u->kill_all_sessions;
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/editjournal.bml
--- a/htdocs/editjournal.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/editjournal.bml Fri May 08 13:04:45 2009 +0000
@@ -391,7 +391,7 @@ body<=
'auth' => $auth,
'remote' => $remote,
'spellcheck_html' => $spellcheck_html,
- 'richtext' => $LJ::DISABLED{'richtext'} ? 0 : 1,
+ 'richtext' => LJ::is_enabled('richtext'),
'mood' => $res{'events_1_'},
'disabled_save' => $disabled_save,
'disabled_delete' => $disabled_delete,
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/editpics.bml
--- a/htdocs/editpics.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/editpics.bml Fri May 08 13:04:45 2009 +0000
@@ -105,7 +105,7 @@ use strict;
my $error;
# act like the factory is disabled if no mogile
- my $factory_disabled = $LJ::DISABLED{'userpicfactory'} || !LJ::mogclient();
+ my $factory_disabled = !LJ::is_enabled('userpicfactory') || !LJ::mogclient();
my $mogcli = LJ::mogclient();
# just return an error immediately if there's no mogile and the upload
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/editprivacy.bml
--- a/htdocs/editprivacy.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/editprivacy.bml Fri May 08 13:04:45 2009 +0000
@@ -14,7 +14,7 @@ body<=
my $u = LJ::load_user($remote->{'user'});
return "This feature is currently disabled."
- if $LJ::DISABLED{mass_privacy};
+ unless LJ::is_enabled('mass_privacy');
unless ($u->get_cap('mass_privacy')) {
return "<?standout $ML{'.unable'} standout?>";
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/edittags.bml
--- a/htdocs/edittags.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/edittags.bml Fri May 08 13:04:45 2009 +0000
@@ -10,8 +10,7 @@ body<=
return "<?needlogin?>" unless $remote;
my $err = sub { return "<?h1 $ML{'Error'} h1?><?p $_[0] p?>"; };
- return $err->($ML{'.disabled'})
- if $LJ::DISABLED{tags};
+ return $err->($ML{'.disabled'}) unless LJ::is_enabled('tags');
LJ::need_res("stc/tags.css", "js/tags.js");
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/inbox/compose.bml
--- a/htdocs/inbox/compose.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/inbox/compose.bml Fri May 08 13:04:45 2009 +0000
@@ -11,7 +11,7 @@ body<=
LJ::JSUtil
);
- return "User messaging is currently disabled" if $LJ::DISABLED{user_messaging};
+ return "User messaging is currently disabled" unless LJ::is_enabled('user_messaging');
my $remote = LJ::get_remote() or return "<?needlogin?>";
my $remote_id = $remote->{'userid'};
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/inbox/index.bml
--- a/htdocs/inbox/index.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/inbox/index.bml Fri May 08 13:04:45 2009 +0000
@@ -51,7 +51,7 @@ body<=
# Take a supplied filter but default it to undef unless it is valid
my $view = $POST{view} || $GET{view} || undef;
- $view = undef if ($view eq 'archive' && $LJ::DISABLED{esn_archive});
+ $view = undef if ($view eq 'archive' && ! LJ::is_enabled('esn_archive'));
$view = undef if ($view && !LJ::NotificationInbox->can("${view}_items"));
# Bolds the selected View/Folder
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/interests.bml
--- a/htdocs/interests.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/interests.bml Fri May 08 13:04:45 2009 +0000
@@ -29,7 +29,7 @@ body<=
my $table = sub { $_[0]->{'journaltype'} eq 'C' ? 'comminterests' : 'userinterests' };
if (!$did_post && $GET{'view'} eq "popular") {
- return $ML{'.popular.disabled'} if $LJ::DISABLED{'interests-popular'};
+ return $ML{'.popular.disabled'} unless LJ::is_enabled('interests-popular');
my $ret = '';
$ret .= "<?h1 $ML{'.popular.head'} h1?><?p $ML{'.popular.text'} ";
@@ -127,7 +127,7 @@ body<=
}
if (!$did_post && $GET{'mode'} eq "findsim_do") {
- return $ML{'error.tempdisabled'} if $LJ::DISABLED{'interests-findsim'};
+ return $ML{'error.tempdisabled'} unless LJ::is_enabled('interests-findsim');
return $ML{'.findsim_do.account.notallowed'} unless LJ::get_cap($remote, "findsim");
@@ -519,7 +519,7 @@ body<=
$ret .= "<?p $ML{'.interests.text'} p?>";
$ret .= "<table cellspacing='5' style='margin-top: 10px; margin-left: 30px; margin-bottom: 10px;'>";
- unless ($LJ::DISABLED{'interests-popular'}) {
+ if ( LJ::is_enabled('interests-popular') ) {
$ret .= "<tr valign='top'><td colspan='2'>";
$ret .= "<a href=\"interests.bml?view=popular\">$ML{'.interests.viewpop'}</a></td></tr>";
}
@@ -530,7 +530,7 @@ body<=
$ret .= LJ::html_submit(undef, $ML{'.interested.btn.find'});
$ret .= "</form></td></tr>";
- if (!$LJ::DISABLED{'interests-findsim'} && $remote && LJ::get_cap($remote, "findsim")) {
+ if ( LJ::is_enabled('interests-findsim') && $remote && LJ::get_cap($remote, 'findsim') ) {
$ret .= "<tr valign='top'><td>$ML{'.interests.findsim'}</td><td><form method='get' action='interests.bml'>";
$ret .= LJ::html_hidden('mode', 'findsim_do');
$ret .= LJ::html_text({name => 'user', value => $remote->{'user'}, size => 20}) . " ";
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/login.bml
--- a/htdocs/login.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/login.bml Fri May 08 13:04:45 2009 +0000
@@ -294,7 +294,7 @@
} else {
push @errors, [ purged_user => "$ML{'error.purged.text'}" ] if $u->is_expunged;
push @errors, [ community_disabled_login => "$ML{'error.nocommlogin'}" ]
- if $u->{'journaltype'} eq 'C' && $LJ::DISABLED{'community-logins'};
+ if $u->{'journaltype'} eq 'C' && ! LJ::is_enabled('community-logins');
}
if (LJ::get_cap($u, "readonly")) {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/lostinfo.bml
--- a/htdocs/lostinfo.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/lostinfo.bml Fri May 08 13:04:45 2009 +0000
@@ -170,7 +170,7 @@ body<=
my $add_message = '';
- unless ($LJ::DISABLED{'secret_question'}) {
+ if ( LJ::is_enabled('secret_question') ) {
my ($redir, $ml_key, $param) = LJ::run_hook('use_secret', $u);
return BML::redirect($redir) if $redir ne '';
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/emailpost.bml
--- a/htdocs/manage/emailpost.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/emailpost.bml Fri May 08 13:04:45 2009 +0000
@@ -226,7 +226,7 @@ body<=
},
);
- if ($LJ::FB_SITEROOT && %LJ::FOTOBILDER_IP && ! $LJ::DISABLED{fb_email_docs}) {
+ if ( $LJ::FB_SITEROOT && %LJ::FOTOBILDER_IP && LJ::is_enabled('fb_email_docs') ) {
$subject = "$ML{'.help.subject_images'}<br /><br />";
$body = $ML{'.help.body_images'};
splice @topics, -1, 0,
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/profile/index.bml
--- a/htdocs/manage/profile/index.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/profile/index.bml Fri May 08 13:04:45 2009 +0000
@@ -30,8 +30,8 @@ body<=
# The settings used on this page
my @settings = ();
- push @settings, "LJ::Setting::UserMessaging" unless $LJ::DISABLED{'user_messaging'};
- push @settings, "LJ::Setting::FindByEmail" unless $LJ::DISABLED{'opt_findbyemail'};
+ push @settings, "LJ::Setting::UserMessaging" if LJ::is_enabled('user_messaging');
+ push @settings, "LJ::Setting::FindByEmail" if LJ::is_enabled('opt_findbyemail');
my $dbr = LJ::get_db_reader();
my $sth;
@@ -191,7 +191,7 @@ body<=
$ret .= "</td></tr>\n";
# schools
- unless ( $LJ::DISABLED{schools} ) {
+ if ( LJ::is_enabled('schools') ) {
$ret .= "<tr><td class='field_name'>$ML{'.fn.schools'}</td><td>";
$ret .= "$ML{'.schools'}: ";
@@ -336,7 +336,7 @@ body<=
if ($u->is_person) {
# opt_findbyemail
- unless ($LJ::DISABLED{'opt_findbyemail'}) {
+ if ( LJ::is_enabled('opt_findbyemail') ) {
$ret .= "<tr><td class='field_name'>" .
LJ::Setting::FindByEmail->label . "</td><td>";
$ret .= LJ::Setting::FindByEmail->as_html($u);
@@ -344,7 +344,7 @@ body<=
}
# opt_usermsg
- unless ($LJ::DISABLED{'user_messaging'}) {
+ if ( LJ::is_enabled('user_messaging') ) {
$ret .= "<tr><td class='field_name'>" . BML::ml('.section.usermessaging', { siteabbrev => $LJ::SITENAMEABBREV } ) ."</td><td>";
$ret .= LJ::Setting::UserMessaging->as_html($u);
$ret .= "</td></tr>\n";
@@ -371,7 +371,7 @@ body<=
)
{
- next if $p->[0] eq "ljtalk" && $LJ::DISABLED{ljtalk};
+ next if $p->[0] eq "ljtalk" && ! LJ::is_enabled('ljtalk');
$ret .= "<tr><td class='field_name'>$p->[1]</td><td>";
unless ($p->[0] eq "ljtalk") {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/subscriptions/comments.bml
--- a/htdocs/manage/subscriptions/comments.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/subscriptions/comments.bml Fri May 08 13:04:45 2009 +0000
@@ -9,7 +9,7 @@ body<=
$title = 'Manage Message Settings';
- return "Not ready" if $LJ::DISABLED{'esn'};
+ return "Not ready" unless LJ::is_enabled('esn');
use Class::Autouse qw(
LJ::NotificationMethod
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/subscriptions/entry.bml
--- a/htdocs/manage/subscriptions/entry.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/subscriptions/entry.bml Fri May 08 13:04:45 2009 +0000
@@ -8,7 +8,7 @@ body<=
$title = 'Manage Message Settings';
- return "Not ready" if $LJ::DISABLED{'esn'};
+ return "Not ready" unless LJ::is_enabled('esn');
use Class::Autouse qw(LJ::NotificationMethod LJ::Event);
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/subscriptions/user.bml
--- a/htdocs/manage/subscriptions/user.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/subscriptions/user.bml Fri May 08 13:04:45 2009 +0000
@@ -8,7 +8,7 @@ body<=
$title = 'Manage Message Settings';
- return "Not ready" if $LJ::DISABLED{'esn'};
+ return "Not ready" unless LJ::is_enabled('esn');
use Class::Autouse qw(LJ::NotificationMethod LJ::Event);
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/manage/tags.bml
--- a/htdocs/manage/tags.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/manage/tags.bml Fri May 08 13:04:45 2009 +0000
@@ -9,7 +9,7 @@ body<=
LJ::set_active_crumb('managetags');
return "<?h1 $ML{'Error'} h1?><?p $ML{'/edittags.bml.disabled'} p?>"
- if $LJ::DISABLED{tags};
+ unless LJ::is_enabled('tags');
my $remote = LJ::get_remote();
return "<?needlogin?>" unless $remote;
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/schools/index.bml
--- a/htdocs/schools/index.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/schools/index.bml Fri May 08 13:04:45 2009 +0000
@@ -13,7 +13,7 @@ body<=
my $err = sub { return "<?h1 $ML{'Error'} h1?><?p $_[0] p?>"; };
return $err->($ML{'.error.disabled'})
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my ($ctc, $sc, $cc, $sid) = ($GET{ctc}, $GET{sc}, $GET{cc}, $GET{sid}+0);
my $ectc = LJ::eurl($ctc);
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/schools/manage.bml
--- a/htdocs/schools/manage.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/schools/manage.bml Fri May 08 13:04:45 2009 +0000
@@ -16,7 +16,7 @@ body<=
my $err = sub { return "<?h1 $ML{'Error'} h1?><?p $_[0] p?>"; };
return $err->($ML{'.error.disabled'})
- if $LJ::DISABLED{'schools'};
+ unless LJ::is_enabled('schools');
my %ierr;
my $bogus = sub {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/stats.bml
--- a/htdocs/stats.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/stats.bml Fri May 08 13:04:45 2009 +0000
@@ -78,7 +78,7 @@ body<=
ret => \$ret,
});
- unless ($LJ::DISABLED{'stats-recentupdates'})
+ if ( LJ::is_enabled('stats-recentupdates') )
{
$ret .= "<h1>$ML{'.recent.header'}</h1>";
$ret .= "<p>$ML{'.recent.desc'}</p><ul>";
@@ -93,7 +93,7 @@ body<=
$ret .= "</ul> \n";
}
- unless ($LJ::DISABLED{'stats-newjournals'})
+ if ( LJ::is_enabled('stats-newjournals') )
{
$ret .= "<h1>$ML{'.new.header'}</h1>";
$ret .= "<p>$ML{'.new.desc'}</p><ul>";
@@ -156,7 +156,7 @@ body<=
}
# clients (if enabled)
- unless ($LJ::DISABLED{'clientversionlog'}) {
+ if ( LJ::is_enabled('clientversionlog') ) {
### sum up clients over different versions
foreach my $c (keys %{$stat{'client'}}) {
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/support/faqbrowse.bml
--- a/htdocs/support/faqbrowse.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/support/faqbrowse.bml Fri May 08 13:04:45 2009 +0000
@@ -105,7 +105,7 @@ body<=
$dbh ||= LJ::get_db_writer();
# log this faq view
- if ($remote && ! $LJ::DISABLED{faquses}) {
+ if ( $remote && LJ::is_enabled('faquses') ) {
$dbh->do("REPLACE INTO faquses (faqid, userid, dateview) ".
"VALUES (?, ?, NOW())", undef, $faqid,
$remote->{'userid'});
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/tools/tellafriend.bml
--- a/htdocs/tools/tellafriend.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/tools/tellafriend.bml Fri May 08 13:04:45 2009 +0000
@@ -25,7 +25,7 @@
my $sth;
- if ($LJ::DISABLED{'tellafriend'}) {
+ unless ( LJ::is_enabled('tellafriend') ) {
$body .= BML::ml( ".error.disabled" );
return;
}
diff -r 8a1365af63d4 -r 9744cbe5ad6a htdocs/update.bml
--- a/htdocs/update.bml Thu May 07 16:33:04 2009 +0000
+++ b/htdocs/update.bml Fri May 08 13:04:45 2009 +0000
@@ -203,7 +203,7 @@
'remote' => $remote,
'spellcheck_html' => $spellcheck_html,
'clientversion' => "WebUpdate/2.0.0",
- 'richtext' => $LJ::DISABLED{'richtext'} ? 0 : 1,
+ 'richtext' => LJ::is_enabled('richtext'),
'richtext_default' => $remote ? $remote->new_entry_editor eq 'rich' ? 1 : 0 # User setting
: $LJ::DEFAULT_EDITOR eq 'rich' ? 1 : 0, # Site default
'include_insert_object' => $GET{'insobj'},
@@ -554,7 +554,7 @@ head<=
# Setup draft saving and try to restore from a draft
# unless we did a post action
my $initDraft = '';
- if ($remote && !$LJ::DISABLED{'update_draft'}) {
+ if ( $remote && LJ::is_enabled('update_draft') ) {
# While transforms aren't considered posts, we don't want to
# prompt the user to restore from a draft on a transform
if (!LJ::did_post()) {
diff -r 8a1365af63d4 -r 9744cbe5ad6a t/esn-end2end.t
--- a/t/esn-end2end.t Thu May 07 16:33:04 2009 +0000
+++ b/t/esn-end2end.t Fri May 08 13:04:45 2009 +0000
@@ -10,7 +10,7 @@ use LJ::Test qw(memcache_stress temp_use
use LJ::Test qw(memcache_stress temp_user);
use FindBin qw($Bin);
-if ($LJ::DISABLED{esn}) {
+unless ( LJ::is_enabled('esn') ) {
plan skip_all => "ESN is disabled: set $LJ::DISABLED{esn}=0 to run this test.";
exit 0;
}
--------------------------------------------------------------------------------
