Code Duplication    Length = 22-22 lines in 2 locations

manager/includes/src/Core.php 2 locations

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