kylevorster Posted November 17, 2011 Share Posted November 17, 2011 Hey There, I'm trying to build a whmcs loginshare with wordpress but hitting a snag, I built a action hook in whmcs using the wordpress codex functions and on their own outside whmcs they work just fine but within whmcs it keeps on trying to run the wordpress installation as if wordpress is not installed, Here's my code. <?php function hook_wordpress_account($vars) { @require_once('../../blog/wp-blog-header.php'); $userdata = get_userdatabylogin( $vars['email'] ); $user = array (); if ($userdata->ID) { $user['ID'] = $userdata->ID; } $user['user_pass'] = md5($vars['email']); $user['user_login'] = $vars['email']; $user['user_nicename'] = $vars['firstname']; $user['user_email'] = $vars['email']; $user['display_name'] = "{$vars['firstname']} {$vars['lastname']}"; $user['first_name'] = $vars['firstname']; $user['last_name'] = $vars['lastname']; if (wp_insert_user ($user)) { return true; } else { return false; } } add_hook("ClientAdd",1,"hook_wordpress_account"); add_hook("ClientEdit",1,"hook_wordpress_account"); function hook_login_wordpress_user($vars) { } add_hook("ClientLogin",1,"hook_login_wordpress_user"); function hook_logout_wordpress_user($vars) { } add_hook("ClientLogout",1,"hook_logout_wordpress_user"); ?> Now when I force wordpress to know it its installed by setting the WP_INSTALLING to true or false I get the following error define( 'WP_INSTALLING', false); Notice: Undefined variable: PHP_SELF in blog/wp-includes/vars.php on line 36 Fatal error: Call to a member function register_handler() on a non-object in blog/wp-includes/media.php on line 1301 Any help ? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.