Accounts::Create post hook homedir?

ehask71

Well-Known Member
Jul 13, 2007
62
5
58
Tampa, Florida, United States
cPanel Access Level
Root Administrator
create account post hook doesnt return homedir??

Does anyone know how to figure out where the acct home dir is for the created account?? The data array sent to the hook in post doesnt include the homedir location. I just ran into a weird situation with my WP installer script the hook listens for acct create and if the plan is a WordPress plan it does a full install of Wordpress.

The problem is my server all of a sudden decided to switch to /home2 (im still investigating why this happened) but it broke my custom autoinstaller. I believe postwwwacct used to pass homedir but I dont use that anymore I migrated my code to use hooks.

Is this a bug or do I have to do tests to find the homedir????

Thx,
Eric Haskins
 

ehask71

Well-Known Member
Jul 13, 2007
62
5
58
Tampa, Florida, United States
cPanel Access Level
Root Administrator
Just seems like a piece of pertinant info that create acct is aware of and should be passed in a hook. Its sent in the new acct email and postwwwacct

I put in a work around last night doing exactly what you suggest here just feels like a dirty hack

CPanel can you reevaluate your return values in Create Acct homedir is a dynamic value and really should be returned
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
create account post hook doesnt return homedir??

Does anyone know how to figure out where the acct home dir is for the created account??

use this code to get the user's homedir:

Code:
BEGIN { unshift( @INC, '/usr/local/cpanel' ); }
use Cpanel::PwCache ();
my $homedir = Cpanel::PwCache::gethomedir($user);