[updated module] Register module - admin notifcations, improved i18n, email subject prefixes

shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Sun, 2012-09-30 08:42

Hey everyone,

I updated talmdal's excellent register module to include:

- Option to send new pending user registration notifications to admin
When new pending users need approval, this gives the option to fire off an email to the Gallery 'reply to' address to notify the admin.

- Improved multi-lingual (i18n) functionality
All emails sent to the pending user are in their language; all emails (and site notifications) sent to the admin are in the Gallery default language. Also, the encoding of emails has been corrected to UTF-8.

- Added option for subject prefix on emails (e.g. '[Gallery3] ')
This can help identify emails as pertaining to the site.

- Added CSS to define dialog box size
This is useful for compatibility with newer themes (e.g. GreyDragon 4)

The new version is attached, and the doc wiki has been updated. Let me know whatcha think - thanks!

AttachmentSize
register_2.zip15.32 KB
 
walhalla

Joined: 2012-07-30
Posts: 12
Posted: Sun, 2012-09-30 10:18

Hi,
thanks for this work! But if i try to install (or update in an existing installation), the "Update" - button on the modules-site is deactivated if the register - module is marked. If i click the button nothing happens.

Thanks for your help

Walhalla

 
shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Sun, 2012-09-30 12:32

Hey Walhalla,

Drat - I left an extra parenthesis in the installer file. Sorry about that! The above zip file has been updated.

Thanks for the feedback!

Take care,
Shad

 
walhalla

Joined: 2012-07-30
Posts: 12
Posted: Sun, 2012-09-30 15:36

Hi Shad,
works great now! Thank you very much for the very, very fast correction and THANKS for implementing this essential function! It works great and the Gallery is usable now with registration.

Thanks again very much (your wife can be proud of you :)

Walhalla

 
lob

Joined: 2004-06-24
Posts: 19
Posted: Wed, 2012-10-03 16:44

The v2 I downloaded from the link above appears to be missing the register_event.php file. The module would install, but the link the Admin Dashboard dropdown would not appear, and the 'Register' link on the main page was missing.

 
shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Thu, 2012-10-04 07:28

@lob - that's very strange... and I'm having trouble reproducing your problem. In particular, I just downloaded the file from the link above, looked in it, and found the register/helpers/register_event.php file right in its place. Could your copy have been corrupted?

Another possibility to consider: that register_event.php file was one of the few I did *not* edit from v1. As such, if you're running some sort of clever update code, it might be missed. <shrug>

Take care,
Shad

 
tekeler

Joined: 2012-10-22
Posts: 6
Posted: Mon, 2012-10-22 07:19

strangely enough mine does not have a password field on the registration page. is it like this where it will be sending them an email with the password? also mine will not process the registration. it just sits there after clicking submit/register

 
Nonek

Joined: 2012-10-22
Posts: 2
Posted: Mon, 2012-10-22 21:09

Hey Shadlaws..
First, Thank you so much for contributing to Gallery3. I'm somewhat of a newbee to some of this stuff, but I follow direction well. ;-)
Ok so I tried out User Registration v1 and after I tried to register a User I got the normal registration page and I'm sorry but I can't remember exactly what I put in there, but the User name is Loser and Full name is Big Loser and I gave him a real email address and password.. So now I got the notification at the top to let me know I have a pending operation and I go to the registration config page just fine. I also have a pending registration entry at the bottom.
At this point it says the state is confirmed as I first didn't have that checked but in trying to clear this, I had changed it to "Visitors can create accounts and no administrator approval required"
But I do still have the entry down there and I'm supposed to check it and activate it.
Therein lies the issue..
Whenever I click the Activate check and then do Activate selected I get an Error Exception with this snippit in the code page
Stating that it's trying to do an array to string conversion.

306 */
307 public static function alpha_numeric($str, $utf8 = FALSE)
308 {
309 return ($utf8 === TRUE)
310 ? (bool) preg_match('/^[\pL\pN]++$/uD', (string) $str)
311 : ctype_alnum((string) $str);
312 }
313
314 /**
315 * Checks whether a string consists of alphabetical characters, numbers, underscores and dashes only.
316 *
Any ideas off the top of your head?
Here is what is in Var/logs
Any help would be hugely appreciated.. Even if it's to somehow help remove the Loser from the database ;-)
Thanks.
2012-10-22 15:02:30 -06:00 --- error: ErrorException [ 0 ]: Array to string conversion
D:\gallery3\system\helpers\valid.php [ 311 ]
#0 D:\gallery3\system\helpers\valid.php(311): gallery_error_Core::error_handler(8, 'Array to string...', 'D:\gallery3\sys...', 311, Array)
#1 [internal function]: valid_Core::alpha_numeric(Array)
#2 D:\gallery3\system\libraries\Validation.php(552): call_user_func(Array, Array)
#3 D:\gallery3\modules\register\controllers\admin_register.php(73): Validation_Core->validate()
#4 [internal function]: Admin_register_Controller->activate()
#5 D:\gallery3\modules\gallery\controllers\admin.php(62): call_user_func_array(Array, Array)
#6 [internal function]: Admin_Controller->__call('register', Array)
#7 D:\gallery3\system\core\Kohana.php(331): ReflectionMethod->invokeArgs(Object(Admin_Controller), Array)
#8 [internal function]: Kohana_Core::instance(NULL)
#9 D:\gallery3\system\core\Event.php(208): call_user_func_array(Array, Array)
#10 D:\gallery3\application\Bootstrap.php(67): Event_Core::run('system.execute')
#11 D:\gallery3\index.php(108): require('D:\gallery3\app...')
#12 {main}

 
tekeler

Joined: 2012-10-22
Posts: 6
Posted: Tue, 2012-10-30 05:54

Registration issue fixed on my part.

 
shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Tue, 2012-11-06 15:39

@nonek - hmm, I'm not sure I see why that'd be happening. Certainly, it seems like it has nothing to do with my v2 changes, but rather the main core.

If I were to *guess*, I might suppose that it's because you changed the policy after the first user started the process, thereby creating a funny case that wasn't anticipated when the v1 code was written. The solution, of course, would be to forget that first user attempt altogether, ensure the policy is set the way you want, and move forward. Then again, this really is just a guess.

As for removing the user from the pending user list, there's no way built into the UI to do this. However, you *can* delete the entry manually from the SQL database in the pending_users table (*not* the users table).

Take care,
Shad