Advertisement
Guest User

OpenCart url.php

a guest
May 9th, 2010
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. final class Url {
  3.  
  4.     public function http($route) {
  5.         if (HTTPS_IS_SHARED_SERVER == 1 && !$this->isSSL())
  6.             return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&amp;', $route);
  7.         else
  8.             return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&amp;', $route) . '&amp;sid=' . session_id();
  9.     }
  10.  
  11.     public function https($route) {
  12.  
  13.         if (HTTPS_SERVER != '') {
  14.             if (HTTPS_IS_SHARED_SERVER == 1 && !$this->isSSL())
  15.                 $link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&amp;', $route) . '&amp;sid=' . session_id();
  16.             else
  17.                 $link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&amp;', $route);
  18.         } else {
  19.             $link = HTTP_SERVER . 'index.php?route=' . str_replace('&', '&amp;', $route);
  20.         }
  21.                
  22.         return $link;
  23.     }
  24.    
  25.     public function isSSL() {
  26.         return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? true : false;
  27.     }
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement