pH7-Social-Dating-CMS: Admin and Member login problem

From several modules the function framework\Mvc\Model\Engine\Util\Various.class.php>checkModelTable($sTable) is called to check a table, which is not listed in the switch case.

I found the following locations:

  • framework\Mvc\Model\Security.class.php >addLoginLog - MEMBER_LOG_LOGIN
  • framework\Mvc\Model\Security.class.php >checkLoginAttempt - MEMBER_ATTEMPT_LOGIN
  • system\core\models\UserCoreModel.php >getLastUsedIp - MEMBER_LOG_SESS
  • system\modules\admin123\forms\processing\LoginFormProcess.php>__construct ADMIN_ATTEMPT_LOGIN

I had to add these tables to the checkModelTable($sTable) in order to be able to login as member or admin.

It worked for me with the following code, but I’m pretty sure that there are more locations or tables which have to be added.

    public static function checkModelTable($sTable)
    {
        switch ($sTable) {
            case DbTableName::MEMBER:
            case DbTableName::AFFILIATE:
            case DbTableName::ADMIN_ATTEMPT_LOGIN:
            case DbTableName::ADMIN_LOG_LOGIN:
            case DbTableName::ADMIN_LOG_SESS:
            case DbTableName::MEMBER_ATTEMPT_LOGIN:
            case DbTableName::MEMBER_LOG_LOGIN:
            case DbTableName::MEMBER_LOG_SESS:
            case DbTableName::MEMBER_INFO:
            case DbTableName::AFFILIATE_INFO:
            case DbTableName::MEMBER_COUNTRY:
            case DbTableName::AFFILIATE_COUNTRY:
            case DbTableName::SUBSCRIBER:
            case DbTableName::ADMIN:
                return $sTable;

            default:
                static::launchErr($sTable);
        }
    }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Oh, there is another one which I did not mention yet. Possibly it’s fixed already.

You get the following error when you login:

Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘profileId’ in ‘field list’
File: C:\Xampp\htdocs\ph7cms_protected\framework\Mvc\Model\Security.class.php
Line: 116

In the file Mvc\Model\Security.class.php function addSessionLog refers to profileId and firstName fields which don’t not exist in the table members_log_login. Instead the username should be inserted. I just got the username from the profileId and then it worked.

Maybe the problem is fixed already. I did not crosscheck!

@pH-7 yes, exactly!

Below you can see what I got when I tried to login as memeber:

**Message: Invalid data table: “members_attempts_login”!
File: C:\Xampp\htdocs\ph7cms_protected\framework\Mvc\Model\Engine\Util\Various.class.php
Line: 259**