Exemplo n.º 1
0
 public function analyzePath($v86266ee937d97f812a8e57d22b62ee29 = false)
 {
     showWorkTime("analyzePath started");
     $vd6fe1d0be6347b8ef2427fa629c04485 = getRequest('path');
     $vd6fe1d0be6347b8ef2427fa629c04485 = trim($vd6fe1d0be6347b8ef2427fa629c04485, "/");
     if (!is_null(getRequest('scheme'))) {
         if (preg_replace("/[^\\w]/im", "", getRequest('scheme')) == 'upage') {
             preg_match_all("/[\\d]+/", $vd6fe1d0be6347b8ef2427fa629c04485, $v7057e8409c7c531a1a6e9ac3df4ed549);
             $this->current_element_id = $v7057e8409c7c531a1a6e9ac3df4ed549[0][0];
         }
         return;
     }
     showWorkTime("analyzePath something");
     $vb1444fb0c07653567ad325aa25d4e37a = regedit::getInstance();
     showWorkTime("analyzePath regedit init");
     $vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
     showWorkTime("analyzePath umiHierarchy init");
     $v2245023265ae4cf87d02c8b6ba991139 = mainConfiguration::getInstance();
     showWorkTime("analyzePath mainConfiguration init");
     $v7f2db423a49b305459147332fb01cf87 = outputBuffer::current();
     showWorkTime("analyzePath outputBuffer init");
     if ($v86266ee937d97f812a8e57d22b62ee29 === true) {
         $this->reset();
     }
     $v5f44c555cfb3ecb28f624fa95617f277 = $v2245023265ae4cf87d02c8b6ba991139->get('seo', 'url-suffix');
     $v5e0bdcbddccca4d66d74ba8c1cee1a68 = strrpos($vd6fe1d0be6347b8ef2427fa629c04485, $v5f44c555cfb3ecb28f624fa95617f277);
     if ($v5e0bdcbddccca4d66d74ba8c1cee1a68 && $v5e0bdcbddccca4d66d74ba8c1cee1a68 + strlen($v5f44c555cfb3ecb28f624fa95617f277) == strlen($vd6fe1d0be6347b8ef2427fa629c04485)) {
         $vd6fe1d0be6347b8ef2427fa629c04485 = substr($vd6fe1d0be6347b8ef2427fa629c04485, 0, $v5e0bdcbddccca4d66d74ba8c1cee1a68);
     }
     if ($v2245023265ae4cf87d02c8b6ba991139->get('seo', 'url-suffix.add')) {
         def_module::requireSlashEnding();
     }
     if ($v2245023265ae4cf87d02c8b6ba991139->get('seo', 'watch-redirects-history')) {
         redirects::getInstance()->init();
     }
     $v32660e7b27600e0fde6ff1333c6c0568 = $this->getPathArray();
     $v7dabf5c198b0bab2eaa42bb03a113e55 = sizeof($v32660e7b27600e0fde6ff1333c6c0568);
     $vaddb1838ab68ee501d3a0e2868a127c9 = array();
     $v83878c91171338902e0fe0fb97a8c47a = 0;
     for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $v7dabf5c198b0bab2eaa42bb03a113e55; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
         $vb31590b98760b74e7c4e1a809e43152d = $v32660e7b27600e0fde6ff1333c6c0568[$v865c0c0b4ab0e063e5caa3387c1a8741];
         if ($v865c0c0b4ab0e063e5caa3387c1a8741 <= 1) {
             if ($vb31590b98760b74e7c4e1a809e43152d == $this->current_mode || $vb31590b98760b74e7c4e1a809e43152d == $this->current_lang->getPrefix()) {
                 continue;
             }
         }
         $vaddb1838ab68ee501d3a0e2868a127c9[] = $vb31590b98760b74e7c4e1a809e43152d;
         $vbdcb4bec1c234b49e0a70911cf33ff6f = $this->getSubPathType($vb31590b98760b74e7c4e1a809e43152d);
         if ($vbdcb4bec1c234b49e0a70911cf33ff6f == "PARAM") {
             $_REQUEST['param' . $v83878c91171338902e0fe0fb97a8c47a++] = $vb31590b98760b74e7c4e1a809e43152d;
         }
     }
     if (!$this->current_module) {
         if ($this->current_mode == "admin") {
             if ($v854203cccade0bbe21be239a208aea49 = $vb1444fb0c07653567ad325aa25d4e37a->getVal("//modules/events")) {
             } else {
                 $v854203cccade0bbe21be239a208aea49 = $vb1444fb0c07653567ad325aa25d4e37a->getVal("//settings/default_module_admin");
             }
             $this->autoRedirectToMethod($v854203cccade0bbe21be239a208aea49);
         } else {
             $v854203cccade0bbe21be239a208aea49 = $vb1444fb0c07653567ad325aa25d4e37a->getVal("//settings/default_module");
         }
         $this->setCurrentModule($v854203cccade0bbe21be239a208aea49);
     }
     if (!$this->current_method) {
         if ($this->current_mode == "admin") {
             return $this->autoRedirectToMethod($this->current_module);
         } else {
             $v2fa70149e2a7e75da2b0303d0a36a944 = $vb1444fb0c07653567ad325aa25d4e37a->getVal("//modules/" . $this->current_module . "/default_method");
         }
         $this->setCurrentMethod($v2fa70149e2a7e75da2b0303d0a36a944);
     }
     if ($this->getCurrentMode() == "admin") {
         return;
     }
     $v7057e8409c7c531a1a6e9ac3df4ed549 = false;
     $v7dabf5c198b0bab2eaa42bb03a113e55 = sizeof($vaddb1838ab68ee501d3a0e2868a127c9);
     $vb31590b98760b74e7c4e1a809e43152d = "";
     for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $v7dabf5c198b0bab2eaa42bb03a113e55; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
         $vb31590b98760b74e7c4e1a809e43152d .= "/" . $vaddb1838ab68ee501d3a0e2868a127c9[$v865c0c0b4ab0e063e5caa3387c1a8741];
         if (!($vfa816edb83e95bf0c8da580bdfd491ef = $vb81ca7c0ccaa77e7aa91936ab0070695->getIdByPath($vb31590b98760b74e7c4e1a809e43152d, false, $v3dbd53d892aaea70c9f5fefc18fc7e4c))) {
             $v7057e8409c7c531a1a6e9ac3df4ed549 = false;
             break;
         } else {
             $v7057e8409c7c531a1a6e9ac3df4ed549 = $vfa816edb83e95bf0c8da580bdfd491ef;
         }
     }
     if ($v7057e8409c7c531a1a6e9ac3df4ed549) {
         if ($v3dbd53d892aaea70c9f5fefc18fc7e4c > 0 && !defined("DISABLE_AUTOCORRECTION_REDIRECT")) {
             $vd6fe1d0be6347b8ef2427fa629c04485 = $vb81ca7c0ccaa77e7aa91936ab0070695->getPathById($v7057e8409c7c531a1a6e9ac3df4ed549);
             if ($v865c0c0b4ab0e063e5caa3387c1a8741 == 0) {
                 if ($this->isModule($vaddb1838ab68ee501d3a0e2868a127c9[0])) {
                     $v7057e8409c7c531a1a6e9ac3df4ed549 = false;
                     break;
                 }
             }
             $v7f2db423a49b305459147332fb01cf87->status('301 Moved Permanently');
             $v7f2db423a49b305459147332fb01cf87->redirect($vd6fe1d0be6347b8ef2427fa629c04485);
         }
         $v8e2dcfd7e7e24b1ca76c1193f645902b = $vb81ca7c0ccaa77e7aa91936ab0070695->getElement($v7057e8409c7c531a1a6e9ac3df4ed549);
         if ($v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
             if ($v8e2dcfd7e7e24b1ca76c1193f645902b->getIsDefault()) {
                 $vd6fe1d0be6347b8ef2427fa629c04485 = $vb81ca7c0ccaa77e7aa91936ab0070695->getPathById($v7057e8409c7c531a1a6e9ac3df4ed549);
                 $v7f2db423a49b305459147332fb01cf87->status('301 Moved Permanently');
                 $v7f2db423a49b305459147332fb01cf87->redirect($vd6fe1d0be6347b8ef2427fa629c04485);
             }
         }
     } elseif (isset($vaddb1838ab68ee501d3a0e2868a127c9[0])) {
         if ($this->isModule($vaddb1838ab68ee501d3a0e2868a127c9[0])) {
             $v22884db148f0ffb0d830ba431102b0b5 = $this->getModule($vaddb1838ab68ee501d3a0e2868a127c9[0]);
             if (isset($vaddb1838ab68ee501d3a0e2868a127c9[1]) && !$v22884db148f0ffb0d830ba431102b0b5->isMethodExists($vaddb1838ab68ee501d3a0e2868a127c9[1])) {
                 $this->setCurrentModule('content');
                 $this->setCurrentMethod('content');
             }
         } else {
             $this->setCurrentModule('content');
             $this->setCurrentMethod('content');
         }
     }
     if (($vd6fe1d0be6347b8ef2427fa629c04485 == "" || $vd6fe1d0be6347b8ef2427fa629c04485 == $this->current_lang->getPrefix()) && $this->current_mode != "admin") {
         if ($v7057e8409c7c531a1a6e9ac3df4ed549 = $vb81ca7c0ccaa77e7aa91936ab0070695->getDefaultElementId($this->getCurrentLang()->getId(), $this->getCurrentDomain()->getId())) {
             $this->current_element_id = $v7057e8409c7c531a1a6e9ac3df4ed549;
         }
     }
     if ($v8e2dcfd7e7e24b1ca76c1193f645902b = $vb81ca7c0ccaa77e7aa91936ab0070695->getElement($v7057e8409c7c531a1a6e9ac3df4ed549, true)) {
         $v599dcce2998a6b40b1e38e8c6006cb0a = umiHierarchyTypesCollection::getInstance()->getType($v8e2dcfd7e7e24b1ca76c1193f645902b->getTypeId());
         if (!$v599dcce2998a6b40b1e38e8c6006cb0a) {
             return false;
         }
         $this->current_module = $v599dcce2998a6b40b1e38e8c6006cb0a->getName();
         if ($vabf77184f55403d75b9d51d79162a7ca = $v599dcce2998a6b40b1e38e8c6006cb0a->getExt()) {
             $this->setCurrentMethod($vabf77184f55403d75b9d51d79162a7ca);
         } else {
             $this->setCurrentMethod("content");
         }
         $this->current_element_id = $v7057e8409c7c531a1a6e9ac3df4ed549;
     }
     if ($this->current_module == "content" && $this->current_method == "content" && !$v7057e8409c7c531a1a6e9ac3df4ed549) {
         redirects::getInstance()->redirectIfRequired($vd6fe1d0be6347b8ef2427fa629c04485);
     }
 }
Exemplo n.º 2
0
 public function onModifyPageWatchRedirects(umiEventPoint $e)
 {
     static $links = array();
     $redirects = redirects::getInstance();
     $hierarchy = umiHierarchy::getInstance();
     $element = $e->getRef('element');
     if ($element instanceof umiHierarchyElement == false) {
         return false;
     }
     $elementId = $element->getId();
     $link = $hierarchy->getPathById($elementId, false, false, true);
     if ($e->getMode() == 'before') {
         $links[$elementId] = $link;
         return true;
     }
     if ($links[$elementId] != $link) {
         $redirects->add($links[$elementId], $link, 301);
     }
 }