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


PHP if_demo_throw_exception函数代码示例

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


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

示例1: updateSwitchProgram

 function updateSwitchProgram($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if_demo_throw_exception('switchprog');
     $this->web_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'web');
     $this->dns_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'dns');
     $this->spam_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'spam');
     $a['web'] = $this->web_driver;
     $a['dns'] = $this->dns_driver;
     $a['spam'] = $this->spam_driver;
     foreach ($param as $k => $v) {
         if ($this->{$k} === $v) {
             dprint("No change for {$k}: {$v}\n");
         } else {
             $class = strtilfirst($k, "_");
             $drstring = "{$class}_driver";
             rl_exec_get(null, $this->nname, array($class, 'switchDriver'), array($class, $this->{$drstring}, $v));
             changeDriver($this->nname, $class, $v);
             $fixc = $class;
             if ($class === 'spam') {
                 $fixc = "mmail";
             }
             lxshell_return("__path_php_path", "../bin/fix/fix{$fixc}.php", "--server={$this->nname}");
             $a[$class] = $v;
             rl_exec_get(null, $this->nname, 'slave_save_db', array('driver', $a));
         }
     }
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:28,代码来源:pserverlib.php

示例2: dbactionUpdate

 function dbactionUpdate($subaction)
 {
     if_demo_throw_exception('lxguard');
     $rmt = new Remote();
     $rmt->data['disablehit'] = $this->main->disablehit;
     lfile_put_serialize("__path_home_root/lxguard/config.info", $rmt);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:lxguard__synclib.php

示例3: updateLxupdateInfo

 function updateLxupdateInfo()
 {
     if_demo_throw_exception();
     if (isUpdating()) {
         throw new lxException("program_is_already_updating");
     } else {
         rl_exec_get($this->__masterserver, 'localhost', array('lxupdate', 'execUpdate'), null);
         throw new lxException("update_scheduled");
     }
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:10,代码来源:lxupdatelib.php

示例4: updateRemove

 function updateRemove($param)
 {
     if_demo_throw_exception();
     $server = $this->syncserver;
     $sq = new Sqlite(null, "lxguardhit");
     foreach ($param['_accountselect'] as $ip) {
         $sq->rawQuery("delete from lxguardhit where syncserver = '{$server}' AND ipaddress = '{$ip}'");
     }
     self::save_current_hitlist($server);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:10,代码来源:lxguardlib.php

示例5: shellModify

 function shellModify()
 {
     global $gbl, $sgbl, $login, $ghtml;
     if_demo_throw_exception();
     $shell = fix_disabled($this->main->shell, $sgbl->__var_noaccess_shell);
     lxshell_return("usermod", "-s", $shell, $this->main->nname);
     if ($this->main->isOn('disable_system_flag')) {
         lxshell_return("usermod", "-L", $this->main->nname);
     } else {
         lxshell_return("usermod", "-U", $this->main->nname);
     }
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:12,代码来源:client__synclib.php

示例6: addform

 static function addform($parent, $class, $typetd = null)
 {
     if_demo_throw_exception('short');
     $vlist['sortid'] = null;
     if ($typetd['val'] !== 'separator') {
         $vlist['url'] = null;
         $vlist['description'] = null;
         $vlist['external'] = array('h', 'on');
     }
     $ret['variable'] = $vlist;
     $ret['action'] = 'add';
     return $ret;
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:13,代码来源:dskfavorite.php

示例7: writeAuthorizedKey

 function writeAuthorizedKey($key)
 {
     if_demo_throw_exception('sshkey');
     $username = $this->main->username;
     $p = os_get_home_dir($username);
     if (!$p) {
         return;
     }
     lxuser_mkdir($username, "{$p}/.ssh");
     $f = "{$p}/.ssh/authorized_keys";
     lxuser_put_contents($username, $f, $key);
     lxuser_chmod($username, "{$p}/.ssh", "0700");
     lxuser_chmod($username, $f, "0700");
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:sshauthorizedkey__sync.php

示例8: deleteSpecific

 function deleteSpecific()
 {
     if_demo_throw_exception('demo');
     $sq = new Sqlite(null, 'ipaddress');
     $sq->rawQuery("delete from ipaddress where syncserver = '{$this->nname}'");
     //$this->fixDatabaseServers();
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:7,代码来源:pservercorelib.php

示例9: updatePassword

 function updatePassword($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if_demo_throw_exception('lxclient');
     if ($this->isLogin() || $this->is__table('auxiliary') && $this->getParentO()->isAuxiliary()) {
         if (!check_password($param['old_password_f'], $this->password)) {
             throw new lxException("Wrong+Password", 'old_password_f');
         }
         unset($param['old_password_f']);
     }
     $this->__old_password = $this->password;
     $param['realpass'] = $param['password'];
     $param['password'] = crypt($param['password']);
     // Hack hack... this is due the forced security password change in the admin. Most likely the referal url, to which it is redirected, is empty. So if you are changing the login password, you can anyway redirect to 'show';
     if ($this->isLogin()) {
         $gbl->__this_redirect = '/display.php?frm_action=show';
     }
     return $param;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:19,代码来源:lxclient.php

示例10: updateInformation

 function updateInformation($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if_demo_throw_exception('info');
     if (isset($param['cttype'])) {
         if (!$this->isAdmin()) {
             if ($this->getParentO()->isGt($param['cttype'])) {
                 throw new lxException("parent_doesnt_have_privileges", 'cttype', '');
             }
         }
     }
     if ($login->isAdmin()) {
         $gen = $login->getObject('general');
         $gen->disable_admin = $param['disable_admin'];
         if ($gen->isOn('disable_admin')) {
             $list = $login->getList('auxiliary');
             if (count($list) == 0) {
                 throw new lxException("you_should_create_auxiliary_id_before_disabling_admin", '', '');
             }
         }
         $gen->setUpdateSubaction();
         $gen->write();
     }
     return $param;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:25,代码来源:clientcorelib.php

示例11: syncCreateConf

 function syncCreateConf()
 {
     global $gbl, $sgbl, $login, $ghtml;
     global $global_shell_error;
     if_demo_throw_exception('cron');
     $conf_file = "__path_cron_root/{$this->main->username}";
     $list = array('minute', 'hour', 'weekday', 'ddate', 'month');
     $tfile = lx_tmp_file($conf_file);
     $cmd = null;
     if ($this->main->__var_mailto) {
         $cmd .= "MAILTO={$this->main->__var_mailto}\n";
     }
     $result = $this->main->__var_cron_list;
     foreach ($result as &$__r) {
         foreach ($list as $l) {
             $__r[$l] = unserialize(base64_decode($__r["ser_{$l}"]));
         }
     }
     $result = merge_array_object_not_deleted($result, $this->main);
     //dprintr($result);
     foreach ((array) $result as $v) {
         if ($v['ttype'] === 'simple') {
             $v['weekday'] = array('--all--');
             $v['month'] = array('--all--');
             $v['ddate'] = array('--all--');
             if ($v['simple_cron'] === 'every-day') {
                 $v['hour'] = $v['cron_day_hour'];
                 $v['minute'] = 0;
             }
             if ($v['simple_cron'] === 'every-hour') {
                 $v['hour'] = array('--all--');
                 $v['minute'] = 0;
             }
             if ($v['simple_cron'] === 'every-minute') {
                 $v['hour'] = array('--all--');
                 $v['minute'] = array('--all--');
             }
         } else {
             foreach ($v["weekday"] as &$___tq) {
                 if (is_numeric($___tq)) {
                     $___tq -= 1;
                 }
             }
         }
         foreach ($list as $l) {
             $v[$l] = $this->getCronString($v[$l]);
         }
         if (!$v['minute']) {
             $v['minute'] = 0;
         }
         $cmd .= implode("\t", array($v['minute'], $v['hour'], $v['ddate'], $v['month'], $v['weekday'], $v['command']));
         $cmd .= "\n";
     }
     lfile_put_contents($tfile, $cmd);
     if (!posix_getpwnam($this->main->username)) {
         lxfile_rm("/var/spool/cron/{$this->main->username}");
         return;
     }
     $ret = lxshell_return("crontab", "-u", $this->main->username, $tfile);
     if ($ret) {
         // Why exactly was a throw removed? backup/restore?
         //throw new lxException("adding_cron_failed", "", $global_shell_error);
         $gbl->setWarning('adding_cron_failed', '', $global_shell_error);
         $data = lfile_get_contents($tfile);
         log_log("cron_error", $data);
     }
     lunlink($tfile);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:68,代码来源:cron__linuxlib.php

示例12: dbactionUpdate

 function dbactionUpdate($subaction)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if_demo_throw_exception('ffile');
     $this->aux = new Ffile__common(null, null, $this->nname);
     $this->aux->main = $this->main;
     if ($this->main->isOn('readonly')) {
         throw new lxexception('file_manager_is_readonly', '');
     }
     $chownug = "{$this->main->__username_o}:{$this->main->__username_o}";
     switch ($subaction) {
         case "fancyedit":
         case "edit":
             lxuser_put_contents($chownug, $this->main->getFullPath(), $this->main->content);
             lxuser_return($chownug, "dos2unix", $this->main->getFullPath());
             lxuser_chmod($chownug, $this->main->getFullPath(), "0644");
             break;
         case "upload_s":
             $filename = $this->aux->uploadDirect();
             lxuser_chmod($chownug, $filename, "0644");
             lxfile_generic_chown($filename, $chownug);
             break;
         case "rename":
             $this->aux->reName();
             break;
         case "paste":
             $this->aux->filePaste();
             break;
         case "perm":
             $arg = null;
             $perm = $this->main->newperm;
             $perm = 0 . $perm;
             if ($this->main->isOn('recursive_f')) {
                 new_process_chmod_rec($this->main->__username_o, $this->main->fullpath, $perm);
             } else {
                 lxfile_unix_chmod($this->main->fullpath, "{$perm}");
             }
             break;
         case "newdir":
             $path = $this->aux->newDir();
             lxfile_unix_chown($path, $chownug);
             break;
         case "content":
             if ($this->main->is_image()) {
                 $this->aux->resizeImage();
             } else {
                 throw new lxexception('cannot_save_content', '');
             }
             break;
         case "thumbnail":
             $this->aux->createThumbnail();
             break;
         case "convert_image":
             $this->aux->convertImage();
             break;
         case "zip_file":
             $zipfile = $this->aux->zipFile();
             break;
         case "filedelete":
             $this->aux->moveAllToTrash();
             break;
         case "filerealdelete":
             $this->aux->fileRealDelete();
             break;
         case "restore_trash":
             $this->aux->restoreTrash();
             break;
         case "clear_trash":
             $this->aux->clearTrash();
             break;
         case "download_from_http":
             $fullpath = $this->aux->downloadFromHttp();
             lxfile_unix_chown($fullpath, $chownug);
             break;
         case "download_from_ftp":
             $fullpath = $this->aux->downloadFromFtp();
             lxfile_unix_chown($fullpath, $chownug);
             break;
         case "zipextract":
             $dir = $this->aux->zipExtract();
             break;
     }
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:83,代码来源:ffile__linuxlib.php

示例13: updateDisable

 function updateDisable($param, $reason = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($this->isAdmin()) {
         return;
     }
     if_demo_throw_exception();
     if (!$reason) {
         $reason = "__type:{$login->nname}:{$login->cttype}";
     }
     if (isset($this->status) && $this->status === 'on') {
         $this->disable_reason = $reason;
         $this->setStatus('off');
     }
     return null;
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:16,代码来源:lxclass.php

示例14: postUpdate

 function postUpdate()
 {
     // The lxclient postupdate which checks for change of skin...
     if ($this->subaction === 'createtemplate') {
         if ($this->isXen()) {
             $stem = explode("-", $this->ostemplate);
             if ($this->isWindows()) {
                 $name = "{$stem[0]}-";
             } else {
                 $name = "{$stem[0]}-{$stem[1]}-{$stem[2]}-";
             }
             $templatename = "{$name}{$this->newostemplate_name_f}";
             if ($this->isWindows()) {
                 $tempfpath = "__path_program_home/xen/template/{$templatename}.img";
             } else {
                 $tempfpath = "__path_program_home/xen/template/{$templatename}.tar.gz";
             }
             if (lxfile_exists($tempfpath)) {
                 throw new lxException("template_already_exists");
             }
         } else {
             $stem = explode("-", $this->ostemplate);
             $name = "{$stem[0]}-{$stem[1]}-{$stem[2]}-";
             $templatename = "{$name}{$this->newostemplate_name_f}";
             if (lxfile_exists("/vz/template/cache/{$templatename}.tar.gz")) {
                 throw new lxException("template_already_exists");
             }
         }
     }
     if ($this->subaction === 'rebuild' || $this->subaction === 'installkloxo') {
         if_demo_throw_exception();
         $this->setUpOsTemplateDownloadParam();
     }
     parent::postUpdate();
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:35,代码来源:vpslib.php

示例15: isSync

 function isSync()
 {
     if_demo_throw_exception('ip');
     return false;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:5,代码来源:allowediplib.php


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