本文整理汇总了PHP中if_demo函数的典型用法代码示例。如果您正苦于以下问题:PHP if_demo函数的具体用法?PHP if_demo怎么用?PHP if_demo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了if_demo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createShowAlist
function createShowAlist(&$alist, $subaction = null)
{
global $gbl, $sgbl, $login, $ghtml;
return $alist;
if (checkIfLatest() && !if_demo()) {
return null;
}
}
示例2: isSelect
function isSelect()
{
if (if_demo()) {
if (array_search_bool($this->nname, array('wholesale', 'reseller', 'customer'))) {
return false;
}
}
return true;
}
示例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);
}
示例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");
}
示例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);
}
示例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");
}
示例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");
}
}
示例8: updateMaintenance
function updateMaintenance($param)
{
if (if_demo()) {
throw new lxException("not_allowed_in_demo");
}
return $param;
}
示例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;
}
}
示例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);
}
示例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) {
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}