نویسنده موضوع: عملیات مدیریت اکانت های سی پنل با PHP  (دفعات بازدید: 697 بار)

0 کاربر و 1 مهمان درحال دیدن موضوع.

آفلاین zarif

  • Administrator
  • *****
  • ارسال: 275
    • خدمات میزبانی مشهد هاست
عملیات مدیریت اکانت های سی پنل با PHP
« در: دسامبر 19, 2009, 05:23:26 »
ما می توانیم در نرم افزارهای صورتحساب ، خرید هاست و ... با زبان PHP ، اکانت سی پنل به روش زیر بسازیم .
تغییرات رمز و کلیه عملیات را می توان انجام داد که در مثل زیر آمده است :

<?php 
// start the session and pass the Session parameter
session_start(); 
header("Cache-control: private"); //IE 6 Fix

######### Set up basic variables #########
$serverIPaddress="192.168.1.1:2087";
$whmusername="root";
$whmpassword="123456";
$server="https://$whmusername:$whmpassword@$serverIPaddress";

//set the username of the account you are working with
$user "bobby12";
$agent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";



######### Here are few example of many of the items that you could do with curl.  It will not execute until the very bottom #########

//change user's password
$url="$server/scripts/passwd?password=$passwd&domain=$user&user=$user";

//enable shell access
$url="$server/scripts2/domanageshells?user=$user&shell=Enable+Jailed+Shell&user=$user";

//bandlimit increase
$url="$server/scripts2/dolimitbw?user=$user&bwlimit=$bndwidth";

//suspend an account
$url="$server/scripts2/suspendacct?domain=$user&user=$user&suspend-domain=Suspend&reason=";

//UN-suspend an account
$url="$server/scripts2/suspendacct?domain=$user&user=$user&unsuspend-domain=UnSuspend&reason=";

//add front page extensions
$url="$server/scripts/installfp?domain=$user&user=$user&submit-domain=Install";

//remove front page extensions
$url="$server/scripts/uninstallfp?domain=$user&user=$user&submit-domain=UnInstall";

//modify the quota on the account
$url="$server/scripts/editquota?user=$user&quota=$quota";

//add a domain pointer
$url="$server/scripts/park?txtdomain=&domain=$domain&ndomain=$NewDomain";

//modify the account
$url="$server/scripts/saveedituser?user=$user&BWLIMIT";
$url.="=$BWLIMIT&FEATURELIST=$FEATURELIST&IP=$IP&OWNER";
$url.="=$OWNER&PLAN=$PLAN&STARTDATE=$STARTDATE&DNS=$domain";
$url.="&RS=$RS&LANG=english&newuser=$user&seeshell=$shell&MAXPOP";
$url.="=$MAXPOP&MAXFTP=$MAXFTP&MAXLST=$MAXLST&MAXSUB=$MAXSUB&MAXSQL";
$url.="=$MAXSQL&MAXPARK=$MAXPARK&MAXADDON=$MAXADDON";

//generate a csr
 //need to replace spaces in all of the variables with the '+' sign
$host str_replace(" ","+",$host);
$country str_replace(" ","+",$country);
$state str_replace(" ","+",$state);
$city str_replace(" ","+",$city);
$cod str_replace(" ","+",$cod);
$co str_replace(" ","+",$co);
$email str_replace(" ","+",$email);
$pass str_replace(" ","+",$pass);
$url="$server/scripts/gencrt?xemail=$xemail&host=$host&country";
$url.="=$country&state=$state&city=$city&co=$co&cod=$cod&email=$email&pass=$pass";

######### execute curl #########

$ch=curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
curl_setopt($chCURLOPT_COOKIEJAR'cookie.txt');
curl_setopt($chCURLOPT_COOKIEFILE'cookie.txt');
curl_setopt($chCURLOPT_MAXREDIRS4);
curl_setopt($chCURLOPT_FOLLOWLOCATION,1);
curl_setopt($chCURLOPT_TIMEOUT120);
curl_setopt($chCURLOPT_USERAGENT$agent);
curl_setopt($chCURLOPT_RETURNTRANSFER0);
$buffer curl_exec($ch);
curl_close($ch);

?>
مشتریان عزیز لطف کنند  سرویسی که از ما خریداری نموده اند به همراه مشخصات خود به من پیغام خصوصی بدهند تا دسترسی ویژه در انجمن بهشان داده شود .