Honour Required Fields & Administrator Approves Public Registration

Permalink Browser Info Environment
Hi Nicola,

It doesn't seem like this add on honours Required Fields & Administrator Approves Public Registration.

Normally users are forced to complete required fields after signing in, however Social Login seems to log the user straight in. Regarding Admin approves Public Registration, may be as simple as creating the user as inactive and showing text explaining that an Admin needs to approve their account.

Any ideas on how I could get this happening?

Cheers,

Tim

Type: Discussion
Status: In Progress
viDigital
View Replies:
hanicker replied on at Permalink Reply
hanicker
Hi. Sorry for this late reply.

There is a small workaround to honour Required Fields:

To apply this fix you have to copy
concrete/core/controllers/single_pages/login.php
to
/controllers/login.php

Then, you have to add after
public function do_login() {

this code:
if(!empty($_SESSION['social_login_uName']))
   $_POST['uName']=$_SESSION['social_login_uName']
if(!empty($_SESSION['social_login_uPassword']))
   $_POST['uPassword']=$_SESSION['social_login_uPassword']


Then, you need to edit social_login/models/social_login.php
and replace
$u->loginByUserID($ui->uID);
                     $currentPage = Page::getCurrentPage();
                     Loader::helper('navigation');
                     header('Location: '.NavigationHelper::getLinkToCollection($currentPage, true));
                     die();

with
$_SESSION['social_login_uName']=$data['uName'];
                     $_SESSION['social_login_uPassword']=$data['uPassword'];
                     header('Location: /index.php/login/do_login/');
                     die();





For Admin approval, as you said you can add the user inactive, please edit:
social_login/models/social_login.php
replace
$data['uIsValidated'] = '1';

with
$data['uIsValidated'] = '0';


This should work correctly.
Let me know if you have any problem with this solution or in case you prefer a refund.
Thanks
Regards
Nicola
viDigital replied on at Permalink Reply
viDigital
Hi Nicola,

Thanks for the response!

So I've tried both options in isolation, and neither seem to work.

For the mandatory fields, I tried a few things and couldn't seem to make it work. Firstly I suspected that there was missing ';' in the if statements, but there was still a problem after adding them. So I tried copying the login.php as instructed, and not changing the code. This seems to result in a 'Page not found' error when the do_login function is called.

Re the second option to register users as inactive, I tried out your solution, however the user is still active after registering.

Let me know if you have any other ideas, I'm keen to get this working as it's an awesome addon!

In case it's relevant, I'm running Concrete5 5.6.3.2

Thanks,

Tim
hanicker replied on at Permalink Reply 2 Attachments
hanicker
Hi
This should work correctly with 5.6.3.2

Please replace social_login package with the attached one and add the login.php file in the controllers/ directory.

Let me know if you have any problem
Thanks
Regards
Nicola
viDigital replied on at Permalink Reply
viDigital
Awesome, that did the job after clearing the cache & running the automated jobs. Looking back, I think your original instructions may have worked after just performing these tasks.

Thanks for your help!

concrete5 Environment Information

# concrete5 Version
5.6.3.2

# concrete5 Packages
Bookmarks (1.1.4), Login (1.1.1), Magic Data (2.9.8), Magic Data Symbols1 (2.7.6), Magic Data Templates1 (2.1), Pro Forms (7.5.6), Salix (1.0), Social Login (1.2), User Info (1.97).

# concrete5 Overrides
controllers/members.php, elements/profile, languages/fa_IR, languages/nb_NO, languages/el_GR, languages/nl_NL, languages/es_AR, languages/ja_JP, languages/tr_TR, languages/zh_TW, languages/fi_FI, languages/sl_SI, languages/de_DE, languages/es_PE, languages/ru_RU, languages/fr_FR, languages/ar, languages/da_DK, languages/it_IT, languages/zh_CN, languages/he_IL, languages/vi_VN, languages/ro_RO, languages/es_ES, languages/es_MX, languages/pt_PT, languages/cs_CZ, languages/sk_SK, languages/sv_SE, single_pages/register.php, single_pages/members.php, single_pages/profile

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - Off
Full Page Caching - Off

# Server Software
LiteSpeed

# Server API
litespeed

# PHP Version
5.5.18

# PHP Extensions
bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gnupg, hash, iconv, imap, intl, ionCube Loader, json, libxml, litespeed, mailparse, mbstring, mcrypt, memcache, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SourceGuardian, SPL, sqlite3, standard, tidy, tokenizer, uploadprogress, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 32M
memcache.max_failover_attempts - 20
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 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.