[livejournal] r23087: LJSUP-13588. Add Site.membership flag to...
Committer: wisest-owl
LJSUP-13588. Add Site.membership flag to JSU trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl 2012-10-10 09:20:27 UTC (rev 23086)
+++ trunk/cgi-bin/weblib.pl 2012-10-10 09:29:42 UTC (rev 23087)
@@ -1581,6 +1581,12 @@
my $locale = LJ::Lang::current_language();
$locale = $locale eq 'debug'? $locale : LJ::lang_to_locale($locale);
+ my %comm_access = ();
+ if ($ju && $ju->is_community) {
+ my @c_acc = LJ::get_comm_settings ($ju);
+ $comm_access{'membership'} = $c_acc[0] if scalar @c_acc;
+ }
+
my $ljentry = LJ::Request->notes('ljentry') || ''; # url
my %site = (
imgprefix => "$imgprefix",
@@ -1607,6 +1613,7 @@
locale => $locale,
pics_production => LJ::is_enabled('pics_production'),
v => stc_0_modtime($now),
+ %comm_access,
);
$site{default_copyright} = $default_copyright if LJ::is_enabled('default_copyright', $remote);
$site{is_dev_server} = 1 if $LJ::IS_DEV_SERVER;
@@ -1627,12 +1634,6 @@
$jsml_out =~ s{(?<=</s)(?=cript)} {"+"}g;
$jsvar_out =~ s{(?<=</s)(?=cript)} {"+"}g;
- my $comm_access = "";
- if ($ju && $ju->is_community) {
- my @c_acc = LJ::get_comm_settings ($ju);
- $comm_access = "Site.membership = '$c_acc[0]';" if scalar @c_acc;
- }
-
$ret_js .= qq {
<script type="text/javascript">
Site = window.Site || {};
@@ -1644,7 +1645,6 @@
})();
Site.current_journal = $journal_info_json;
Site.version = '$site_version';
- $comm_access
</script>
};
