Skip to content

Instantly share code, notes, and snippets.

@pawl
Created January 16, 2016 06:16
Show Gist options
  • Save pawl/ec77bd87b862e9b5896e to your computer and use it in GitHub Desktop.
Save pawl/ec77bd87b862e9b5896e to your computer and use it in GitHub Desktop.
Example of a WHMCS hook code using WHMCS's new "The Connection Manager"
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
function create_ldap_account($vars) {
$userid = $vars['userid'];
$criteria = array('fieldid' => '2', 'relid' => $userid);
$result = Capsule::table('tblcustomfieldsvalues')->where($criteria)->first();
$username = $result->value;
}
add_hook("ClientAdd",1,"create_ldap_account");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment