function dbactionDelete() { $newFtpServer = new lxCOM("IIsFtpServer", $this->main->nname); $RootDir = $newFtpServer->a("IIsFtpVirtualDir", "ROOT"); if ($RootDir) { $VirtualDir = $RootDir->Delete("IIsFtpVirtualDir", $this->main->directory); } }
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"); } }
function frontPagePassword() { $fpextpath = "C:/Program Files/Common Files/Microsoft Shared/web server extensions/50/bin/owsadm. exe"; $iis = new lxCOM("IIS://localhost/W3SVC/{$this->main->iisid}"); $password = $this->main->__var_sysuserpassword['realpass'] ? $this->main->__var_sysuserpassword['realpass'] : '******'; $params = " -o users -u " . $this->main->changepassword . " -u " . $this->main->username . " -p 80 "; //owsadm -o users -c <add/del/changepassword> -u <username> [-p <port>] $command = $fpextpath . $params; $whs = new lxCOM("WScript.Shell"); try { $whsRun = $whs->Run($command, 0, True); print " ExtendFrontPage PASSWORD Successed"; } catch (exception $e) { print " ExtendFrontPage PASSWORD NOT Successed"; } }
function delMxRecord($strDomain, $mxpref) { $objWMIService = new lxCOM("winmgmts://./root/MicrosoftDNS"); $colItems = $objWMIService->ExecQuery("Select * from MicrosoftDNS_MXType where domainname='{$strDomain}' and preference='{$mxpref}'"); foreach ($colItems as $objItem) { /* print("$objItem->OwnerName"."\n"); print("$objItem->ContainerName"."\n"); print("$objItem->DnsserverName"."\n"); print("$objItem->DomainName"."\n"); print("$objItem->MFhost"."\n"); print("$objItem->RecordData"."\n"); print("$objItem->RecordClass"."\n"); print("$objItem->TextRepresentation"."\n"); print("$objItem->Timestamp"."\n"); */ $objItem->delete_(); } }