Page 1 of 1
FrontEndUsers and regular expression problem
Posted: Fri Jan 12, 2007 1:21 pm
by numer9
Hey,
on my new project i'm using the FrontEndUsers module. First of all - thanks for the great job
But I'm a bit confused.
In the "Users" tab (of FEU admin panel) there are 2 possibilities to search for some users. First is to use regex on user's name, second is to use regex on some property. Ok. First test - just asterisk (*), with nothing more - and the FEU is down.
Be careful if you want to reproduce it

on my site it's stuck for good. I had to enter the code and manually fix params['filter_regex'] and set it to something else (blank sign). The same test on the second regex field - and FEU is down again. The same happens every time the asterisk is the leading char.
And then another test -> created user test1, test2 and pest1. Entered regex t*1 -> it doesn't work again.
During those tests I was smarter - I've opened two windows with the same form, when entered the buggy regex in first one (FEU down) - switched to another window (another instance of the same site) and entered some "correct" regex, for example "aaa". The $params[] were overwritten and the App wasn't so badly broken... but that's not a good solution.
So - am I missing something? Some advice anyone? And one more question - where the hell are those $params[] held? I tried clearing my browser cache, grep-ped database and all CMS files - nothing.

Re: FrontEndUsers and regular expression problem
Posted: Fri Jan 12, 2007 2:58 pm
by calguy1000
a) setting the field to empty and hitting submit should reset the filter.
b) it uses true regular expressions, not 'wildcard matching'.
to search for users with an f in their name, just put an 'f' in the field.
to search for users beginning with f put "^f" in the field
to search for users ending with f put "f$" in the field.
Again, these are true regular expressions, not 'wildcard matching'. it's very powerful, you should look up perl or php regular expressions.
Re: FrontEndUsers and regular expression problem
Posted: Fri Jan 12, 2007 7:51 pm
by numer9
thanks calguy!
i'm pretty familiar with perl and php (and its reg expr), so "true pattern matchning" is ok with me. I just didn't think of it at first... I couldn't find that part in any documentation nor forum topic, that's why i asked.
that part is clear now
but as far as the bug - i know that empty field will clear the params and the form will work again. but still - try inserting asterisk (*) sign and hitting enter. You'll get the error and no access to the form, at least that's what i got (on newest version of all modules)...

the same happens when inserted 't??' (double question mark). It's not because i don't now regex, it's just that i'm planning to introduce the site (and FEU) to some "fresh" users and i'm testing it several ways to be sure that it won't stop...
And one more thing:
i've set the email field for one group - as an option. when logging in and going to "change settings" option, changing some stuff and leaving email blank - i'm getting an error "invalid email". Blank is wrong?
And last thing - after hitting "submit" (when no error is given) - i'm thrown to main site (index.php), is there a way to manipulate that option?
Re: FrontEndUsers and regular expression problem
Posted: Fri Jan 12, 2007 11:55 pm
by calguy1000
Okay, I fixed (somewhat) in svn the problem when you have an invalid regular expression
and
fixed problems with optional email address fields too.
Re: FrontEndUsers and regular expression problem
Posted: Fri Jan 12, 2007 11:59 pm
by calguy1000
Also, there's a preference "PageID/Alias for Change Settings form" that specifies where to jump to after this page is submitted. if empty, it jumps to the default page.
Re: FrontEndUsers and regular expression problem
Posted: Sun Jan 14, 2007 12:48 pm
by numer9
Hey,
i'll check the fix asap - thanks for another quick reaction.
As far as "PageID/Alias for Change Settings form" - i got that setting set, but on my "custom change setting site" the form got the action forwarding to "index.php":
Code: Select all
<!-- change settings template -->
Ustawienia
<form id="m5moduleform-2" name="m5moduleform-2" method="post" action="index.php">
not to that "custom" page...
I'm not providing "real-life" urls because it's all in Polish and it wouldn't be easy to explain everything on the site - i hope it's not a problem. If you can't reproduce my cases i'll create an English-lang env and let u know.
BTW - because of my project, FEU has 95% Polish translations already done

Re: FrontEndUsers and regular expression problem
Posted: Sun Jan 14, 2007 5:45 pm
by calguy1000
I'll see about taking a look at this this weekend.
Re: FrontEndUsers and regular expression problem
Posted: Mon Jan 15, 2007 11:14 am
by numer9
I've checked the 1.1.3-svn version of FEUSers and the problem with regex isn't critical any more

thanks!
And the email validation - it passes the blank email (allright!), but i got the impression that you also disabled "email format check" -> now the form buys even entries with no @ sign; and afterwards it causes problem when hitting "password reminder"... or am i missing something?
Re: FrontEndUsers and regular expression problem
Posted: Mon Jan 15, 2007 3:13 pm
by numer9
another bunch of tests, now on 1.1.13-svn: adding a FEU group (just the group) and trying to delete it - i get the error "cannot delete group with assigned users", but the group is fresh and has no users in it!
i'll add that i double-checked the sql structure, and there's no connection to my group in cms_module_feusers_belongs.
*****************
i'm answering myself:
in action.do_deletegroup.php, at about line 51, there is:
Code: Select all
if( count($this->GetUsersInGroup( $roup['id'] )) != 0 )
change it to
Code: Select all
if( count($this->GetUsersInGroup( $group['id'] )) != 0 )
-> a little mistake during restructuring module.
Sorry for the amount of tests, but i really like the module and try to find out everything about it

Re: FrontEndUsers and regular expression problem
Posted: Mon Jan 15, 2007 3:43 pm
by calguy1000
Okay, will take a look at that stuff when I get a chance. I didn't get a chance this weekend, what with company, etc. and I was working on the new Questions module.