Ticket #5959: mythweb_skin.patch

File mythweb_skin.patch, 1.8 KB (added by brad dreisbach <bradd@…>, 15 years ago)
  • mythweb/includes/skin.php

     
    2121*/
    2222
    2323// Figure out the template
    24     $tmpl = $_SESSION['tmpl'];
    2524
    2625    if (isset($_REQUEST['RESET_TMPL']))
    2726        $tmpl = _or($_REQUEST['RESET_TMPL'], 'default');
    2827    elseif (isset($_REQUEST['RESET_TEMPLATE']))
    2928        $tmpl = _or($_REQUEST['RESET_TEMPLATE'], 'default');
    30     elseif (isset($_COOKIE['mythweb_tmpl']))
     29    elseif (isset($_COOKIE['mythweb_tmpl']) && $_COOKIE['mythweb_tmpl'] == $_SESSION['tmpl'])
    3130        $tmpl = $_COOKIE['mythweb_tmpl'];
    3231    elseif (isMobileUser())
    3332        $tmpl = 'wap';
     
    3635    elseif (preg_match('/(ipod|iphone)/i', $_SERVER['HTTP_USER_AGENT']))
    3736        $tmpl = 'iPod';
    3837    else
    39         $tmpl = 'default';
     38        $tmpl = $_SESSION['tmpl'];
    4039
    4140    if (!file_exists(modules_path.'/_shared/tmpl/'.$tmpl.'/welcome.php'))
    4241        $tmpl = 'default';
     
    4443    setcookie('mythweb_tmpl', $tmpl, 2147483647, root);
    4544
    4645// Figure out the skin
    47     $skin = $_SESSION['skin'];
    4846
    4947    if (isset($_REQUEST['RESET_SKIN']))
    5048        $skin = _or($_REQUEST['RESET_SKIN'], 'default');
    51     elseif (isset($_COOKIE['mythweb_skin']))
    52         $skin = $_COOKIE['mythweb_skin'];
     49    elseif (isset($_COOKIE['mythweb_skin']) && $_COOKIE['mythweb_skin'] == $_SESSION['skin'])
     50       $skin = $_COOKIE['mythweb_skin'];
    5351    elseif (isMobileUser())
    5452        $skin = 'wap';
    5553    elseif (preg_match('/(ipod|iphone)/i', $_SERVER['HTTP_USER_AGENT']))
    5654        $skin = 'iPod-default';
    5755    else
    58         $skin = 'default';
     56        $skin = $_SESSION['skin'];
    5957
    6058    if (!file_exists('skins/'.$skin.'/img/'))
    6159        $skin = 'default';