About use in user search

Permalink Browser Info Environment
A client asked us to search and sort based on the two_step_auth_data attribute.
The client wants to find who haven't set-up MFA.
When I try to run it, I get the following error:

1.filter by twp_step_auth_data attribute

Uncaught Error: Call to undefined method Concrete\Package\TwoStepAuthentication\Attribute\TwoStepAuthData\Controller::load() in /var/www/vhosts/example.com/releases/24/packages/two_step_authentication/attributes/two_step_auth_data/controller.php:52
Stack trace:
#0 [internal function]: Concrete\Package\TwoStepAuthentication\Attribute\TwoStepAuthData\Controller->search()
#1 /var/www/vhosts/example.com/c5/8.5.12/concrete/src/Controller/AbstractController.php(315): call_user_func_array(Array, Array)
#2 /var/www/vhosts/example.com/c5/8.5.12/concrete/src/Attribute/View.php(156): Concrete\Core\Controller\AbstractController->runAction('search')
#3 /var/www/vhosts/example.com/c5/8.5.12/concrete/src/Attribute/View.php(134): Concrete\Core\Attribute\View->runControllerTask()
#4 /var/www/vhosts/example.com/c5/8.5.12/concrete/src/View/AbstractView.php(161): Concrete\Core\Attribute\View->setupRender()
#5 /var/www/vhosts/example.com/c5/8.5.12/concrete/src/Search/Field/AttributeKeyField.php(75): Concrete\Core\View
Details
/var/www/vhosts/example.com/releases/24/packages/two_step_authentication/attributes/two_step_auth_data/controller.php(52): Whoops\Exception\ErrorException->null   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/filp/whoops/src/Whoops/Run.php(486): Whoops\Run->handleError   
[internal](0): Whoops\Run->handleShutdown


2.sort by twp_step_auth_data attribute

An exception occurred while executing 'SELECT u.uID, u.uDateAdded, ak_two_step_auth_data FROM Users u LEFT JOIN UserSearchIndexAttributes ua ON u.uID = ua.uID WHERE (u.uIsActive = ?) AND (u.uIsValidated != 0) GROUP BY u.uID ORDER BY ak_two_step_auth_data asc, u.uID asc LIMIT 10 OFFSET 0' with params [true]:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_two_step_auth_data' in 'field list'
詳細
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php(71): Doctrine\DBAL\Exception\InvalidFieldNameException->null   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException->driverExceptionDuringQuery   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(107): Doctrine\DBAL\Driver\PDOException->null   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOException->null   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(847): Doctrine\DBAL\Driver\PDOStatement->execute   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): Doctrine\DBAL\Connection->executeQuery   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineDbalAdapter.php(73): Doctrine\DBAL\Query\QueryBuilder->execute   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php(319): Pagerfanta\Adapter\DoctrineDbalAdapter->getSlice   
/var/www/vhosts/example.com/c5/8.5.12/concrete/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php(303): Pagerfanta\Pagerfanta->getCurrentPageResultsFromAdapter   
/var/www/vhosts/example.com/c5/8.5.12/concrete/src/Search/Pagination/Pagination.php(111): Pagerfanta\Pagerfanta->getCurrentPageResults


I would like to be able to use these functions, what should I do?

I also tried to check the two_step_auth_data attribute in the CSV output, but this attribute was not output.
What should I do to output?

Thank you.

Type: Ticket
Status: In Progress
concrete5cojp
View Replies:
mnakalay replied on at Permalink Reply
mnakalay
Hello,

I'm going to have to look into it, I will let you know ASAP.
mnakalay replied on at Permalink Reply
mnakalay
Hello,

Please update to version 1.8.4 and it should be working fine now.

Let me know if there's any other issue
concrete5cojp replied on at Permalink Reply
concrete5cojp
I updated to v1.8.4 and now I can search. thank you.
I have a question.

1. Sorting shows the above SQL error (SQLSTATE[42S22]). Is it not possible to sort the "two_step_auth_data" attribute?
2. Any plans to export the "two_step_auth_data" attribute to CSV?

I would appreciate your answer.

Thank you.
mnakalay replied on at Permalink Reply
mnakalay
I didn't have a look into ordering so I'll check and will see what i can do.

I have no plan for csv export.
mnakalay replied on at Permalink Reply
mnakalay
I checked and there seems to be a problem in Concrete with attributes that have multiple fields of value.
For instance, if you have an Address attribute and try to order by it, you'll get the same error as with 2FA.

So at this point, there isn't much I can do I'm afraid.
concrete5cojp replied on at Permalink Reply
concrete5cojp
I understand that order is not possible due to Concrete issues.
What about question 2, the CSV output?
Is this also not possible due to Concrete issues?

Thank you.
mnakalay replied on at Permalink Reply
mnakalay
Hello.
I just uploaded version 2.1.3 which fixes the CSV export. You should be good to go now.
concrete5cojp replied on at Permalink Reply
concrete5cojp
Hi,
It was a great help!

Thank you.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.12
Version Installed - 8.5.12
Database Version - 20220319043123

# Database Information
Version: 10.5.10-MariaDB
SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# concrete5 Packages
2FA - Two-Factor Login Security (1.8.3), Advanced Workflow (0.4.1), Audit Log (1.2.1), C5J Page Views (0.0.24), CSV User Import & Export (0.5.3), Intranet site (1.1), Manual Nav (2.3.4), Notification Messaging System (0.0.2), PDF Viewer (1.0.2)

# concrete5 Overrides
authentication/concrete/controller.php, authentication/concrete/two_step_authentication.php, authentication/concrete, mail/private_message.php, views/frontend/maintenance_mode.php, views/frontend

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
nginx/1.20.0

# Server API
fpm-fcgi

# PHP Version
7.4.28

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 60
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 64M
upload_max_filesize - 32M
ldap.max_links - Unlimited
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
redis.pconnect.connection_limit - 0
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
unserialize_max_depth - 4096
opcache.max_accelerated_files - 4000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.