Jump to content

nuxwin

Member
  • Posts

    20
  • Joined

  • Last visited

About nuxwin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nuxwin's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. See also https://forums.whmcs.com/showthread.php?132893-Unable-to-connect-as-administrator-after-fresh-install-(WHMCS-v7-2-3)
  2. Good morning, Is there a PHP http client included in WHMCS source code which we could reuse in our server provisionning module? That would avoid us to pack an HTTP client from elsewhere. And if there is one, could you provide me with a link to the appropriate documentation? Thank you.
  3. After disabling strict mode (in my case this was the STRICT_TRANS_TABLES), all went fine: root@jessie:~# cat /etc/mysql/conf.d/sql_mode.cnf [mysqld] sql_mode = NO_AUTO_CREATE_USER root@jessie:~# service mysql restart root@jessie:~ To WHMCS team: sql_mode can be set on a per session basis. You should considere disabling any strict mode. For instance, with PDO, you could do something like: ... $pdo new PDO("$type:host=$host;dbname=$name;charset=utf8", $user, $pass, [ ... PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION sql_mode = 'NO_AUTO_CREATE_USER'" ]); ...
  4. Maybe related: https://forums.whmcs.com/showthread.php?132457-MariaDB-10-2-Problem I'll give a try with older MariaDB version then, fallback to MySQL if really needed...
  5. Dear community, I've just made a fresh installation of WHMCS v7.2.3, using your own tarball. All went fine excepted the fact that I'm unable to connect as administrator. I repeated the install process two time with same result. It's appear that the tbladmins table is empty after installation. Info about my environment WHMCS v7.2.3 (with a DEV license) Distribution root@jessie:~# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.9 (jessie) Release: 8.9 Codename: jessie PHP root@jessie:~# php -v PHP 5.6.31-4+0~20170804100521.6+jessie~1.gbpea630b (cli) Copyright © 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.2, Copyright © 2002-2017, by ionCube Ltd. with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies RDBMS Server version: 10.2.8-MariaDB-10.2.8+maria~jessie-log mariadb.org binary distribution. Thank you for any advise.
  6. @sentq I figured out. I prefer use the PreModuleCreate hook because I can stop the process on error. The final hooks.php file look like this: use Illuminate\Database\Capsule\Manager as Capsule; /** * Replace generated username by domain name when a product is setup automatically */ add_hook('OverrideModuleUsernameGeneration', 99, function ($vars) { if ($vars['moduletype'] != 'imscp') { return NULL; } return $vars['domain']; }); /** * Replace generated username by domain name when a product is setup manually */ add_hook('PreModuleCreate', 99, function ($vars) { $vars = $vars['params']; if ($vars['moduletype'] != 'imscp' || $vars['username'] === $vars['domain']) { return NULL; } try { Capsule::table('tblhosting') ->where('id', $vars['accountid']) ->update(array('username' => $vars['domain'])); } catch (Exception $e) { logActivity(sprintf('[ERROR] Could not override username: %s', $e->getMessage())); return array('abortcmd' => true); } return NULL; // Only to make my PHPstorm IDE happy }); Again, thank you for your help.
  7. @sentq Thank for your answer. Something like: /** * Replace generated username by domain name */ add_hook('AfterModuleCreate', 1, function ($vars) { $vars = $vars['params']; if ($vars['moduletype'] != 'imscp') { return NULL; } full_query( " UPDATE tblhosting SET username = '{$vars['domain']}', lastupdate = NOW() WHERE id = '{$vars['accountid']}' " ); }); Is there a way to prepare the SQL statement? I would like the values being automatically quoted. Thank. Edit: Ok, it seem that full_query() function is being deprecated. I'll update according: http://docs.whmcs.com/Interacting_With_The_Database Apart this, does the logic above is ok for you?
  8. Good morning, We created a WHMCS provisioning module for our control panel. Because in our control panel, the usernames match the domain names, we added a hook which overrides the username that is automatically generated by WHMCS when an order is being placed. The hook look as follow: /** * Replace generated username by domain name */ add_hook('OverrideModuleUsernameGeneration', 1, function ($vars) { if($vars['moduletype'] != 'imscp') { return null; } return $vars['domain']; }); This works well for products that are setup automatically (the hook is run as expected and the username is set with the domain name as expected). However, when the order is placed and accepted manually, or when the product setup is not automatic, the hook is not triggered and thus, the username is not overriden. We already reported the issue to WHMCS team (#AMI-418461 no answered yet) but it would be great if someone here could help us to find a temporary workaround. The hook should be triggered in every contexts (when our provisioning module is involved). To resume, each time the username is being generated, that hook should be called. Thank you for your help. Involved WHMCS version: 6.3.1
  9. Hello ; Does it's really an important issue? I means, your customers, once they are getting their credentials can update their password isn't it? Right now, I do not know about any feature which can allows you to enforce the password strength out of the box. The only way I see is to hook into the order process and generate your own password.
  10. Hello ; This is exactly what I thought too. When I've read the related announcement, I've thinked: God, it's like in FRANCE: They now provide a different support level for both the poor and the rich... This is exactly why this looks like an insult. If you need more money, you can always increase the licence price a bit (for everyone) but you you should never create a service which can cause some disruptions and inequalities in the treatment of your customers. BTW: I'm also wondering if in term of law, this kind of system is really legal. Afaik, all licenses come with a support level which should be same for any customer. The creation of such service will cause different treatments for your customers, which have paid their licenses before this upgrade. You're claiming that you've the logistic to answer any support request in time but nobody will trust you. If you have such logistic, the Fast-Track support service is not needed.
  11. Would be great to get some feedbacks from the dev/admin team Thank you for your great job.
  12. Edit. It could be great if a nice admin lifts some restrictions on my account: - I'm unable to post without approval (Should be solved) - I'm unable to send any private message (even to an WHMCS admin) (Solved) - I'm unable to edit my profile (Solved) Thanks you - - - Updated - - - I'm also unable to edit my post... It's a shame (Solved)
  13. Hello ; I'm the developer of the KaziWhmcs plugin which provides a WHMCS server provisioning module for our control panel (i-MSCP). Because our control panel is using the product domain names as username, I need to override the usernames which are auto-generated by WHMCS when a new order is placed (created), whatever the context (as from the client area or from the admin area). Indeed, right now, the usernames, which are derived from the domain names, are truncated to 8 letters max and some characters such as the dot are automatically discarded by the WHMCS username validator/generator (It's only an assumption made on the current behavior here since I've not access to the source code). Thus, I've searched for an event allowing me to operate at post-creation of the orders but unfortunately, no hooks point is provided for such thing. Indeed, I've found the following interesting hook points: PendingOrder From the Order page in the Admin area, clicking on the Pending Order button or via the API command. As the order is being set to Pending, before any updates are completed. The problem here is that any listener registered on this event is triggered only when the status of the order is set back to "pending". This event doesn't seem to be triggered after a new order creation (when the initial status is set to "pending"). For me this appears like an inconsistent behavior, and it would be interesting to trigger that event also on post order creation, when the initial status is set to "pending". Anyway this event seem to be triggered only in admin/API contexts, not from any action coming from the client (through the client area) ShoppingCartCheckoutCompletePage As the cart complete page is displayed to the client. This event allow my listener to do the expected job but unfortunately, it is is only triggered from the client area context when the checkout is made. _________________ Finally, I've "figured out" with the following listener which listen to the "OverrideOrderNumberGeneration" event. Indeed, this event is triggered in every contexts. It's really a workaround here because this event is triggered on pre-order creation and thus, at this state, I don't know the orderid yet: ** * Update auto-generated usernames with product domain names * * @param array $vars Variables * @return void */ function hook_imscp_update_username($vars) { if (!empty($vars['products'])) { register_shutdown_function( function ($products) { foreach ($products as $product) { if (isset($product['domain'])) { update_query( 'tblhosting', array( 'username' => $product['domain'], 'lastupdate' => 'now()' ), array( 'domain' => $product['domain'] ) ); } } }, $vars['products'] ); } } add_hook('OverrideOrderNumberGeneration', 1, 'hook_imscp_update_username'); As you can see here, I uses this listener to register a shutdown function which is responsible to override the username for each product once the new order is placed (created). This not really a beautiful piece of code but this works. My recommendations It would be nice to have some generical events triggered at some points (in every contexts) such as: PreCreateOrder PostCreateOrder ... Here I'm talking about the order process but this advises apply to all hook categories. Thank you for reading me. BTW: I'm using the "event" and "listener" terms here because it's more accurate to my eyes than using the hook function and hook point terms.
×
×
  • 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