本文整理汇总了PHP中if_demo函数的典型用法代码示例。如果您正苦于以下问题:PHP if_demo函数的具体用法?PHP if_demo怎么用?PHP if_demo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了if_demo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createShowAlist
function createShowAlist(&$alist, $subaction = null)
{
global $gbl, $sgbl, $login, $ghtml;
return $alist;
if (checkIfLatest() && !if_demo()) {
return null;
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:lxupdatelib.php
示例2: isSelect
function isSelect()
{
if (if_demo()) {
if (array_search_bool($this->nname, array('wholesale', 'reseller', 'customer'))) {
return false;
}
}
return true;
}
开发者ID:zseand,项目名称:kloxo,代码行数:9,代码来源:clientbaselib.php
示例3: execCommand
static function execCommand($iid, $command)
{
if (if_demo()) {
throw new lxException("not_allowed_in_demo");
}
global $global_shell_error, $global_shell_ret;
$global_shell_error = null;
$out = shell_exec("{$command} 2>&1");
return array('output' => $out, 'error' => $global_shell_error);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:pserver__linuxlib.php
示例4: dbactionAdd
function dbactionAdd()
{
global $gbl, $sgbl, $login;
if (if_demo()) {
return;
}
$_filepath = "__path_home_root/lxguard/hostdeny.info";
$result = $this->main->__var_hostlist;
$result = merge_array_object_not_deleted($result, $this->main);
$list = get_namelist_from_arraylist($result, 'hostname', 'hostname');
dprintr($list);
lfile_put_serialize($_filepath, $list);
lxshell_return("__path_php_path", "../bin/common/lxguard.php");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:hostdeny__linuxlib.php
示例5: dosyncToSystem
function dosyncToSystem()
{
global $gbl, $sgbl, $login;
if (if_demo()) {
return;
}
$_filepath = "__path_real_etc_root/hosts.deny";
$string = null;
foreach ((array) $this->main->__var_hostlist as $v) {
$string .= "ALL: {$v['hostname']}\n";
}
if ($this->isDeleted() != "delete") {
$string .= "ALL: {$this->main->hostname}\n";
}
lfile_put_contents($_filepath, $string);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:16,代码来源:hostdeny__windowslib.php
示例6: dbactionUpdate
function dbactionUpdate($subaction)
{
if (if_demo()) {
throw new lxException("demo", $v);
}
if ($this->main->ssh_port && !($this->main->ssh_port > 0)) {
throw new lxException('invalid_ssh_port', 'ssh_port', '');
}
dprint($this->main->ssh_port);
$this->main->ssh_port = trim($this->main->ssh_port);
if (!$this->main->ssh_port) {
$port = "22";
} else {
$port = $this->main->ssh_port;
}
if (lxfile_exists("/etc/fedora-release")) {
$str = lfile_get_contents("../file/template/sshd_config-fedora-2");
} else {
$str = lfile_get_contents("../file/template/sshd_config");
}
$str = str_replace("%ssh_port%", $port, $str);
if ($this->main->isOn('without_password_flag')) {
$wt = 'without-password';
} else {
$wt = 'yes';
}
if ($this->main->isOn('disable_password_flag')) {
$pwa = 'no';
} else {
$pwa = 'yes';
}
$str = str_replace("%permit_root_login%", $wt, $str);
$str = str_replace("%permit_password%", $pwa, $str);
$ret = lfile_put_contents("/etc/ssh/sshd_config", $str);
if (!$ret) {
throw new lxException('could_not_write_config_file', '', '');
}
exec_with_all_closed("/etc/init.d/sshd restart");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:39,代码来源:sshconfig__linuxlib.php
示例7: if_demo_throw_exception
function if_demo_throw_exception($where = null)
{
global $gbl, $sgbl, $login, $ghtml;
if ($sgbl->dbg < 0) {
$where = null;
}
if (if_demo()) {
throw new lxException("{$where} not_allowed_in_demo_version");
}
}
开发者ID:zseand,项目名称:kloxo,代码行数:10,代码来源:lxlib.php
示例8: updateMaintenance
function updateMaintenance($param)
{
if (if_demo()) {
throw new lxException("not_allowed_in_demo");
}
return $param;
}
开发者ID:zseand,项目名称:kloxo,代码行数:7,代码来源:generallib.php
示例9: password_contact_check
function password_contact_check()
{
global $gbl, $sgbl, $login, $ghtml;
if (!$login->isAdmin()) {
return;
}
if (csb($ghtml->frm_action, 'update') && $ghtml->frm_subaction === 'password') {
return;
}
if (if_demo()) {
return;
}
if (check_raw_password('client', 'admin', 'admin')) {
print "<br> <br> <br> ";
if (!isset($ghtml->__http_vars['frm_emessage'])) {
$ghtml->__http_vars['frm_emessage'] = 'security_warning';
}
$ghtml->print_message();
$gbl->frm_ev_list = "old_password_f";
do_updateform($login, 'password');
exit;
}
}
开发者ID:zseand,项目名称:kloxo,代码行数:23,代码来源:coredisplaylib.php
示例10: display
function display($var)
{
global $gbl, $sgbl, $login, $ghtml;
if ($var === "logintime" || $var === "timeout" || $var === 'last_access') {
return " " . lxgettime($this->{$var}) . " ";
}
if ($var === 'current_f') {
if ($gbl->c_session->nname === $this->nname) {
return 'on';
}
return 'dull';
}
if ($var === 'ip_address') {
if (if_demo()) {
return 'Masked in Demo';
}
}
return parent::display($var);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:19,代码来源:ssession.php
示例11: getMysqlDbAdmin
function getMysqlDbAdmin(&$alist)
{
if (!$this->isLocalhost('mysqldbsyncserver')) {
$fqdn = getFQDNforServer($this->mysqldbsyncserver);
//$dbadminUrl = "http://$fqdn:7778/thirdparty/phpMyAdmin/";
if (http_is_self_ssl()) {
$dbadminUrl = "https://{$fqdn}:7777/thirdparty/phpMyAdmin/";
} else {
$dbadminUrl = "http://{$fqdn}:7778/thirdparty/phpMyAdmin/";
}
} else {
$dbadminUrl = "/thirdparty/phpMyAdmin/";
}
try {
$dbad = $this->getPrimaryDb();
if (!$dbad) {
return;
}
$user = $dbad->nname;
$pass = $dbad->dbpassword;
if (if_demo()) {
//$pass = "demopass";
}
$alist[] = create_simpleObject(array('url' => "{$dbadminUrl}?pma_username={$user}&pma_password={$pass}", 'purl' => "c=mysqldb&a=updateform&sa=phpmyadmin", 'target' => "target='_blank'"));
} catch (Exception $e) {
}
}
开发者ID:zseand,项目名称:kloxo,代码行数:27,代码来源:clientlib.php
示例12: create_servername
function create_servername()
{
$pserver = new pserver(null, 'localhost', "localhost");
$pserver->initThisDef();
$pserver->rolelist = array("web", "dns");
if (if_demo()) {
$pserver->realpass = 'admin';
$pserver->password = crypt("admin");
$pserver->cpstatus = 'on';
}
$pserver->dbaction = "add";
$pserver->postAdd();
$pserver->superPostAdd();
$pserver->was();
//dprintr($pserver);
return;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:17,代码来源:initlib.php
示例13: isSelect
function isSelect()
{
if (if_demo()) {
if ($this->nname === 'example.com') {
return false;
}
if ($this->nname === 'customer.com') {
return false;
}
if ($this->nname === 'lxlabs.com') {
return false;
}
if ($this->nname === 'admind.com') {
return false;
}
}
return true;
}
开发者ID:zseand,项目名称:kloxo,代码行数:18,代码来源:domainlib.php
示例14: createShowRlist
function createShowRlist($subaction)
{
//$l = $this->pserverInfo();
global $gbl, $sgbl, $login, $ghtml;
static $rlist;
//print("hello\n");
if ($subaction) {
return null;
}
if ($rlist) {
return $rlist;
}
$master_server = $this->__masterserver;
$slave_server = $this->syncserver;
$driverapp = $gbl->getSyncClass($master_server, $slave_server, 'vps');
if ($this->isXen()) {
if (if_demo()) {
$disk['used'] = '300';
$disk['total'] = '6000';
} else {
// Build the params
$maindisk = $this->getXenMaindiskName();
$is_windows = $this->isWindows();
$root_path = $this->corerootdir;
$parameters = array($maindisk, $is_windows, $root_path);
$disk = rl_exec_get($master_server, $slave_server, array("vps__{$driverapp}", "getDiskUsage"), $parameters);
}
if (!$this->priv->disk_usage) {
$this->priv->disk_usage = $disk['total'];
$this->setUpdateSubaction();
$this->write();
}
$rlist[] = array('disk_usage', "Disk:Disk Usage", $disk['used'], $disk['total']);
$rlist[] = array('realmem_usage', "Mem:Memory Usage", 'NA', $this->priv->realmem_usage);
} else {
$l = rl_exec_get($this->__masterserver, $this->syncserver, array("vps__{$driverapp}", "vpsInfo"), array($this->getIid(), $this->corerootdir));
$rlist[] = array('disk_usage', "Disk:Disk Usage", $l['used_s_disk'], $l['priv_s_disk']);
$rlist[] = array('disk_inode', "Inode:Disk Inodes", $l['used_s_inode'], $l['priv_s_inode']);
/// Rlist takes an array...
$rlist[] = array('memory_usage', "Memory:Memory Usage (MB)", $l['used_s_memory'], $l['priv_s_memory']);
if (isset($l['used_s_swap'])) {
$rlist[] = array('swap_usage', "Swap:Swap Usage (MB)", $l['used_s_swap'], $l['priv_s_swap']);
}
if (isset($l['used_s_virtual'])) {
$rlist[] = array('Virtual Memory', "Virtual Memory Usage (MB)", $l['used_s_virtual'], $l['priv_s_virtual']);
}
}
$rlist['priv'] = null;
if (!$this->isXen()) {
$cpu = $l['cpu'];
foreach ($cpu as $k => $c) {
$rlist[] = array('cpu', "CPU{$k} speed", "{$c['used_s_cpuspeed']}", '-');
//$rlist[] = array('cpu', "CPU$k Speed", $c['used_s_cpuspeed'], '-');
//$rlist[] = array('cpu', "CPU$k Cache", $c['used_s_cpucache'], '-');
}
}
return $rlist;
}
开发者ID:digideskio,项目名称:hypervm,代码行数:58,代码来源:vpslib.php
示例15: display_init
function display_init()
{
global $gbl, $sgbl, $login, $ghtml;
initProgram();
initLanguage();
if ($sgbl->is_this_slave()) {
print "This is a Slave Server. You control it at the Master Server.\n";
exit;
}
// The only thing that gets modified when the dbaction is not a modify action, is the ssession table. Other tables should get modified only inside non-form actions.
if (isModifyAction() && isUpdating()) {
$ghtml->print_redirect_back('system_is_updating_itself', '');
exit;
}
try {
do_display_init();
main_system_lock();
print_navigation($gbl->__navig);
if (if_demo()) {
//$url = $ghtml->get_get_from_current_post(null);
//log_clicks($url);
}
print_warning();
password_contact_check();
} catch (Exception $e) {
log_log("redirect_error", "exception");
$gbl->setSessionV('__tmp_redirect_var', $ghtml->__http_vars);
$gbl->c_session->write();
if (is_array($e->variable)) {
$evlist = implode(",", $e->variable);
} else {
$evlist = $e->variable;
}
$ghtml->print_redirect_back($e->getMessage(), $evlist, $e->value);
exit;
}
//license_check();
if ($ghtml->frm_filter) {
$filtername = $gbl->__c_object->getFilterVariableForThis($ghtml->frm_o_cname);
$list[$filtername] = $ghtml->frm_filter;
$login->setupHpFilter($list);
$login->setUpdateSubaction();
}
if ($ghtml->frm_hpfilter) {
//dprintr($ghtml->frm_hpfilter);
$login->setupHpFilter($ghtml->frm_hpfilter);
$login->setUpdateSubaction();
}
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:49,代码来源:coredisplaylib.php
示例16: checkRestart
function checkRestart()
{
if (if_demo()) {
return;
}
log_log("cron_exec", "Check service restarts...\n");
$res = lscandir_without_dot("__path_program_etc/.restart");
if ($res === false) {
dprint(".restart does not exist... Creating\n");
lxfile_mkdir("__path_program_etc/.restart");
lxfile_generic_chown("__path_program_etc/.restart", "lxlabs");
}
foreach ((array) $res as $r) {
if (csb($r, "._restart_")) {
$cmd = strfrom($r, "._restart_");
}
lunlink("__path_program_etc/.restart/{$r}");
dprint("Restarting {$cmd}\n");
switch ($cmd) {
case 'lxcollectquota':
log_log("cron_exec", "Start collecting Quota's\n");
exec_justdb_collectquota();
break;
case 'openvz_tc':
log_log("cron_exec", "Start openvz_tc script\n");
exec_openvz_tc();
break;
default:
log_log("cron_exec", "Restarting {$cmd}\n");
exec_with_all_closed("/etc/init.d/{$cmd} restart");
break;
}
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:34,代码来源:lxserverlib.php
示例17: updateSwitchHelp
function updateSwitchHelp($param)
{
global $gbl, $sgbl, $login, $ghtml;
if ($gbl->isOn('show_help')) {
$this->getSpecialObject('sp_specialplay')->show_help = 'off';
$gbl->setSessionV('show_help', 'off');
} else {
if (!if_demo()) {
$this->getSpecialObject('sp_specialplay')->show_help = 'on';
}
$gbl->setSessionV('show_help', 'on');
}
$special = $this->sp_specialplay_o;
$special->setUpdateSubaction('switchhelp');
$login->was();
save_login();
$ghtml->print_redirect_left_panel("/htmllib/mibin/lpanel.php");
return null;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:19,代码来源:lxclient.php
示例18: getMysqlDbAdmin
function getMysqlDbAdmin(&$alist)
{
if (!$this->isLocalhost('nname')) {
$fqdn = getFQDNforServer($this->nname);
//$dbadminUrl = "http://$fqdn:7778/thirdparty/phpMyAdmin/";
if (http_is_self_ssl()) {
$dbadminUrl = "https://{$fqdn}:7777/thirdparty/phpMyAdmin/";
} else {
$dbadminUrl = "http://{$fqdn}:7778/thirdparty/phpMyAdmin/";
}
} else {
$dbadminUrl = "/thirdparty/phpMyAdmin/";
}
//$pass = urlencode($pass);
$server = $_SERVER['SERVER_NAME'];
if (csa($server, ":")) {
list($server, $port) = explode(":", $server);
}
try {
$dbad = $this->getFromList('dbadmin', "mysql___{$this->syncserver}");
$user = $dbad->dbadmin_name;
$pass = $dbad->dbpassword;
if (if_demo()) {
$pass = "demopass";
}
$alist[] = create_simpleObject(array('url' => "{$dbadminUrl}?pma_username={$user}&pma_password={$pass}", 'purl' => "c=mysqldb&a=updateform&sa=phpmyadmin", 'target' => "target='_blank'"));
} catch (Exception $e) {
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:29,代码来源:pserverlib.php
示例19: array
/*
* This file is used by the /login/ page.
* Refactoring is needed. Wrong place, wrong name
*/
$accountlist = array('client' => "Kloxo Account", 'domain' => 'Domain Owner', 'mailaccount' => "Mail Account");
$progname = $sgbl->__var_program_name;
$ghtml->print_jscript_source("/htmllib/js/lxa.js");
if ($sgbl->is_this_slave()) {
print "Slave Server\n";
exit;
}
$logfo = db_get_value("general", "admin", "login_pre");
$logfo = str_replace("<%programname%>", $sgbl->__var_program_name, $logfo);
if (!$cgi_forgotpwd) {
$ghtml->print_message();
if (if_demo()) {
include_once "lib/demologins.php";
} else {
?>
<div id="ctr" align="center">
<div class="login">
<div class="login-form">
<div align="center"><font size="5" color="red"><b> Login </b></font></div>
<br />
<form name="loginform" action="/htmllib/phplib/" onsubmit="encode_url(loginform) ; return fieldcheck(this);" method="post">
<div class="form-block">
<div class="inputlabel">Username</div>
<input name="frm_clientname" type="text" class="inputbox" size="30" />
<div class="inputlabel">Password</div>
<input name="frm_password" type="password" class="passbox" size="30" />
开发者ID:soar-team,项目名称:kloxo,代码行数:31,代码来源:indexcontent.php
示例20: postUpdate
function postUpdate()
{
// Hack Hack Hack... Redirecting the whole frame thing after a skin change...
// It is supposed to be handled by the display.php, but since this is a single case, i am doing it here...
global $gbl, $sgbl, $login, $ghtml;
$gbl->setSessionV('show_lpanel', $login->getSpecialObject('sp_specialplay')->show_lpanel);
$gbl->setSessionV('show_help', $login->getSpecialObject('sp_specialplay')->show_help);
if (if_demo()) {
throw new lxexception('not_allowed_in_demo', '');
}
if ($this->subaction === 'skin' && !$this->isClass('sp_childspecialplay')) {
if ($sgbl->dbg < 0 && $this->getParentO()->isLogin()) {
$login->was();
if ($ghtml->frm_consumedlogin !== 'true') {
$ghtml->print_redirect_self("/");
exit;
}
}
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:20,代码来源:appearancelib.php
注:本文中的if_demo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论