E-Mail Change

SeLLeRoNe

Super Moderator
Joined
Oct 9, 2004
Messages
6,643
Location
A Coruña, Spain
HI,

ive noticed that when an admin/reseller change a user email at the user info, the email isnt changed on ticket system aswell and i suppose it should.

So, maybe should be a bug.

Also, i would like that when an user information such as Name or E-Mail in user data is changed the user_modify_post.sh is called aswell.

Thanks

Regards
 
Hello,

I've updated the code to change the Message System email when a Reseller/Admin changes the E-Mail of a User.

As for the user_modify_post.sh, I have not yet done it, but would like feedback to see if that's something others would like it to be called for these cases. Or perhaps an user_email_modify_post.sh would be more backwards compatible (in case Admins are not expecting the call user_modify_post.sh with their existing custom setups)

John
 
user_email_modify_post.sh would be pretty fine aswell cause i need to update database with a script when it change.

At the moment everytime i edit the user email i must return to user info, modify and save (without modify anything) so the script is called and i can grep the email changed.

So, please user_email_modify_post.sh would be pretty much appreciated.

Maybe, user_info_modify_post.sh called when email and/or name is changed would be also better :)

Thanks a lot
 
Hello,

I have added code which updates the tickets email value when an Admin/Reseller sets the email of a User.
If a User does it, only his "email" value is set.. his tickets email value can still be changed.

I have just added the user_info_modify_post.sh script (not in pre-release):
http://www.directadmin.com/features.php?id=1272

John
 
Ok for ticket, but, this will not call any script?

I mean, if admin/reseller change a user email and press "save email" will trig any script? Cause im about to solve with a workaround the problem to set server hostname as domain in directadmin and last step is the ability to automatic update a forwarder when the email get changed and those two cases are remaining:

Admin/reseller change a user email
user change his own related email

Regards
 
The CMD_CHANGE_INFO and CMD_MODIFY_USER (for the single items) will trigger the user_info_modify_post.sh
Those 2 commands will also send the email to the ticket value.

If a User edits the ticket value, then it would call:
Code:
CMD_TICKET
method: POST
action=email
ON=yes   this will not be passed at all if unchecked/disabled.
[email protected]
where you'd need to use the all_post.sh on that trigger.
Example: http://help.directadmin.com/item.php?id=184

John
 
Ok, thanks a lot :)

Ill investigate on hwo to filter on all_post.sh for the ticket related.

Regarding user_info_modify_post.sh waiting for stable release do you think this will work?

Code:
if [ $evalue != "" ]; then

        email=$evalue
        /usr/local/bin/php /usr/local/directadmin/scripts/custom/modify_forwarder.php

fi

modify_forwarder.php will take $email value from server using:
$email = $_SERVER;

Regards
 
Last edited:
The $evalue will always be present and filled. You'd want:
Code:
if [ "$email" != "" ]; then
          email=$evalue /usr/local/bin/php /usr/local/directadmin/scripts/custom/modify_forwarder.php
fi
where the env variable is set on the same line as the call.. that's how I pass env variables to script anyway (might be other way to go about it)

I also always "quote" variables in if-statements, because, if the are blank and not quoted, it equates to:
Code:
if [  != "" ]; then
which throws a syntax error.

John
 
Thanks a lot for the hint, not a programmer so i do my best :)

Ill try your suggestion right now and post result.

BTW, are you interested on how let admin use server hostname as domain? Would be useful for you to implement it in da?

Regards
 
Also.. ive another question.

In your if you used $email but on the help it say that email variable will be evalue, so, how can be email variable not-empty at the time of the script get call?

Maybe ive missunderstood something?

Regards
 
Oh ok, ive re-read the guide, email value is passed with email in it? If yes so i dont need email=$evalue, if email=button's text mean that for example "save" is passed so ok, i need to keep email=$evalue for update the value to the new email address.

Which one?

Thanks
 
Ok, user_info_modify_post.sh work perfect.

One little think, once user change his own ticket email i think should be nice if the user info (admin/reseller level) change aswell.

Regards
 
Back
Top