Code Duplication    Length = 22-22 lines in 2 locations

manager/includes/document.parser.class.inc.php 2 locations

@@ 5136-5157 (lines=22) @@
5133
     * @param string $context . Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend)
5134
     * @return string
5135
     */
5136
    public function getLoginUserID($context = '')
5137
    {
5138
        $out = false;
5139
5140
        if (!empty($context)) {
5141
            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5142
                $out = $_SESSION[$context . 'InternalKey'];
5143
            }
5144
        } else {
5145
            switch (true) {
5146
                case ($this->isFrontend() && isset ($_SESSION['webValidated'])): {
5147
                    $out = $_SESSION['webInternalKey'];
5148
                    break;
5149
                }
5150
                case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): {
5151
                    $out = $_SESSION['mgrInternalKey'];
5152
                    break;
5153
                }
5154
            }
5155
        }
5156
5157
        return $out;
5158
    }
5159
5160
    /**
@@ 5166-5187 (lines=22) @@
5163
     * @param string $context . Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend)
5164
     * @return string
5165
     */
5166
    public function getLoginUserName($context = '')
5167
    {
5168
        $out = false;
5169
5170
        if (!empty($context)) {
5171
            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5172
                $out = $_SESSION[$context . 'Shortname'];
5173
            }
5174
        } else {
5175
            switch (true) {
5176
                case ($this->isFrontend() && isset ($_SESSION['webValidated'])): {
5177
                    $out = $_SESSION['webShortname'];
5178
                    break;
5179
                }
5180
                case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): {
5181
                    $out = $_SESSION['mgrShortname'];
5182
                    break;
5183
                }
5184
            }
5185
        }
5186
5187
        return $out;
5188
    }
5189
5190
    /**