added on local at 2026-07-01 13:47:34
| 1 | package MODS::Config; | |
| 2 | #====================================================================== | |
| 3 | # Framework-level config. Used by MODS::Template and the MODS layer. | |
| 4 | # AffSoft-specific settings live in MODS::AffSoft::Config (kept under | |
| 5 | # its original namespace through v0.5; will be renamed AffSoft::Config | |
| 6 | # in a later increment). | |
| 7 | #====================================================================== | |
| 8 | ||
| 9 | use strict; | |
| 10 | use warnings; | |
| 11 | ||
| 12 | use lib "/var/www/vhosts/3dshawn.com/affiliate.3dshawn.com/"; | |
| 13 | ||
| 14 | sub new { | |
| 15 | my ($class) = @_; | |
| 16 | return bless({}, $class); | |
| 17 | } | |
| 18 | ||
| 19 | sub settings { | |
| 20 | my ($self, $request) = @_; | |
| 21 | ||
| 22 | # ----- Optional staging tag -------------------------------------- | |
| 23 | my $node_name = ''; | |
| 24 | if (open(my $fh, '<', "/var/www/vhosts/3dshawn.com/affiliate.3dshawn.com/MODS/nodename.txt")) { | |
| 25 | my @file_data = <$fh>; | |
| 26 | close $fh; | |
| 27 | $node_name = $file_data[0] // ''; | |
| 28 | } | |
| 29 | ||
| 30 | my ($tag_name, $tag_bg_color, $tag_text_color); | |
| 31 | if ($node_name =~ /-dev-|-cc-|-rnd-|-stage-/im) { | |
| 32 | $tag_name = 'STAGING'; | |
| 33 | $tag_bg_color = '#FF1F1F'; | |
| 34 | $tag_text_color = '#FFFFFF'; | |
| 35 | } | |
| 36 | ||
| 37 | return $tag_name if $request eq 'tag_name'; | |
| 38 | return $tag_bg_color if $request eq 'tag_bg_color'; | |
| 39 | return $tag_text_color if $request eq 'tag_text_color'; | |
| 40 | ||
| 41 | # Database name - Template.pm reads this for permission lookups. | |
| 42 | return 'affiliate3dshawn' if $request eq 'database_name'; | |
| 43 | ||
| 44 | return 'https://' if $request eq 'secure_url'; | |
| 45 | return 'AffSoft' if $request eq 'website_title'; | |
| 46 | return '/assets' if $request eq 'assets'; | |
| 47 | return '/var/www/vhosts/3dshawn.com/affiliate.3dshawn.com/assets' if $request eq 'assets_css'; | |
| 48 | return 'https://affiliate.3dshawn.com' if $request eq 'base_url'; | |
| 49 | return '' if $request eq 'feedback_emails'; | |
| 50 | ||
| 51 | return undef; | |
| 52 | } | |
| 53 | ||
| 54 | 1; |