当前位置: 首页>>代码示例>>PHP>>正文


PHP isOn函数代码示例

本文整理汇总了PHP中isOn函数的典型用法代码示例。如果您正苦于以下问题:PHP isOn函数的具体用法?PHP isOn怎么用?PHP isOn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了isOn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 static function add($parent, $class, $param)
 {
     if (isset($param['external']) && isOn($param['external'])) {
         $param['nname'] = base64_encode($param['nname']);
     }
     return $param;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:7,代码来源:olddskshortcut.php

示例2: getweb_usage

 static function getweb_usage($name, $customer_name, $oldtime, $newtime, $d)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $web_home = "{$sgbl->__path_httpd_root}";
     $log_path = "{$web_home}/{$name}/stats";
     $processedir = "{$sgbl->__path_customer_root}/{$customer_name}/__processed_stats/";
     lxfile_mkdir($processedir);
     $dir1 = "{$log_path}/";
     $files = lscandir_without_dot($dir1);
     $total = 0;
     foreach ($files as $file) {
         if (!strstr($file, "gz")) {
             $total += self::getEachwebfilequota("{$dir1}/{$file}", $oldtime, $newtime);
             $stat = stat("{$dir1}/{$file}");
             if ($stat['size'] >= 50 * 1024 * 1024) {
                 if (isOn($d->remove_processed_stats)) {
                     lxfile_rm("{$dir1}/{$file}");
                 } else {
                     lxfile_mv("{$dir1}/{$file}", getNotexistingFile($processedir, $file));
                 }
             }
         }
     }
     return $total;
 }
开发者ID:zseand,项目名称:kloxo,代码行数:25,代码来源:webtrafficlib.php

示例3: add

 static function add($parent, $class, $param)
 {
     if ($param['ttype'] === 'separator') {
         $sq = new Sqlite(null, 'ndskshortcut');
         $separatorid = getIncrementedValueFromTable('ndskshortcut', 'separatorid');
         $param['separatorid'] = $separatorid;
         $param['nname'] = "{$separatorid}___{$parent->getClName()}";
         return $param;
     }
     if (isset($param['external']) && isOn($param['external'])) {
         $param['url'] = base64_encode($param['url']);
     }
     $param['nname'] = "{$param['url']}___{$parent->getClName()}";
     return $param;
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:15,代码来源:dskfavorite.php

示例4: add

 static function add($parent, $class, $param)
 {
     if ($param['ttype'] === 'separator') {
         $sq = new Sqlite(null, 'ndskshortcut');
         $separatorid = getIncrementedValueFromTable('ndskshortcut', 'separatorid');
         $param['separatorid'] = $separatorid;
         $param['nname'] = "{$separatorid}___{$parent->getClName()}";
         return $param;
     }
     $url = base64_decode($param['url']);
     if (isset($param['external']) && isOn($param['external'])) {
         $url = $param['url'];
         $param['url'] = base64_encode($param['url']);
     }
     if (trim($url) == '' || !isset($url)) {
         throw new lxexception('url_is_not_defined', 'nname');
     }
     $param['nname'] = "{$param['url']}___{$parent->getClName()}";
     return $param;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:20,代码来源:dskfavorite.php

示例5: object_variable_quota

 function object_variable_quota($parent, $stuff, $variable)
 {
     global $gbl, $sgbl, $ghtml;
     $parent = $parent->getClientParentO();
     $value = null;
     $this->fix_stuff_or_class($stuff, $variable, $class, $value);
     $descr = $this->get_classvar_description_after_overload($class, $variable);
     $cvar = $variable;
     if ($value === 'Unlimited') {
         $value = null;
     }
     $check = trim($value) !== "" ? 'no' : 'yes';
     if (is_object($stuff)) {
         if (isOn($value)) {
             $chval = 'yes';
         } else {
             $chval = 'no';
         }
     } else {
         $cl = get_name_without_template($stuff);
         if (isOn(exec_class_method($cl, "getDefaultValue", $variable))) {
             $chval = 'yes';
         } else {
             $chval = "no";
         }
     }
     if (cse($variable, "_flag")) {
         $rvr = new FormVar();
         $rvr->name = "frm_{$class}_c_priv_s_{$variable}_aaa_checkname";
         $rvr->desc = $descr[2];
         $rvr->type = "hidden";
         $rvr->value = "off";
         $ret[] = $rvr;
         if ($parent->priv->isOn($variable)) {
             $rvr = new FormVar();
             $rvr->name = "frm_{$class}_c_priv_s_{$variable}_aaa_checked";
             $rvr->desc = $descr[2];
             $rvr->type = "checkbox";
             $rvr->checked = $chval;
             $rvr->value = "on";
             $ret[] = $rvr;
         } else {
             $rvr = new FormVar();
             $rvr->name = "frm_{$class}_c_priv_s_{$variable}_aaa_checked";
             $rvr->desc = $descr[2];
             $rvr->type = "checkbox";
             $rvr->checked = "disabled";
             $rvr->value = "off";
             $ret[] = $rvr;
         }
         return $ret;
     }
     if (is_unlimited($parent->priv->{$cvar})) {
         $rvr = new FormVar();
         $rvr->name = "frm_{$class}_c_{$variable}";
         $rvr->type = "checkboxwithtext";
         $rvr->desc = $descr[2];
         $rvr->mode = "or";
         $text = new FormVar();
         $text->name = "frm_{$class}_c_priv_s_{$variable}_aaa_quotaname";
         $text->value = $value;
         $rvr->text = $text;
         $checkbox = new FormVar();
         $checkbox->desc = "Unlimited";
         $checkbox->name = "frm_{$class}_c_priv_s_{$variable}_aaa_unlimited";
         $checkbox->checked = $check;
         $checkbox->value = "yes";
         $rvr->checkbox = $checkbox;
         $ret[] = $rvr;
         $rvr = new FormVar();
         $rvr->type = "hidden";
         $rvr->value = "Unlimited";
         $rvr->name = "frm_{$class}_c_priv_s_{$variable}_aaa_quotamax";
         $ret[] = $rvr;
     } else {
         $quotaleft = $parent->getEffectivePriv($cvar, $class);
         if (isHardQuotaVariableInClass($class, $cvar)) {
             $quotaleft += $value;
         }
         $totalstring = null;
         $totalstring = "Total: " . $parent->priv->{$cvar};
         if (cse($class, "template")) {
             $totalstring = null;
             $quotaleft = $parent->priv->{$cvar};
         }
         if ($value === "") {
             $value = $quotaleft;
         }
         $rvr = new FormVar();
         $rvr->type = "modify";
         $rvr->texttype = "text";
         $rvr->value = $value;
         $rvr->desc = $descr[2];
         $rvr->name = "frm_{$class}_c_priv_s_{$variable}_aaa_quotaname";
         $rvr->posttext = "Max {$quotaleft} {$totalstring}";
         $rvr->format = "integer";
         $ret[] = $rvr;
         $rvr = new FormVar();
         $rvr->type = "hidden";
         $rvr->value = $quotaleft;
//.........这里部分代码省略.........
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:101,代码来源:htmllib.php

示例6: getDownloadServer

function getDownloadServer()
{
    global $gbl, $sgbl, $login, $ghtml;
    static $local;
    $progname = $sgbl->__var_program_name;
    $maj = $sgbl->__ver_major_minor;
    if (!$local) {
        if (lfile_exists("__path_program_etc/.local_download")) {
            $local = 'on';
        } else {
            $local = 'off';
        }
    }
    if (isOn($local)) {
        $server = "http://192.168.1.100/download/{$progname}/{$maj}";
    } else {
        $server = "http://download.lxcenter.org/download/{$progname}/{$maj}";
    }
    /*
    	if ($sgbl->dbg < 0) {
    		$server = "http://download.lxlabs.com/download/$progname/$maj";
    	}
    */
    return $server;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:25,代码来源:lib.php

示例7: isQuotaGreaterThan

function isQuotaGreaterThan($used, $priv)
{
    if (is_unlimited($priv)) {
        return false;
    }
    if (is_unlimited($used)) {
        return true;
    }
    if (isOn($priv)) {
        return false;
    }
    if (isOn($used)) {
        return true;
    }
    return $used > $priv ? true : false;
}
开发者ID:zseand,项目名称:kloxo,代码行数:16,代码来源:lxlib.php

示例8: continueForm

 static function continueForm($parent, $class, $param, $continueaction)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $vlist = null;
     self::validate_client_name($param['nname']);
     // and issue #657 - Client user names with "__" are displayed with missing end
     if (stristr($param['nname'], '__')) {
         throw new lxexception("{$param['nname']}_use_double_underscore", 'nname');
     }
     // also check if /home/<client> exists --> prevent use like 'httpd' as client
     /*
     	if (lxfile_exists("/home/{$param['nname']}")) {
     		throw new lxexception("{$param['nname']}_dir_exists_under_home_dir", 'nname');
     
     	}
     */
     $reserved = array('apache', 'lighttpd', 'nginx', 'httpd', 'kloxo', 'lxadmin', 'lxlabs', 'lxcenter', 'nouser', 'tinydns', 'axfrdns', 'dnscache', 'dnslog', 'bind', 'named');
     foreach ($reserved as $r) {
         if ($param['nname'] === $r) {
             throw new lxexception("{$param['nname']}_dir_as_reserved_under_home_dir", 'nname');
         }
     }
     $param['nname'] = trim($param['nname']);
     if ($continueaction === 'server') {
         if (isOn($param['send_welcome_f'])) {
             if (!$param['contactemail']) {
                 throw new lxexception("sending_welcome_needs_contactemail", array('contactemail', 'send_welcome_f'), '');
             }
             // accept to more contact mail - http://forum.lxcenter.org/index.php?t=msg&goto=89118
             $contact = implode(",", str_replace(" ", "", $param['contactemail']));
             foreach ($contact as $c) {
                 if (!validate_email($c)) {
                     throw new lxexception("contactemail_is_not_valid_email_address", 'contactemail', '');
                 }
             }
         }
         dprintr($param);
         if ($param['resourceplan_f'] !== 'continue_without_plan') {
             $param['use_resourceplan_f'] = 'On';
             $ret['param'] = $param;
             $ret['action'] = 'addnow';
             return $ret;
         }
         $array = client::getPserverListPriv();
         foreach ((array) $array as $a) {
             $v = "{$a}_list";
             if (!$parent->listpriv->{$v}) {
                 //throw new lxException ("no_server_pool", $v);
             }
             $param["listpriv_s_{$a}_list"] = $parent->listpriv->{$v};
         }
         // This is a hack... This should now only happen in kloxo and not in hypervm.
         if (isset($param['listpriv_s_webpserver_list'])) {
             $weblist = $param['listpriv_s_webpserver_list'];
             $param['listpriv_s_ipaddress_list'] = $parent->getIpaddress($weblist);
             $nlist = domain::getDnsTemplateList($parent);
             $param['dnstemplate_list'] = $nlist;
         }
         $qvlist = getQuotaListForClass('client', $param);
         $vlist = lx_merge_good($vlist, $qvlist);
         $ret['action'] = "add";
         //$ret['continueaction'] = 'server';
         $ret['variable'] = $vlist;
         $ret['param'] = $param;
     }
     return $ret;
 }
开发者ID:zseand,项目名称:kloxo,代码行数:67,代码来源:clientbaselib.php

示例9: continueForm

 static function continueForm($parent, $class, $param, $continueaction)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $vlist = null;
     self::validate_client_name($param['nname']);
     $param['nname'] = trim($param['nname']);
     if ($continueaction === 'server') {
         if (isOn($param['send_welcome_f'])) {
             if (!$param['contactemail']) {
                 throw new lxexception("sending_welcome_needs_contactemail", array('contactemail', 'send_welcome_f'), '');
             }
             if (!validate_email($param['contactemail'])) {
                 throw new lxexception("contactemail_is_not_valid_email_address", 'contactemail', '');
             }
         }
         dprintr($param);
         if ($param['resourceplan_f'] !== 'continue_without_plan') {
             $param['use_resourceplan_f'] = 'On';
             $ret['param'] = $param;
             $ret['action'] = 'addnow';
             return $ret;
         }
         $array = client::getPserverListPriv();
         foreach ((array) $array as $a) {
             $v = "{$a}_list";
             if (!$parent->listpriv->{$v}) {
                 //throw new lxException ("no_server_pool", $v);
             }
             $param["listpriv_s_{$a}_list"] = $parent->listpriv->{$v};
         }
         // This is a hack... This should now only happen in kloxo and not in hypervm.
         if (isset($param['listpriv_s_webpserver_list'])) {
             $weblist = $param['listpriv_s_webpserver_list'];
             $param['listpriv_s_ipaddress_list'] = $parent->getIpaddress($weblist);
             $nlist = domain::getDnsTemplateList($parent);
             $param['dnstemplate_list'] = $nlist;
         }
         $qvlist = getQuotaListForClass('client', $param);
         $vlist = lx_merge_good($vlist, $qvlist);
         $ret['action'] = "add";
         //$ret['continueaction'] = 'server';
         $ret['variable'] = $vlist;
         $ret['param'] = $param;
     }
     return $ret;
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:46,代码来源:clientbaselib.php

示例10: check_priv

function check_priv($parent, $class, $pvar, $v)
{
    if (cse($class, "template")) {
        foreach ($v as $pk => $pv) {
            $pvar->{$pk} = $pv;
        }
        return;
    }
    $parent = $parent->getClientParentO();
    foreach ($v as $pk => $pv) {
        if (cse($pk, "_time")) {
            $pvar->{$pk} = $pv;
            continue;
        }
        if (!$parent->isQuotaVariable($pk) && !$parent->isDeadQuotaVariable($pk)) {
            continue;
        }
        if (cse($pk, "_flag")) {
            if ($parent->priv->isOn($pk)) {
                $pvar->{$pk} = $pv;
                continue;
            }
            if (isOn($pv)) {
                throw new lxException("Parent Doesnt Have Permission for {$pk}", "frm_{$class}_c_priv_s_{$pk}", null);
            }
            $pvar->{$pk} = $pv;
            continue;
        }
        if (cse($pk, "_num") || cse($pk, "_usage")) {
            $tmp = $pv;
            if ($tmp < 0) {
                throw new lxException('has_to_be_greater_than_zero', "priv_s_{$pk}");
            }
            if (is_unlimited($parent->priv->{$pk})) {
                if (isHardQuotaVariableInClass($class, $pk)) {
                    $parent->used->{$pk} -= $pvar->{$pk};
                    $parent->used->{$pk} += $pv;
                    $parent->setUpdateSubaction();
                }
                $pvar->{$pk} = $pv;
                continue;
            }
            if (is_unlimited($pv)) {
                $desc = getNthToken(get_v_descr($parent, $pk), 2);
                if (!$desc) {
                    $desc = $pk;
                }
                throw new lxException("quota_exceeded", "priv_s_{$pk}", $desc);
            }
            if (isHardQuotaVariableInClass($class, $pk)) {
                $parent->used->{$pk} -= $pvar->{$pk};
            }
            dprintr($parent->used);
            if ($tmp > $parent->getEffectivePriv($pk, $class)) {
                dprint("After throw");
                $desc = getNthToken(get_v_descr($parent, $pk), 1);
                if (!$desc) {
                    $desc = $pk;
                }
                throw new lxException("quota_exceeded", "priv_s_{$pk}", $desc);
            }
            dprint("No throw.. {$tmp} <br> ");
            if (isHardQuotaVariableInClass($class, $pk)) {
                $parent->used->{$pk} += $pv;
                $parent->setUpdateSubaction();
            }
            $pvar->{$pk} = $pv;
        }
    }
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:70,代码来源:objectactionlib.php

示例11: isSelect

 function isSelect()
 {
     if ($this->nname === "localhost") {
         return false;
     }
     if (isOn($this->createUsed())) {
         return false;
     }
     return $this->getParentO()->isAdmin();
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:pservercorelib.php

示例12: updateselfbackupconfig

 function updateselfbackupconfig($param)
 {
     if (isOn($param['selfbackupparam_b-selfbackupflag'])) {
         $fn = ftp_connect($param['selfbackupparam_b-ftp_server']);
         $mylogin = ftp_login($fn, $param['selfbackupparam_b-rm_username'], $param['selfbackupparam_b-rm_password']);
         if (!$mylogin) {
             $p = error_get_last();
             throw new lxException('could_not_connect_to_ftp_server', '', $p);
         }
     }
     return $param;
 }
开发者ID:zseand,项目名称:kloxo,代码行数:12,代码来源:generallib.php

示例13: updateToggle_dot

 function updateToggle_dot($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $v = $gbl->getSessionV("frm_show_dot");
     if (isOn($v)) {
         $v = 'off';
     } else {
         $v = 'on';
     }
     $gbl->setSessionV("frm_show_dot", $v);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:11,代码来源:ffilelib.php

示例14: generateDomainKey

 function generateDomainKey($dontwasflag)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $mmail = $this->getObject('mmail');
     $dns = $this->getObject('dns');
     $domainkeyflag = db_get_value('servermail', $mmail->syncserver, 'domainkey_flag');
     if (!isOn($domainkeyflag)) {
         $dns->RemoveDomainKey();
         if ($dontwasflag) {
             return;
         }
         $dns->setUpdateSubaction('full_update');
         $dns->was();
         return;
     }
     $dkey = rl_exec_in_driver($mmail, 'mmail', 'generateDKey', array($this->nname));
     if (!$dkey) {
         return;
     }
     $dns->addDomainKey($dkey);
     if ($dontwasflag) {
         return;
     }
     $dns->setUpdateSubaction('full_update');
     $dns->was();
 }
开发者ID:zseand,项目名称:kloxo,代码行数:26,代码来源:domainlib.php

示例15: continueForm

 static function continueForm($parent, $class, $param, $continueaction)
 {
     global $gbl, $sgbl, $login, $ghtml;
     /*
     	if(!eregi("^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,5})$", $param['nname'])) { 
     		throw new lxException('invalid_domain_name', 'nname');
     	}
     */
     if (!cse($param['nname'], ".vm")) {
         $param['nname'] .= ".vm";
     }
     $param['nname'] = strtolower($param['nname']);
     if ($param['one_ipaddress_f']) {
         full_validate_ipaddress($param['one_ipaddress_f']);
     }
     /*
     	if (!preg_match("/[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+]/i", $param['nname'])) {
     		throw new lxException('domain_name_invalid', 'nname');
     	}
     */
     if (isOn($param['send_welcome_f'])) {
         if (!$param['contactemail']) {
             throw new lxexception("sending_welcome_needs_contactemail", array('contactemail', 'send_welcome_f'), '');
         }
         if (!validate_email($param['contactemail'])) {
             throw new lxexception("contactemail_is_not_valid_email_address", 'contactemail', '');
         }
     }
     if ($param['resourceplan_f'] === 'continue_without_plan') {
         $vlist['__c_subtitle_quota'] = 'Quota';
         $qvlist = getQuotaListForClass('vps');
         $vlist = lx_merge_good($vlist, $qvlist);
         $ret['param'] = $param;
         $ret['variable'] = $vlist;
         $ret['action'] = "Add";
     } else {
         $template = getFromAny(array($login, $parent), 'resourceplan', $param['resourceplan_f']);
         $param['use_resourceplan_f'] = 'on';
         if (!$template) {
             throw new lxexception("the_template_doesnt_exist", 'resourceplan_f', $param['resourceplan_f']);
         }
         $ret['action'] = 'addnow';
         $ret['param'] = $param;
         return $ret;
     }
     return $ret;
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:47,代码来源:vpslib.php


注:本文中的isOn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。