ardacetin / clients-oriented-ftp

Automatically exported from code.google.com/p/clients-oriented-ftp
0 stars 0 forks source link

email notifications for 'self created' users #447

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. turn on clients can self register
2. client uploads file
3. no notification sent to any admin

What is the expected output? What do you see instead?
an email to be sent, none was sent (note all other emails including emails for 
admin uploading to a user WORKS)

What version of the product are you using? On what operating system?
r412 - may have been fixed in later releases but i'm having issues w/ the 
update and decided to stay at r412 for now

Please provide any additional information below.
i found the issue, and did a very very basic fix that works for me, but I'm 
sure there's a more elegant way to solve the same issue in the figure.  

the root of the issue was that when a notification email is sent, it queries 
for the 'created_by' user in the tbl_users table of the database.  If nothing 
is present, no notification is sent.  When a user self-creates there is no 
created_by in the database, hence no email.  

my work-around was editing /includes/classes/actions-clients.php to change the 
'search' for who created the account to a definitive reference, always 
referencing the admin username.  

line of code before: 
        /** Who is creating the client? */
        $this->this_admin = get_current_user_username();
after:
        /** Who is creating the client? */
        $this->this_admin = admin;

note that admin in the after code should reflect the username of the 
administrator you want to assign notifications for all user-created accounts.  
it won't figure out what username the main admin account is, as mine is NOT 
'admin' but i changed it there for ease of reference.  

as i said, there's probably a much better way of going about, but it works for 
now.  

possible solution - in the clients option page for admins along with the 
self-creation option, include a 'system account to assign all self created 
accounts to' etc etc.  

Original issue reported on code.google.com by gigantic...@gmail.com on 28 Feb 2014 at 4:58

GoogleCodeExporter commented 8 years ago
Hello!
Thanks for reporting this. Very nice find!
I'll be looking into the option you suggested (assign to a certain admin).
But the thing is that the option could become invalid if the selected admin is 
deleted.
Anway, the main system user is always present so for the moment he could be the 
one receiving the notifications.

Original comment by i...@subwaydesign.com.ar on 7 Mar 2014 at 7:57

GoogleCodeExporter commented 8 years ago
Main system user seems like the best bet...  Possible future feature could be 
'assigning' clients/users to specific system users.  

Original comment by gigantic...@gmail.com on 7 Mar 2014 at 3:47