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


PHP MetaModel::DBHasAccess方法代码示例

本文整理汇总了PHP中MetaModel::DBHasAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP MetaModel::DBHasAccess方法的具体用法?PHP MetaModel::DBHasAccess怎么用?PHP MetaModel::DBHasAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MetaModel的用法示例。


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

示例1: output


//.........这里部分代码省略.........
            // 2) clicking on it will erase it
            $sText = Dict::S("UI:YourSearch");
            $sOnClick = " onclick=\"this.value='';this.onclick=null;\"";
        }
        // Render the tabs in the page (if any)
        $this->s_content = $this->m_oTabs->RenderIntoContent($this->s_content);
        if ($this->GetOutputFormat() == 'html') {
            $oAppContext = new ApplicationContext();
            $sUserName = UserRights::GetUser();
            $sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : '';
            if (UserRights::IsAdministrator()) {
                $sLogonMessage = Dict::Format('UI:LoggedAsMessage+Admin', $sUserName);
            } else {
                $sLogonMessage = Dict::Format('UI:LoggedAsMessage', $sUserName);
            }
            $sLogOffMenu = "<span id=\"logOffBtn\"><ul><li><img src=\"../images/onOffBtn.png\"><ul>";
            $sLogOffMenu .= "<li><span>{$sLogonMessage}</span></li>\n";
            $aActions = array();
            $oPrefs = new URLPopupMenuItem('UI:Preferences', Dict::S('UI:Preferences'), utils::GetAbsoluteUrlAppRoot() . "pages/preferences.php?" . $oAppContext->GetForLink());
            $aActions[$oPrefs->GetUID()] = $oPrefs->GetMenuItem();
            if (utils::CanLogOff()) {
                $oLogOff = new URLPopupMenuItem('UI:LogOffMenu', Dict::S('UI:LogOffMenu'), utils::GetAbsoluteUrlAppRoot() . 'pages/logoff.php?operation=do_logoff');
                $aActions[$oLogOff->GetUID()] = $oLogOff->GetMenuItem();
            }
            if (UserRights::CanChangePassword()) {
                $oChangePwd = new URLPopupMenuItem('UI:ChangePwdMenu', Dict::S('UI:ChangePwdMenu'), utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=change_pwd');
                $aActions[$oChangePwd->GetUID()] = $oChangePwd->GetMenuItem();
            }
            utils::GetPopupMenuItems($this, iPopupMenuExtension::MENU_USER_ACTIONS, null, $aActions);
            $oAbout = new JSPopupMenuItem('UI:AboutBox', Dict::S('UI:AboutBox'), 'return ShowAboutBox();');
            $aActions[$oAbout->GetUID()] = $oAbout->GetMenuItem();
            $sLogOffMenu .= $this->RenderPopupMenuItems($aActions);
            $sRestrictions = '';
            if (!MetaModel::DBHasAccess(ACCESS_ADMIN_WRITE)) {
                if (!MetaModel::DBHasAccess(ACCESS_ADMIN_WRITE)) {
                    $sRestrictions = Dict::S('UI:AccessRO-All');
                }
            } elseif (!MetaModel::DBHasAccess(ACCESS_USER_WRITE)) {
                $sRestrictions = Dict::S('UI:AccessRO-Users');
            }
            $sApplicationBanner = '';
            if (strlen($sRestrictions) > 0) {
                $sAdminMessage = trim(MetaModel::GetConfig()->Get('access_message'));
                $sApplicationBanner .= '<div id="admin-banner">';
                $sApplicationBanner .= '<img src="../images/locked.png" style="vertical-align:middle;">';
                $sApplicationBanner .= '&nbsp;<b>' . $sRestrictions . '</b>';
                if (strlen($sAdminMessage) > 0) {
                    $sApplicationBanner .= '&nbsp;<b>' . $sAdminMessage . '</b>';
                }
                $sApplicationBanner .= '</div>';
            }
            if (strlen($this->m_sMessage)) {
                $sApplicationBanner .= '<div id="admin-banner"><span style="padding:5px;">' . $this->m_sMessage . '<span></div>';
            }
            $sApplicationBanner .= $sBannerExtraHtml;
            if (!empty($sNorthPane)) {
                $sNorthPane = '<div id="bottom-pane" class="ui-layout-north">' . $sNorthPane . '</div>';
            }
            if (!empty($sSouthPane)) {
                $sSouthPane = '<div id="bottom-pane" class="ui-layout-south">' . $sSouthPane . '</div>';
            }
            $sIconUrl = Utils::GetConfig()->Get('app_icon_url');
            $sOnlineHelpUrl = MetaModel::GetConfig()->Get('online_help');
            //$sLogOffMenu = "<span id=\"logOffBtn\" style=\"height:55px;padding:0;margin:0;\"><img src=\"../images/onOffBtn.png\"></span>";
            $sDisplayIcon = utils::GetAbsoluteUrlAppRoot() . 'images/itop-logo.png';
            if (file_exists(MODULESROOT . 'branding/main-logo.png')) {
开发者ID:henryavila,项目名称:itop,代码行数:67,代码来源:itopwebpage.class.inc.php

示例2: output

 public function output()
 {
     $sApplicationBanner = '';
     if (!MetaModel::DBHasAccess(ACCESS_USER_WRITE)) {
         $sReadOnly = Dict::S('UI:AccessRO-Users');
         $sAdminMessage = trim(MetaModel::GetConfig()->Get('access_message'));
         $sApplicationBanner .= '<div id="admin-banner">';
         $sApplicationBanner .= '<img src="../images/locked.png" style="vertical-align:middle;">';
         $sApplicationBanner .= '&nbsp;<b>' . $sReadOnly . '</b>';
         if (strlen($sAdminMessage) > 0) {
             $sApplicationBanner .= '&nbsp;: ' . $sAdminMessage . '';
         }
         $sApplicationBanner .= '</div>';
     }
     $sMenu = '';
     if ($this->m_bEnableDisconnectButton) {
         $this->AddMenuButton('logoff', 'Portal:Disconnect', utils::GetAbsoluteUrlAppRoot() . 'pages/logoff.php?operation=do_logoff');
         // This menu is always present and is the last one
     }
     foreach ($this->m_aMenuButtons as $aMenuItem) {
         $sMenu .= "<a class=\"button\" id=\"{$aMenuItem['id']}\" href=\"{$aMenuItem['hyperlink']}\"><span>" . Dict::S($aMenuItem['label']) . "</span></a>";
     }
     $this->s_content = '<div id="portal"><div id="welcome">' . $this->m_sWelcomeMsg . '</div><div id="banner"><div id="logo"></div><div id="menu">' . $sMenu . '</div></div>' . $sApplicationBanner . '<div id="content">' . $this->s_content . '</div></div>';
     parent::output();
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:25,代码来源:portalwebpage.class.inc.php

示例3: DisplayStatus

    $oP->p("Background processes: " . $sDisplayProcesses);
}
if (utils::ReadParam('status_only', false, true)) {
    // Display status and exit
    DisplayStatus($oP);
    exit(0);
}
require_once APPROOT . 'core/mutex.class.inc.php';
$oP->p("Starting: " . time() . ' (' . date('Y-m-d H:i:s') . ')');
try {
    $oConfig = utils::GetConfig();
    $oMutex = new iTopMutex('cron.' . $oConfig->GetDBName() . '_' . $oConfig->GetDBSubname());
    if ($oMutex->TryLock()) {
        // Note: testing this now in case some of the background processes forces the read-only mode for a while
        //       in that case it is better to exit with the check on reentrance (mutex)
        if (!MetaModel::DBHasAccess(ACCESS_ADMIN_WRITE)) {
            $oP->p("A database maintenance is ongoing (read-only mode even for admins).");
            $oP->Output();
            exit - 1;
        }
        CronExec($oP, $aProcesses, $bVerbose);
        $oMutex->Unlock();
    } else {
        // Exit silently
        $oP->p("Already running...");
    }
} catch (Exception $e) {
    $oP->p("ERROR: '" . $e->getMessage() . "'");
    if ($bDebug) {
        // Might contain verb parameters such a password...
        $oP->p($e->getTraceAsString());
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:31,代码来源:cron.php


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