Esempio n. 1
0
function os_addto_iis()
{
    global $gbl, $sgbl, $login, $ghtml;
    $progname = $sgbl->__var_program_name;
    $obj = new lxCOM("winmgmts://./root/WebAdministration");
    $iiso = $obj->com_get("Site.Name='{$progname}'");
    try {
        $obj->Get("ApplicationPool")->Create("kloxo");
    } catch (exception $e) {
    }
    $uobj = new lxCOM("WinNT://.");
    try {
        $user = new lxCOM("WinNT://./lxlabs");
    } catch (exception $e) {
        $user = $uobj->create("user", "lxlabs");
    }
    $user->setPassword("hellfire");
    $user->setInfo();
    $app = $obj->com_get("ApplicationPool.Name='kloxo'");
    $app->object_set("ProcessModel", "IdentityType", 3);
    $app->object_set("ProcessModel", "UserName", "lxlabs");
    $app->object_set("ProcessModel", "Password", "hellfire");
    $app->Put_();
    if ($iiso->__notreal) {
        $iisdfn = $obj->get("Site");
        $homedir = convertTobackSlash($sgbl->__path_program_htmlbase);
        $oBinding = $obj->get("BindingElement")->SpawnInstance_();
        $oBinding->BindingInformation = "*:7778:";
        $oBinding->Protocol = "http";
        $sBinding = $obj->get("BindingElement")->SpawnInstance_();
        $sBinding->BindingInformation = "*:7777:";
        $sBinding->Protocol = "https";
        $iisdfn->Create($progname, array($oBinding, $sBinding), $homedir);
        $iiso = $obj->com_get("Site.Name='{$progname}'");
    }
    $iiso->object_set("ApplicationDefaults", "ApplicationPool", "kloxo");
    $iiso->Put_();
    $exec = "c:/Program Files/lxlabs/ext/php/php.exe";
    $exec = convertTobackSlash($exec);
    $oHandler = $obj->Get("HandlerAction")->SpawnInstance_();
    $oHandler->Name = "php";
    $oHandler->Path = "*.php";
    $oHandler->Verb = "GET,HEAD,POST,DEBUG";
    $oHandler->ScriptProcessor = "\"{$exec}\"";
    $oHandler->ResourceType = 0;
    $oHandler->Modules = "CgiModule";
    $oHandler->PreCondition = "*";
    $handle = $iiso->lxcom_getSection("HandlersSection");
    $handle->Add("Handlers", $oHandler);
    $handle->Refresh_();
    //$newmap = lx_array_merge(array($ScriptMaps, $list));
    dprint("\n");
    foreach ($handle->Handlers as $h) {
        dprint("{$h->Name} {$h->Path} {$h->PreCondition} {$h->Verb} {$h->Modules} type: {$h->Type} rtype: {$h->ResourceType} \n");
    }
}
Esempio n. 2
0
 function AddRedirect()
 {
     $vlist = $this->main->__t_new_redirect_a_list;
     foreach ($vlist as $v) {
         $id = $this->main->iisid;
         $v->nname;
         $v->redirect;
         dprint_r($v->nname);
         $siteVRootDir = new lxCOM("IIS://localhost/w3svc/{$id}/Root");
         $vdir = $siteVRootDir->create("IIsWebVirtualDir", $v->nname);
         $vdir->AppIsolated = array(2);
         $vdir->Path = array("{$homedir}/{$v->nname}");
         $vdir->AccessFlags = array(513);
         $vdir->FrontPageWeb = array(1);
         $vdir->AppRoot = array("/LM/W3SVC/{$id}/Root/{$v->nname}");
         $vdir->AppFriendlyName = array("Script");
         $vdir->Put("HttpRedirect", $v->redirect);
         $vdir->SetInfo();
     }
     /*	$v = $this->main->__t_new_redirect_a;
     			$id = $this->main->iisid;
     			$v->nname;
     			$v->redirect;
     			dprint_r($v->nname);
     			$siteVRootDir = new COM("IIS://localhost/w3svc/$id/Root");
     			$vdir = $siteVRootDir->create("IIsWebVirtualDir", $v->nname);
     			$vdir->AppIsolated = array(2);
     			$vdir->Path = array("$homedir/$v->nname");
     			$vdir->AccessFlags = array(513);
     			$vdir->FrontPageWeb = array(1);
     			$vdir->AppRoot = array("/LM/W3SVC/$id/Root/{$v->nname}");
     			$vdir->AppFriendlyName = array("Script");
     			$vdir->Put("HttpRedirect", $v->redirect);
     			$vdir->SetInfo();
     
     			/*	$providerObj = new COM("winmgmts://MyServer/root/MicrosoftIISv2"); 
     			$IIsWebVirtualDirObj =$providerObj->get("IIsWebVirtualD	irSetting='W3SVC/1/Root/Scripts'"); */
 }