Example #1
0
File: api2.php Project: jprice/EHCP
<?
# ehcp.net: example, add ftp, paneluser and domain all in one
# Easy Hosting Control Panel (ehcp)

require("../classapp.php");
$domainname = "d2omainsite.com";
$panelusername = "******";
$ftppassword=$paneluserpass="******";
$ftpusername = "******";
$status="active";

$app = new Application();
$app->connectTodb(); # fill config.php with db user/pass for things to work..
$app->activeuser=$panelusername;

$ret=$app->addDomainDirect($domainname,$panelusername,$paneluserpass,$ftpusername,$ftppassword,$status,$email='',$quota=0);

if($ret){
    echo "Success";
} else {
    echo $app->output;
} 

echo "($ret)";

?>
<?php

$curDir = getcwd();
if (chdir("/var/www/new/ehcp/")) {
    require "classapp.php";
    $app = new Application();
    $app->connectTodb();
    # fill config.php with db user/pass for things to work..
    $app->addDaemonOp('syncftp', '', '', '', 'sync ftp for nonstandard homes');
}
chdir($curDir);