static function parseDir(&$ret, $maildir) { $list = lscandir_without_dot_or_underscore($maildir); foreach ($list as $l) { $ret[] = self::mail_parse("{$maildir}/{$l}"); } }
function change_lxadmin_to_kloxo_directory($dir) { if (!lxfile_exists($dir)) { return; } $list = lscandir_without_dot_or_underscore($dir); foreach ($list as $l) { change_lxadmin_to_kloxo("{$dir}/{$l}"); } }
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); }
function importVps() { global $gbl, $sgbl, $login, $ghtml; $objlist = null; if ($this->main->__var_vps_driver === 'openvz') { if (!lxfile_exists("/etc/vz/conf")) { throw new lxException("no_vz_conf_directory", ''); } $list = lscandir_without_dot_or_underscore("/etc/vz/conf"); foreach ($list as $l) { if (!cse($l, ".conf")) { continue; } if ($l === '0.conf') { continue; } $object = vps__openvz::createVpsObject($this->main->nname, $l); $objlist[$object->nname] = $object; } } else { lxshell_return("chkconfig", "xendomains", "on"); //lxshell_return("service", "xendomains", "restart"); $imdriver = $this->main->__var_xenimportdriver; $importdriverfile = "{$sgbl->__path_program_htmlbase}/lib/xenimport/xenimport__{$imdriver}.php"; if (!lxfile_exists($importdriverfile)) { throw new lxException("could_not_find_xen_import_driver_file", ''); } include_once $importdriverfile; if (!function_exists("__xenimport_get_data")) { throw new lxException("no_xenimport_function", ''); } $data = __xenimport_get_data(); foreach ((array) $data as $input) { $object = vps__xen::createVpsObject($this->main->nname, $input); $objlist[$object->nname] = $object; } } return $objlist; }
function check_login_success($cgi_classname, $cgi_clientname, $cgi_password, $cgi_key) { global $gbl, $sgbl, $login, $ghtml; if ($cgi_password) { if (check_raw_password($cgi_classname, $cgi_clientname, $cgi_password)) { return true; } else { log_log("error", "Failed Login attempt to {$cgi_clientname} from " . $_SERVER['REMOTE_ADDR']); $ghtml->print_redirect("/login/?frm_emessage=login_error"); return false; } } return false; if ($cgi_key) { $list = lscandir_without_dot_or_underscore("../etc/publickey"); openssl_private_encrypt("string", $encstring, $cgi_key); foreach ($list as $k) { $publickey = lfile_get_contents("../etc/publickey/{$k}"); openssl_public_decrypt($encstring, $rstring, $publickey); if ($rstring === 'string') { return true; } } $ghtml->print_redirect("/login/?frm_emessage=login_error_key"); return false; } return false; }
function do_backup() { global $gbl, $sgbl, $login, $ghtml; $name = $this->main->getPathFromName('nname'); $fullpath = "{$sgbl->__path_customer_root}/{$name}/"; lxfile_mkdir($fullpath); $list = lscandir_without_dot_or_underscore($fullpath); return array($fullpath, $list); }
<?php include_once "htmllib/lib/include.php"; $list = lscandir_without_dot_or_underscore("/home/kloxo/httpd/ssl/"); foreach ($list as $l) { if (cse($l, ".crt")) { $newlist[] = basename($l, ".crt"); } else { continue; } } foreach ($newlist as $n) { lxfile_cp("/usr/local/lxlabs/kloxo/file/program.crt", "/home/kloxo/httpd/ssl/{$n}.crt"); lxfile_cp("/usr/local/lxlabs/kloxo/file/program.key", "/home/kloxo/httpd/ssl/{$n}.key"); // lxfile_cp("/usr/local/lxlabs/lxadmin/httpdocs/htmllib/filecore/program.ca", "/home/kloxo/httpd/ssl/$n.ca"); lxfile_cp("/usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/program.ca", "/home/kloxo/httpd/ssl/{$n}.ca"); }
static function getWebmailProgList() { $plist = lscandir_without_dot_or_underscore("__path_kloxo_httpd_root/webmail"); foreach ($plist as $k => $v) { if ($v === 'img') { unset($plist[$k]); } if ($v === 'images') { unset($plist[$k]); } if ($v === 'disabled') { unset($plist[$k]); } if (!lis_dir("__path_kloxo_httpd_root/webmail/{$v}")) { unset($plist[$k]); } } return $plist; }