Jump to content

thebizbuilder

Member
  • Posts

    22
  • Joined

  • Last visited

About thebizbuilder

thebizbuilder's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. This is the same problem im having since upgrading to plesk 10. Ill follow the instructions and post my results. Thanks for pointing me in the right direction!
  2. Just to update, it appears that its giving 504 error when trying to run plesk10 module commands. Really frustrating because it effect signups and cancellations etc etc! Anyone else having this issue with plesk 10? Apparantly its really buggy and im regretting upgrading to plesk 10 now! Grr!
  3. Hi, I have not long upgraded to the new WHMCS control panel and plesk 10. Prior to this everything seemed to be working fine(I had the old WHMCS and Plesk 9.5) I have made the changes in plesk and WHMCS to ensure that it would be possible to create and terminate accounts, however whenever I go into a test client to try and create, terminate etc their product it just loads forever and then shows a white screen. This also in the process crashes my apache server which I then have to restart!? I'm really confused. Any help would be most appreciated!
  4. I was wondering if anyone knows of a way to have a hook based on when an invoice becomes over due??? I have tried using "invoiceunpaid" however this does not seem to have the desired effect as it does not perform the hook when an invoice becomes OVERDUE, which is quite an important time to be running certain tasks. Also it only seems to work when the invoice is set to unpaid in the admin panel and doesn't run automatically!? Any ideas would be greatly appreciated! Thanks in advance!
  5. Sorry but better than the aftermodule create would be the action hook named "addonactivation" duuh! Lol
  6. Hi Tom. Ill give u a few pointers. Im no expert but i have done a bit of work with whmcs! Firstly you will want to look at action hook. You can find them in the documentation on this site. You will likely use something like "aftermodulecreate" which basically will allow you to execute any php code u like when someones hosting package becomes active. Here you will be sent a set of variables mentioned in the documentation as $params this holds all you variables passed from whmcs. There is a list in the module creation documentation, in the template file. Then you have the task of posting the variables in your form. I suggest you do some reading on curl and php, and do a simple curl post execution. Its used everywhere over the web and there is plenty of info about it. I think paypal uses curl. There will be tutorials online about posting forms etc. I think that would be the best route to go down. If you have any other questions. Send them through!
  7. I am loving this question and would like to know myself if there are any modules or plugins or whatever that will allow automatic or whmcs client area email creation on plesk for me though!
  8. LMAO, sorry in the in the frustration of it not working and me being an idiot and changing all different things to get it to work I had deleted the GLOBALS from the ftpRec function, I just put them back in and now its working!!! :D:D:D this is GREEAT thank you for all your help bdigitalstudios ur a star! :D:D:D
  9. no wait, actually I lied its not even doing the css directory! Its not doing anything!?
  10. Hi, Thank you so much for your reply. That seems to have worked however there is another problem and again I have no idea why its doing this! My file structure inside the '"/var/www/vhosts/********/httpdocs/sites/".$dir' is like: /testsite/ index.html thankyou.html /css/style.css /css/style2.css /images/blah.jpg /images/blah.jpg /images/blah.jpg /images/blah.jpg The script seems to be creating and uploading everything in the CSS directory perfectly but doesn't do anything else However its heading in the right direction. I don't get any syntax errors or anything but I get a lot of php WARNING errors, so many that it crashes my browser lol! I'm trying to see if they are stored in the log on the server to put them here! OOOoo here are the warnings I am getting...well some of them, there are LOADS!!! [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: open_basedir restriction in effect. File(../) is not within the allowed path(s): (/var/www/vhosts/******/httpdocs:.:/php:/usr:/tmp:/etc:/var) in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 99, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: open_basedir restriction in effect. File(../) is not within the allowed path(s): (/var/www/vhosts/******/httpdocs:.:/php:/usr:/tmp:/etc:/var) in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 99, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: ftp_put() expects parameter 1 to be resource, null given in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 86, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate [Fri Dec 10 19:45:54 2010] [error] [client 81.97.91.187] PHP Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: open_basedir restriction in effect. File(../) is not within the allowed path(s): (/var/www/vhosts/******/httpdocs:.:/php:/usr:/tmp:/etc:/var) in /var/www/vhosts/******/httpdocs/whmcs/includes/hooks/uploadpackage.php on line 99, referer: http://www.******/whmcs/admin/clientshosting.php?userid=4&id=69&modop=terminate I hope you can help me on this. Thank you so much again, you are the first person to help me
  11. Hi all, I'm looking for some quick help on this problem that I'm having. What I want is a hook that transfers certain files to a newly created hosting package once it has been created. This is the code that I have so far and there is some additional code that I have used to test the ftp functions I have, these work fine on their own, however when I use them in the hook they fail to transfer the files over ftp to the newly created hosting package. Please take a look and see if you can spot anything and let me know... My appolagies for the messy code I have been changing and mixing things up trying to get it work and it has left it in a right state! <?php /* ******************************************** * Hook file that will detect when a client * * has paid and activated their account and * * uploads their selected site to their * * hosting. * ******************************************** */ function install_package($params) { #sleep has been put in because maybe this script was running too quickly after creation of module sleep(10); #THIS FUNCTION INSTALL THE PACKAGE THAT WAS REQUESTED AT TIME OF ORDERING. #FIRST GET THE PACKAGE THAT IS NEEDING INSTALLING $dir = getSiteDir($params['params']["customfields"]); #TRANSFER ALL FILES TO NEW DOMAIN // set the various variables $ftproot = "/httpdocs/"; $srcroot = "/var/www/vhosts/********/httpdocs/sites/".$dir; $srcrela = "/"; // connect to the destination FTP & enter appropriate directories both locally and remotely $ftpc = ftp_connect($params['params']['serverip']); $ftpr = ftp_login($ftpc,$params['params']['username'],$params['params']['password']); if ((!$ftpc) || (!$ftpr)) { echo "FTP connection not established!"; die(); } if (!chdir($srcroot)) { echo "Could not enter local source root directory."; die(); } if (!ftp_chdir($ftpc,$ftproot)) { echo "Could not enter FTP root directory."; die(); } // start ftp'ing over the directory recursively ftpRec ($srcrela); // close the FTP connection ftp_close($ftpc); #CREATE AND UPLOAD CONFIG FILE FOR USERNAME AND PASSWORD FOR CONTROL PANEL ETC } add_hook("AfterModuleCreate",1,"install_package"); // -------------------------------------------------------------------- // THE ACTUAL FUNCTION // -------------------------------------------------------------------- function ftpRec ($srcrela) { global $srcroot; global $ftproot; global $ftpc; global $ftpr; // enter the local directory to be recursed through chdir($srcroot.$srcrela); // check if the directory exists & change to it on the destination if (!ftp_chdir($ftpc,$ftproot.$srcrela)) { // remote directory doesn't exist so create & enter it ftp_mkdir ($ftpc,$ftproot.$srcrela); ftp_chdir ($ftpc,$ftproot.$srcrela); } if ($handle = opendir(".")) { while (false !== ($fil = readdir($handle))) { if ($fil != "." && $fil != "..") { // check if it's a file or directory if (!is_dir($fil)) { // it's a file so upload it $res .= ftp_put($ftpc, $ftproot.$srcrela.$fil, $fil, FTP_BINARY); } else { // it's a directory so recurse through it if ($fil == "templates") { // I want the script to ignore any directories named "templates" // and therefore, not recurse through them and upload their contents } else { ftpRec ($srcrela.$fil."/"); chdir ("../"); } } } } closedir($handle); } } function getSiteDir($customfields) { #FUNCTION TO GET THE DIRECTORY OF THE SELECTED SITE AND RETURN IT #FOR TESTING PURPOSES THIS WILL BE SET TO RETURN TESTSITE $dir = 'testsite'; return $dir; } ?>
  12. great to hear that you got it working . Yes that is a good suggestion, another option would have been to use the same username and password that are generated for your hosting creation(if you have one) But well done! its a challenge at times especially if you are not getting any error messages which is the issue I am having at the moment. I have a script that is being called using the hooks, its running fine but not doing what I want it to!!! GRRR I'm getting close to posing it on the forum here for advice!
  13. WOAH I did post another message before that but it never showed up!, Basically I said that in the API documentation it say you cannot use decryptpassword API call to get the clients password. So maybe that supposed to be used for the hosting password or something? http://wiki.whmcs.com/API:Decrypt_Password
  14. just a note....the Get_Clients_Password API actually returns the MD5 hash, so couldn't you just use this straight away instead of decrypting and re-encrypting the password? I dunno just a thought, might not work
  15. Hey i just reviewed the documentation and the API call you are using to decrypt the users password doesn'tactually decrypt the clients password from whmcs. I'm guessing its used to decrypt the password stored for the server password, that your client would use to log-in to plesk or c-panel for example. http://wiki.whmcs.com/API:Decrypt_Password However I am new to this also and am not very experienced! Just a hunch.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated