Skip to Content Skip to Menu

Secondary User Confirmation

  • jwwicks
  • jwwicks
  • OFFLINE
  • Posts: 27
  • Thanks: 0
  • Karma: 1
15 years 2 months ago #110929 by jwwicks
Secondary User Confirmation was created by jwwicks

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/joomlapolis824/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 1435
Hello All,

I'm trying to develop my first CB plugin but need a little help in the analysis portion.

Use Case (Scenario):
  • User clicks Login/Register Here button or Register Your Book link
  • Registration form displayed with extra Order ID field
  • User fills out form including Order ID number
  • User submits form
  • Normal CB User email confirmation sent
  • User clicks email confirmation link
  • CB onAfterUserConfirm Event triggers new plugin to email accounting to confirm Order ID, if entered
  • Accounting clicks confirmation link which triggers new plugin which upgrades User Access level
  • User able to view/download Valid Order content

My understanding is this is a user plugin but has configuration settings akin to those in the CB administration Registration tab. Should I create another tab in the admin area or can you add on to the Registration tab.

Normally I'd want to check the Order ID against a database but that isn't possible in this particular scenario so I'd like to automate the process as much as possible without having to manually get an email, login to CB/!JAdmin and update the User level.

My boss just purchased the subscription today so I have access to all the core plugins. Can this be accomplished with one of them. I searched but didn't see anything that might fit the bill.

Ideas, comments, have I lost my mind :)

PS: Finished the plugin but had to hack comprofiler.php. Also might have an issue with lifetime of the cbactivation code. Anyone know the lifetime of the code, I'm using the event onAfterUserActive and the code is there but I've noticed during testing that the code is dissappearing...

PSS: Here's what I had to do:
  • Create a activation code field for my plug-in to use
  • Create a field to display on the Login Form for a code the plug-in uses for validation
  • Create plugin - See code below
  • Hack comprofiler.php - see code below
  • Add a user to Joomla, with email that gets the confirmation emails
  • Install the plugin
  • Upload the hack of comprofiler.php
  • Configure the plugin to match your field names and user

Jw

Post edited by: jwwicks, at: 2009/09/28 23:04
Post edited by: jwwicks, at: 2009/09/28 23:10

nxtlvlconfirm.php
[code:1]
<?php
/**
* Joomla Community Builder User Plugin: plug_nextlvlconfirm
* @version 1.0.0
* @package plug_nxtlvlconfirm
* @subpackage nxtlvlconfirm.xml
* @author John Wicks (Gh0st)
* @copyright (C) (Gh0st), GreatLittleBook Publishing Co., Inc
* @license Limited www.gnu.org/copyleft/gpl.html GNU/GPL
* @final 1.0.0
*/

/** ensure this file is being included by a parent file **/
if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); }

global $_PLUGINS;
$_PLUGINS->registerFunction('onUserActive', 'nxtlvlOnUserActive', 'plug_nxtlvlconfirm');
$_PLUGINS->registerFunction('onBeforeUserActive', 'nxtlvlOnBeforeUserActive', 'plug_nxtlvlconfirm');

/**
* NextLevel Confirmation Class.
* This plugin is used to confirm a user via a user-created CB field.
*/
class plug_nxtlvlconfirm extends cbTabHandler {
/**
* Constructor
*/
function plug_nxtlvlconfirm() {
$this->cbTabHandler();
}

/**
* Get plugin, tab, and Community Builder fields related to this application
* @returns associative array of parameters/values pairs for the plugin
*/
function _nxtlvlGetPlugParameters(){
$params = $this->params;

$PlugParams["nxtlvlplugenabled"] = intval($params->get('nxtlvlPlugEnabled', 1));
$PlugParams["nxtlvlwatchfieldid"] = $params->get('nxtlvlWatchFieldId',"email"«»);
$PlugParams["nxtlvlonconfirmedgroup"] = intval($params->get('nxtlvlOnConfirmedGroup',19));

$PlugParams["nxtlvlemailfromuserid"] = intval($params->get('nxtlvlEmailFromUserId',0));
$PlugParams["nxtlvlemailtouserid"] = intval($params->get('nxtlvlEmailToUserId',62));
$PlugParams["nxtlvlonchecksubject"] = $params->get('nxtlvlOnCheckSubject',"[SITENAME] - Next Level Verification"«»);
$PlugParams["nxtlvloncheckbody"] = $params->get('nxtlvlOnCheckBody',"Username: [NAME]
Email:

A person who never made a mistake never tried anything new. - Albert Einstein

Please Log in or Create an account to join the conversation.

14 years 5 months ago #133953 by toodooloo2004
Replied by toodooloo2004 on topic Re:Secondary User Confirmation
Is there anyway to do this without hacking the core files?

I need to set up something similar...

1/. where a user provides the secondary email address and name (of the person who will give them a character reference) on the registration form.

2/. When the user hits the register button I'd like CB to send out a second confirmation email to that second email address with two links one for confirmation that they know and can provide a character reference and the other to reject.

3/. The user is then notified that the person providing the character reference is happy to proceed or that they are not and to re-register.

4/. Once CB receives the two confirmations (one to validate the users email, 2nd for character reference) Then CB notifies a site admin that a new user has applied to join the site and to login to approve them. (this is where the admin will contact the referee for the character reference before finally approving the user registration.

I know some of this functionality is already present in CB.. all of this works for the users email confirmation. but how can we add another confirmation step into the registration process without hacking the core files?

Please Log in or Create an account to join the conversation.

14 years 5 months ago #134516 by toodooloo2004
Replied by toodooloo2004 on topic Re:Secondary User Confirmation
Can anyone shed any light on this?

Please Log in or Create an account to join the conversation.

14 years 5 months ago #134659 by toodooloo2004
Replied by toodooloo2004 on topic Re:Secondary User Confirmation
Sorry to be a pain, but I would really appreciate any help that anyone out there could offer. I have compiled, installed and published the plugin and have added the hacks to comprofiler.php but alas it doesn't seem to work. I really didn't want to hack the CB core files and would prefer to use a plugin if one were available.

A "secondary confirmation" plugin would be great. How would I go about it? can anyone out there help? It would make a great addition to an already great Community System.

Please Log in or Create an account to join the conversation.

  • jwwicks
  • jwwicks
  • OFFLINE
  • Posts: 27
  • Thanks: 0
  • Karma: 1
14 years 5 months ago #134668 by jwwicks
Replied by jwwicks on topic Re:Secondary User Confirmation
Hmm, It's been working on ZeroDowntimeMigration for months now.

I'll put the code on Google and post the location. Then you can download the files from there.

Jw

PS: code.google.com/p/jww-jmla-cb-plg-nxtlvlconfirm/

Post edited by: jwwicks, at: 2010/06/03 17:49

A person who never made a mistake never tried anything new. - Albert Einstein

Please Log in or Create an account to join the conversation.

  • jwwicks
  • jwwicks
  • OFFLINE
  • Posts: 27
  • Thanks: 0
  • Karma: 1
14 years 5 months ago #134697 by jwwicks
Replied by jwwicks on topic Re:Secondary User Confirmation
Hello,

My particular plugin won't work in your scenario since the email/ID of the confirmation person is configured by the admin of CB/Joomla when they install the plugin.

I suppose the plugin could be modified by a developer to work in your scenario.

I haven't been able to find any way of doing this without hacking the core unfortunately. If there's a way to tell com_profiler's router to trigger a plugin task via a url I've been unable to find that in the docs for CB.

Jw

A person who never made a mistake never tried anything new. - Albert Einstein

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum