2 questions - is email required , disabling login and new profile links.

Posted by KWood 
2 questions - is email required , disabling login and new profile links.
November 02, 2008 01:03PM
Hi
I now have a working integration of Phorum to my site, but...
when creating users via module as describe in this phorum i HAVE to create a Email for the user, my problem is that about 10% off my users don't have E-mails registered, so at the moment they dont have access to the forum, is there a possibility of creating the user without a e-mail - thereby disabling all E-mail functions for that user in the forum or is the answer to give the user a non-existing E-mail adress on my domain???

since I now ONLY wont users to log in via the integration, and only want users to be created with the integration i need to disabled to to links "login" and "create new profile" for users that are not logged in... how do I do that???
Re: 2 questions - is email required , disabling login and new profile links.
November 02, 2008 01:28PM
Quote
KWood
or is the answer to give the user a non-existing E-mail adress on my domain???

That is the correct answer. Phorum requires the e-mail address, so you will have to set some bogus email address for the user. For example "<theuserid>@fake.yourdomain.com", so it won't collide with any other mail addresses. You could modify the header template to add some code that checks the user's mail address. If it ends in "fake.yourdomain.com", you could add a notice to the page that not all functions in the forum will work because of the missing mail address. Another thing to do could be to write a module that disables the mail functionality (by dynamically setting the related config values in $PHORUM) when the active user is in the fake.yourdomain.com domain.

Quote

since I now ONLY wont users to log in via the integration, and only want users to be created with the integration i need to disabled to to links "login" and "create new profile" for users that are not logged in... how do I do that???

Most basic method: edit the templates. I think that it would work if you'd simply edit for example login.tpl and added code at the start like:
[code="php"]
<?php
phorum_redirect_by_url('/path/or/url/to/your/login.page');
?>

... original template code ....
[/code]

So the user can click login, but will be redirected to your own login page. The same trick can be done for register.tpl.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: 2 questions - is email required , disabling login and new profile links.
November 10, 2008 01:59PM
Hi
Tanx alot!!!
can you direct me to some guides off creating the module for disabling e-mail functions when email is invalid???
Re: 2 questions - is email required , disabling login and new profile links.
November 10, 2008 03:45PM
Well, you could look at the PM restriction module for ideas about restricting the PM system based on the mail address.

For the user, you should always have some settings fields set to some static values in the user data. Maybe you can use the user_get hook to fix it at retrieval time. Fields of interest are:
  • hide_email = 1 (do not show the mail address for the user)
  • pm_email_notify = 0 (do not send PM notifications)
  • moderation_email = 0 (no moderation mail, just in case they are moderator)

Furthermore, some global forum settings have to be tweaked when a user with an invalid email address is logged in. For example from the common_post_user hook. Fields of interest are:
  • allow_pm_email_notify = 0 (disable PM, probably you'll find this in the pm restriction mod too)
  • allow_email_notify = 0 (disable following threads by mail)

This is a quick list that I compiled. There might be more things involved, but this is probably a good start.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: 2 questions - is email required , disabling login and new profile links.
November 11, 2008 03:36PM
Hi Maurice.
I am deep into the module creation, but I also want to disable/remove some edit options in the controlpanel for all users, more specifik the following:
"Edit My Profile", "Edit Email Settings" and "Change Password" since these settings only should be changed in the mai system. can this be accomplish in af module or by a edit of the template ? As far as I can see editing the template just hides the option?
Re: 2 questions - is email required , disabling login and new profile links.
November 11, 2008 05:56PM
Indeed, you'll have to edit the template. In the embed_phorum module I had to take care of the same and I solved it by editing the template as well.

To prevent users from posting the data directly to the control center scripts, you would have to deny the updates from the control center code. You should be able to do so by removing the fields that users should not edit from there through the cc_save_user hook (you can find that one in control.php).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: 2 questions - is email required , disabling login and new profile links.
November 12, 2008 03:09AM
Hi maurice
can I edit the general forum settings from inside the get_user hook by doing as below inside the user_get hook:
$GLOBALS["PHORUM"]["pm_email_notify"]=FALSE;
$GLOBALS["PHORUM"]["allow_email_notify"]=FALSE;
Re: 2 questions - is email required , disabling login and new profile links.
November 12, 2008 03:51AM
Why from the get_user hook? That is not a logical place. That hook is called for every user that is loaded from the database. It is not a hook for the current user.

The answer would be "yes", since you can do that. But, like stated above, I do not see why you would want to do that from there.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: 2 questions - is email required , disabling login and new profile links.
November 12, 2008 04:16AM
do it in some hook which is called in common.php after the current user is loaded. don't know the name but its in there.


Thomas Seifert
Re: 2 questions - is email required , disabling login and new profile links.
November 12, 2008 04:36AM
You mean like the hook that I mentioned in an earlier post? ;-)

Quote

Furthermore, some global forum settings have to be tweaked when a user with an invalid email address is logged in. For example from the common_post_user hook. Fields of interest are:
  • allow_pm_email_notify = 0 (disable PM, probably you'll find this in the pm restriction mod too)
  • allow_email_notify = 0 (disable following threads by mail)


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login