hi there,
I tried to make my script to work with no error but it seems it isn't so easy as I thought.
I followed all that was said at Frequently Asked Scripts: "How do I automate XYZ after creating an account?" - cPanel Integration
this is what I got:Code:<?php include('/usr/local/cpanel/base/frontend/x3/cake/xmlapi.php'); ini_set(display_errors,1); // Return the string return $string; } ## $_GET vars //$new_username = mysql_real_escape_string( $_POST['new_user'] ); //$new_dbname = mysql_real_escape_string( $_POST['new_dbname'] ); //$new_dbpass = mysql_real_escape_string( $_POST['new_dbpass'] ); //$new_username = $cp_name.'_'.rand_str($lenght=7, $chars); //$new_dbname = $cp_name.'_'.rand_str($lenght=6, $chars); $new_dbpass = rand_str($lenght=5, $chars); /** * extend the basic xmlapi class * add the method for getting args */ Class cpScriptsXmlApi extends XMLAPI { public $cliargs = array(); ... } //create our xmlapi object and set it's params $xmlapi = new cpScriptsXmlApi($argv,'127.0.0.1'); //your root auth hash $hash = '15b6b89b89d729739'; $xmlapi->set_user('root'); $xmlapi->set_hash($hash); $xmlapi->set_port('2087'); //NOTE: you must have compiled OpenSSL or cURL w/SSL to use secure ports in //generic vars for automation// $dbname = rand_str($lenght=6, $chars); // "new database" $virtusername = rand_str($lenght=7, $chars); // "new user" $privs = array('all'); /* $xmlapi->createUserDb($xmlapi->cliargs['user'], $dbname); $xmlapi->createDbVirtuser($xmlapi->cliargs['user'],$virtusername, $new_dbpass); */ echo $xmlapi->cliargs['user'];
Code:Notice: Undefined variable: argv in /tmp/cpanel_phpengine.1299686646.31775Zw1Yt16JVc on line 151 Warning: array_shift() [function.array-shift]: The argument should be an array in /tmp/cpanel_phpengine.1299686646.31775Zw1Yt16JVc on line 100 Notice: Undefined index: user in /tmp/cpanel_phpengine.1299686646.31775Zw1Yt16JVc on line 167
thx



LinkBack URL
About LinkBacks
Reply With Quote




