Example #1
0
 static function addform($parent, $class, $typetd = null)
 {
     $res = domain::getDnsTemplateList($parent);
     $vlist['nname'] = null;
     $vlist['description'] = null;
     $iplist = $parent->getIpaddress(array('localhost'));
     if (!$iplist) {
         $iplist = getAllIpaddress();
     }
     $vlist['ipaddress'] = array('s', $iplist);
     //$vlist['dbtype_list'] = null;
     $vlist['dnstemplate'] = array('s', $res);
     //$vlist['share_status'] = null;
     $vlist['__c_subtitle_quota'] = "Quota";
     $qvlist = getQuotaListForClass('domain', array());
     $vlist = lx_array_merge(array($vlist, $qvlist));
     $vlist['__c_subtitle_mail'] = "Mail";
     $vlist['catchall'] = array('s', array('--bounce--', 'postmaster', 'Delete'));
     $ret['action'] = "add";
     $ret['variable'] = $vlist;
     return $ret;
 }
Example #2
0
 function updateform($subaction, $param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $driverapp = $gbl->getSyncClass(null, $this->__readserver, 'web');
     switch ($subaction) {
         case "run_stats":
             $vlist['confirm_f'] = array('M', "");
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "sesubmit":
             include "sesubmit/engines.php";
             $selist = array_keys($enginelist);
             $selist = implode("\n", $selist);
             $selist = "\n{$selist}";
             $vlist['nname'] = array('M', $this->nname);
             $vlist['email'] = null;
             $vlist['selist'] = array('M', $selist);
             return $vlist;
         case "docroot":
             $vlist['docroot'] = null;
             return $vlist;
         case "blockip":
             $vlist['text_blockip'] = null;
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "fcgi_config":
             $vlist['fcgi_children'] = null;
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "statsconfig":
             $vlist['remove_processed_stats'] = null;
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "hotlink_protection":
             $vlist['hotlink_flag'] = null;
             $vlist['text_hotlink_allowed'] = array("t", null);
             $vlist['hotlink_redirect'] = array("L", "/");
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "permalink":
             $list = lscandir_without_dot_or_underscore("../file/prettyurl/");
             $vlist['lighty_pretty_app_f'] = array('s', $list);
             $vlist['lighty_pretty_path_f'] = null;
             return $vlist;
         case "lighty_rewrite":
             $vlist['text_lighty_rewrite'] = null;
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "stats_protect":
             if ($this->stats_username === $this->nname) {
                 $vlist['stats_username'] = array('M', $this->stats_username);
             } else {
                 $vlist['stats_username'] = null;
             }
             $vlist['stats_password'] = null;
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "cron_mailto":
             $vlist['cron_mailto'] = null;
             return $vlist;
         case "configure_misc":
             $vlist['force_www_redirect'] = null;
             if ($driverapp === 'apache') {
                 $vlist['webmisc_b-execcgi'] = null;
                 if ($login->isAdmin()) {
                     $vlist['webmisc_b-disable_openbasedir'] = null;
                 }
             }
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "dirindex":
             $vlist['webmisc_b-dirindex'] = null;
             if (!$this->indexfile_list) {
                 //$this->indexfile_list = get_web_index_list();
             }
             $ol = array("index.php", "index.html", "index.shtml", "index.htm", "default.htm", "Default.aspx", "Default.asp", "index.pl");
             $dirin = $login->getObject('genlist')->dirindexlist_a;
             $list = get_namelist_from_objectlist($dirin);
             $index = lx_array_merge(array($list, $ol));
             $vlist['indexfile_list'] = array('U', $index);
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "extra_tag":
             $vlist['text_extra_tag'] = null;
             return $vlist;
         case "custom_error":
             if ($driverapp !== 'lighttpd') {
                 $vlist['customerror_b_s_url_400'] = array("L", "/");
                 $vlist['customerror_b_s_url_401'] = array("L", "/");
                 $vlist['customerror_b_s_url_403'] = array("L", "/");
                 $vlist['customerror_b_s_url_500'] = array("L", "/");
             }
             $vlist['customerror_b_s_url_404'] = array("L", "/");
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "ssl_upload":
             $vlist['ssl_key_file_f'] = null;
             $vlist['ssl_crt_file_f'] = null;
             return $vlist;
         case "ipaddress":
             if ($this->getParentO()->isLogin()) {
                 $vlist['ipaddress'] = array('M', $this->ipaddress);
                 return $vlist;
             }
             //Just parent is domain.. The client is above that...
             $parent = $this->getParentO()->getParentO();
             $iplist = $parent->getIpaddress(array($this->syncserver));
             if (!$iplist) {
                 //dprintr($parent->__parent_o);
                 $iplist = getAllIpaddress();
             }
             $vlist['ipaddress'] = array('s', $iplist);
             return $vlist;
     }
     return parent::updateform($subaction, $param);
 }
Example #3
0
 static function getSelectList($parent, $var)
 {
     global $gbl, $sgbl, $login, $ghtml;
     switch ($var) {
         case "ttype":
             return array("virtual", "forward");
         case "ipaddress":
             return getAllIpaddress();
     }
 }
Example #4
0
 function updateform($subaction, $param)
 {
     switch ($subaction) {
         // For template Only... For domain, the ip address is kept in web.
         case "preview_config":
             $vlist['previewdomain'] = null;
             return $vlist;
         case "fix_openbasedir":
             $vlist['remove_openbasedir'] = null;
             return $vlist;
         case "catchall":
             $name[] = "--bounce--";
             $name[] = "postmaster";
             $name[] = "Delete";
             $vlist['catchall'] = array('s', $name);
             return $vlist;
         case "redirect_domain":
             $vlist['redirect_domain'] = array('M', $this->getObject('web')->redirect_domain);
             //$vlist['web_s_syncserver'] = array('M', $this->getObject('web')->syncserver);
             //$vlist['mmail_s_syncserver'] = array('M', $this->getObject('mmail')->syncserver);
             //$vlist['dns_s_syncserver'] = array('M', $this->getObject('dns')->syncserver);
             $mmail = $this->getObject('mmail');
             if ($mmail->ttype !== 'forward') {
                 $this->syncserver = $this->getParentO()->getFromList('domain', $this->getObject('web')->redirect_domain)->getObject('mmail')->syncserver;
                 $mmail->ttype = 'forward';
                 $mmail->redirect_domain = $this->getObject('web')->redirect_domain;
             }
             $vlist['__v_button'] = array();
             return $vlist;
         case "ipaddress":
             if (!$this->isRightParent()) {
                 $vlist['ipaddress'] = array('M', $this->ipaddress_sing);
                 return $vlist;
             }
             $iplist = $this->getParentO()->getIpaddress(array('localhost'));
             if (!$iplist) {
                 $iplist = getAllIpaddress();
             }
             $vlist['ipaddress'] = array('s', $iplist);
             return $vlist;
             //ONly for Template...
         //ONly for Template...
         case "description":
             $vlist['description'] = null;
             //$vlist['share_status'] = null;
             if (!$this->isRightParent()) {
                 $this->convertToUnmodifiable($vlist);
             }
             return $vlist;
         case "dnstemplate":
             $res = DomainBase::getDnsTemplateList($this->getParentO());
             $vlist['dnstemplate'] = array('s', $res);
             return $vlist;
         case "information":
             $web = $this->getObject('web');
             $mmail = $this->getObject('mmail');
             $dns = $this->getObject('dns');
             $vlist['nname'] = array('M', $this->nname);
             $vlist['uuser_dummy'] = array('M', $web->ftpusername);
             $vlist['ddate'] = array('M', @date('d-m-Y', $this->ddate));
             $vlist['parent_name_f'] = array('M', $this->getParentName());
             $webserv = " (ftp.{$this->nname})";
             $mailserv = " (mail.{$this->nname})";
             $vlist['web_s_syncserver'] = array('M', $webserv);
             if ($web->iisid) {
                 $vlist['web_s_iisid'] = array('M', $web->iisid);
             }
             $vlist['mmail_s_syncserver'] = array('M', $mailserv);
             //$vlist['dns_s_syncserver'] = array('M', $dns->syncserver);
             //$vlist['dbtype_list'] = array('M', $this->listpriv->dbtype_list);
             //$vlist['contactemail'] = "";
             if (!$this->isLogin()) {
                 $vlist['text_comment'] = null;
             }
             return $vlist;
             // Only for template...
         // Only for template...
         case "pserver_s":
             $parent = $this->getParentO();
             $vlist['webpserver_sing'] = null;
             $vlist['mmailpserver_sing'] = null;
             $vlist['dnspserver_sing'] = null;
             $vlist['secdnspserver_sing'] = array('Q', add_disabled($parent->listpriv->secdnspserver_list));
             if (!$this->isRightParent()) {
                 $this->convertToUnmodifiable($vlist);
             }
             return $vlist;
     }
     return parent::updateform($subaction, $param);
 }