Example #1
0
function add_admin($pass)
{
    global $gbl, $sgbl, $login, $ghtml;
    $client = new Client(null, null, 'admin');
    $login = $client;
    $client->initThisDef();
    $client->priv->pserver_num = 'Unlimited';
    $client->priv->maindomain_num = 'Unlimited';
    $client->priv->vps_num = 'Unlimited';
    $client->priv->client_num = 'Unlimited';
    $client->ddate = time();
    $ddb = new Sqlite(null, "client");
    if (!$ddb->existInTable("nname", 'admin')) {
        if ($sgbl->dbg > 0) {
            $pass = '******';
            $res['contacemail'] = '*****@*****.**';
        }
        $res['password'] = crypt($pass);
        $res['cttype'] = 'admin';
        $res['cpstatus'] = 'on';
        if (if_demo()) {
            $res['email'] = "*****@*****.**";
        }
        $client->create($res);
        $client->driverApp = new client__sync(null, null, 'admin');
        $client->was();
        lxfile_mkdir("__path_client_root/{$client->nname}");
        lxfile_generic_chown("__path_client_root/{$client->nname}", "lxlabs");
    }
    $notif = new Notification(null, null, $client->getClName());
    $notif->initThisDef();
    $notif->dbaction = 'add';
    $notif->text_newaccountmessage = lfile_get_contents("__path_program_root/file/welcome.txt");
    $notif->parent_clname = $client->getClName();
    $notif->write();
    $display = new sp_SpecialPlay(null, null, $client->getClName());
    $display->initThisDef();
    $display->parent_clname = $client->getClName();
    $display->dbaction = 'add';
    $display->write();
}
Example #2
0
function add_customer_reseller()
{
    global $gbl, $login, $ghtml;
    $M[] = array("admin" => array("master", "adelia"), "adelle" => array("agnes", "aileen", "ainsley"), "aileen" => array("ainslie", "aislin", "alaina"), "adolph" => array("walta", "walter", "wanda"), "aislin" => array("waneta", "ward"), "waneta" => array("wardah", "warner"), "wardah" => array("warren", "warrick"), "warren" => array("warwick", "wasaki"), "warwick" => array("waseemah", "washi"), "waseemah" => array("washington", "watson"), "watson" => array("adeline", "aggie", "wattan"), "wattan" => array("wayde", "wayland"), "wayde" => array("waylon"), "washi" => array("wayne"), "waylon" => array("webster", "wednesday"));
    $W[] = array("alaina" => array("wholesale", "arding", "hardwin", "hardy"), "alina" => array("harford", "hargrove"), "wayne" => array("harkin", "harlan", "harley", "harmon", "gatha"), "master" => array("harold", "harper"), "washi" => array("harrison", "harry"), "adelle" => array("hartford"));
    $R[] = array("admin" => array("reseller"), "hardy" => array("peter", "paddy", "parker", "patrick"), "hartford" => array("pelham", "percival"), "gatha" => array("philemon", "philip"), "wholesale " => array("philo", "phineas", "piers"), "harley" => array("preston", "prince"), "webster" => array("wells", "wenda", "wendell"));
    $C[] = array("admin" => array("customer", "generic customer", "simplehosting", "sample customer", "ondemand"), "master" => array("shelby"), "patrick" => array("kerry", "shelagh"), "aislin" => array("johny", "ercood"), "adrian" => array("sheldon", "shell"), "agnes" => array("shelley"), "harry" => array("shelly", "shelton"), "reseller" => array("sheree", "sheryl"), "philip" => array("shevaun", "shevon", "shiloh"), "prince" => array("shirlee", "shirley", "shonda", "shyla"), "wayde" => array("percy"), "wardah" => array("peregrin", "peyton"), "harper" => array("sibill"), "wells" => array("sibyl"), "washington" => array("wauna"), "ainslie" => array("waverly"));
    $type['M'] = 'master';
    $type['W'] = 'wholesale';
    $type['R'] = 'reseller';
    $type['C'] = 'customer';
    $a = array("M", "W", "R", "C");
    foreach ($a as $key => $val) {
        foreach (${$val} as $key1 => $val1) {
            foreach ($val1 as $key2 => $val2) {
                foreach ($val2 as $val3) {
                    $name = $val3;
                    $parent_name = $key2;
                    $client = new Client(null, null, $name);
                    $client->initThisDef();
                    client_priv($client->priv, 1);
                    $res['password'] = crypt('admin');
                    $res['email'] = $name . "@lxcenter.net";
                    $res['status'] = "on";
                    $res['cpstatus'] = "on";
                    $res['cttype'] = $type[$val];
                    $res['parent_clname'] = "client-{$parent_name}";
                    $client->create($res);
                    if ($val == 'C') {
                        unset($client->priv->client_num);
                        unset($client->used->client_num);
                    }
                    $login->addToList("client", $client);
                }
            }
        }
    }
}