Code Duplication    Length = 22-22 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 4959-4980 (lines=22) @@
4956
     * @param string $context . Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend)
4957
     * @return string
4958
     */
4959
    public function getLoginUserID($context = '')
4960
    {
4961
        $out = false;
4962
4963
        if (!empty($context)) {
4964
            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4965
                $out = $_SESSION[$context . 'InternalKey'];
4966
            }
4967
        } else {
4968
            switch (true) {
4969
                case ($this->isFrontend() && isset ($_SESSION['webValidated'])): {
4970
                    $out = $_SESSION['webInternalKey'];
4971
                    break;
4972
                }
4973
                case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): {
4974
                    $out = $_SESSION['mgrInternalKey'];
4975
                    break;
4976
                }
4977
            }
4978
        }
4979
        return $out;
4980
    }
4981
4982
    /**
4983
     * Returns current user name
@@ 4988-5009 (lines=22) @@
4985
     * @param string $context . Default is an empty string which indicates the method should automatically pick 'web (frontend) or 'mgr' (backend)
4986
     * @return string
4987
     */
4988
    public function getLoginUserName($context = '')
4989
    {
4990
        $out = false;
4991
4992
        if (!empty($context)) {
4993
            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4994
                $out = $_SESSION[$context . 'Shortname'];
4995
            }
4996
        } else {
4997
            switch (true) {
4998
                case ($this->isFrontend() && isset ($_SESSION['webValidated'])): {
4999
                    $out = $_SESSION['webShortname'];
5000
                    break;
5001
                }
5002
                case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): {
5003
                    $out = $_SESSION['mgrShortname'];
5004
                    break;
5005
                }
5006
            }
5007
        }
5008
        return $out;
5009
    }
5010
5011
    /**
5012
     * Returns current login user type - web or manager