Code Duplication    Length = 22-22 lines in 2 locations

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

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