Forum Activity for @brian

brian
@brian
03/18/14 06:25:52AM
10,169 posts

Check Password While User Account Creation


Jamroom Developers

You definitely don't want to modify the jrUser module - there's no need to. Instead you want to create your own custom small module that has an event listener inside that watches for signups and can check the incoming password for whatever rules you would like. Something like this:

1) Create a new directory in your modules directory called "pwCheck" or whatever you want to call it.

2) create a new file inside that directory called "include.php" with the following inside:

<?php

// Meta data about our module
function pwCheck_meta()
{
    $_tmp = array(
        'name'        => 'Password Checker',
        'url'         => 'pwcheck',
        'version'     => '1.0.0',
        'developer'   => 'Your Name',
        'description' => 'Checks users passwords on signup',
        'category'    => 'users'
    );
    return $_tmp;
}

// Init function
function pwCheck_init()
{
    jrCore_register_event_listener('jrCore', 'form_validate_exit', 'pwCheck_listener');
    return true;
}

// Validate password field after core has validated other fields
function pwCheck_listener($_data, $_user, $_conf, $_args, $event)
{
    global $_post;
    if ($_post['module'] == 'jrUser' && $_post['option'] == 'signup_save') {
        // We have a new user creating an account - check password
        if ($_post['user_passwd1'] != 'abcdefg') {
            jrCore_set_form_notice('error', 'Your password is not abcdefg!');
            jrCore_form_field_hilight('user_passwd1');
            jrCore_form_field_hilight('user_passwd2');
            jrCore_form_result();
        }
    }
    return $_data;
}
?>

Just adjust this part:

if ($_post['user_passwd1'] != 'abcdefg') {

to suit your needs.

3) You can add a small “icon.png” file in the same directory if you’d like an icon in ACP.

Hope this helps!
updated by @brian: 03/18/14 06:26:47AM
brian
@brian
03/18/14 06:09:07AM
10,169 posts

listening/notification question


Using Jamroom

$_post['id'] is the Item ID - that is what is used in the jrAction_save functions.

When a form is displayed in Jamroom, every field has a unique "name" - so the name of each field (and it's value) will come in as part of the $_post array.

So in your "save" function (the function that is the target of a form), you would access the checkbox as whatever you named the field - so if you called the checkbox field "mymodule_form_done", you could check for it in the save function like:

if (isset($_post['mymodule_form_done']) && $_post['mymodule_form_done'] == 'on') {
    // The "form completed" checkbox is ON - do your work here....
    jrCore_run_module_function('jrAction_save', 'create', 'myModule', $_post['id']);  // assuming $_post['id'] is the Item ID of the item we are finishing.
}

A checkbox in Jamroom will always have a $_post value of either "off" or "on".

Hope this helps!
updated by @brian: 03/18/14 06:09:21AM
brian
@brian
03/18/14 06:02:43AM
10,169 posts

jrPage


Installation and Configuration

MAD©:How did you fix this exactly @brian?
I have the same problem.
My TOS page I created is showing in the Datastore but not in Browse existing pages.
Not sure when this happened as it was showing.

Check in the jr_jrpage_item_key table, and look for the "key" called page_location - it should be set to "1" if the page shows on a profile, or "0" if the page shows on the site. In this instance all the pages that were supposed to show on the site had a value of "Show Page on Main Site" instead of "0" (in other words they had the text of the select item instead of it's value). So first up, just change those entries to 0.

Then, go into the jr_jrcore_form table and find the entry for jrPage -> page_location (in the "module" and "name" columns) and make sure the "options" column is set to:

["Page is visible on Main Site","Page is visible on Profile"]

anything else is wrong.

I'm not sure how it was setup wrong, but I suspect a very early version of the module was using the wrong data structure for the options array.

Hope this helps!
updated by @brian: 03/18/14 06:04:30AM
brian
@brian
03/18/14 05:54:45AM
10,169 posts

Fresh Install System Check


Jamroom Developers

Make sure the file is chmod'd to 755 or 700. If that does not work, try re-uploading it in binary mode.

Hope this helps!
brian
@brian
03/17/14 05:17:04PM
10,169 posts

inviter ?


Jamroom Developers

If you are using Mailgun you can "import" all your users into an internal mailing list and then when you send an email to that list, it will send it to everyone - it's really easy and has some security stuff built in to prevent anyone else form using the list.

We'll definitely have an "inviter" type module - just not something we've done yet.

Hope this helps!
brian
@brian
03/17/14 03:19:10PM
10,169 posts

Profile fields depending on quota


Using Jamroom

Yeah - sounds like you are in the wrong area. You should:

- view the "profile settings" page for a profile as the master admin
- click on the "Form Designer" button in the upper right
- Click on "modify" button to the right of a field
- you will see the "Display Groups" option inside.

Double check that you are up to date as well - the ability to select multiple groups was added in Core 5.1.22:

https://www.jamroom.net/the-jamroom-network/networkmarket/32/jamroom-5-system-core?expanded_changelog=1

Hope this helps!
brian
@brian
03/17/14 03:11:16PM
10,169 posts

Profile fields depending on quota


Using Jamroom

maxcinsay:Thanks Brian, this is exactly what I was looking for. I got the form and only got the "Group" option where I can only select one of them :( Am I in the wrong place? Thanks

It sounds right - you just need to down shift (windows) or command (mac) while selecting more than 1 in the Display Groups option.

Let me know if that helps.
brian
@brian
03/17/14 02:56:59PM
10,169 posts

Profile fields depending on quota


Using Jamroom

No problem - select the "profile/settings" from the small drop down select in the upper right - this will show you the field that are in the settings form. You can then click on the "modify" button to the right of any field, and you will be taken to a new form where you can change all sorts of stuff for the field. One of these fields is called "Display Groups" - you can select the user groups or quotas (more than 1 is allowed) that you want that field to show to.

You can also from the profile/settings section create a NEW field by entering the field name at the bottom.

Let me know if that helps.
brian
@brian
03/17/14 02:54:04PM
10,169 posts

jrPage


Installation and Configuration

OK - you should be fixed. For some reason the "choices" value that had been saved for the page_location select field in the jr_jrcore_form table was wrong (it was not setup as an array, but a string) - this was causing the value to be incorrect when the page was created for the "site". I manually updated them and you should be good to go.

Hope this helps!
updated by @brian: 03/17/14 02:54:22PM
brian
@brian
03/17/14 02:25:47PM
10,169 posts

Profile fields depending on quota


Using Jamroom

You can select the quotas you want the fields to show to in the form designer.

Hope this helps!
  776