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


PHP UserRights::GetRealUser方法代码示例

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


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

示例1: DoExecute

 protected function DoExecute()
 {
     $sUser = 'Romain';
     echo "<p>Totor: " . (UserRights::CheckCredentials('Totor', 'toto') ? 'ok' : 'NO') . "</p>\n";
     echo "<p>Romain: " . (UserRights::CheckCredentials('Romain', 'toto') ? 'ok' : 'NO') . "</p>\n";
     echo "<p>User: " . UserRights::GetUser() . "</p>\n";
     echo "<p>On behalf of..." . UserRights::GetRealUser() . "</p>\n";
     echo "<p>Denis (impersonate) : " . (UserRights::Impersonate('Denis', 'tutu') ? 'ok' : 'NO') . "</p>\n";
     echo "<p>User: " . UserRights::GetUser() . "</p>\n";
     echo "<p>On behalf of..." . UserRights::GetRealUser() . "</p>\n";
     $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT bizOrganization"));
     echo "<p>IsActionAllowed..." . (UserRights::IsActionAllowed('bizOrganization', UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES ? 'ok' : 'NO') . "</p>\n";
     echo "<p>IsStimulusAllowed..." . (UserRights::IsStimulusAllowed('bizOrganization', 'myStimulus', $oSet) == UR_ALLOWED_YES ? 'ok' : 'NO') . "</p>\n";
     echo "<p>IsActionAllowedOnAttribute..." . (UserRights::IsActionAllowedOnAttribute('bizOrganization', 'myattribute', UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES ? 'ok' : 'NO') . "</p>\n";
     return true;
 }
开发者ID:besmirzanaj,项目名称:itop-code,代码行数:16,代码来源:testlist.inc.php

示例2: DeleteConnectedNetworkDevice

 protected function DeleteConnectedNetworkDevice()
 {
     $iNetworkDeviceID = $this->Get('networkdevice_id');
     $iDeviceID = $this->Get('connectableci_id');
     $oDevice = MetaModel::GetObject('ConnectableCI', $this->Get('connectableci_id'));
     $sOQL = "SELECT  lnkConnectableCIToNetworkDevice WHERE connectableci_id = :device AND networkdevice_id = :network AND network_port = :nwport AND device_port = :devport";
     $oConnectionSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('network' => $this->Get('connectableci_id'), 'device' => $this->Get('networkdevice_id'), 'devport' => $this->Get('network_port'), 'nwport' => $this->Get('device_port')));
     $iAlreadyExist = $oConnectionSet->count();
     if (get_class($oDevice) == 'NetworkDevice' && $iAlreadyExist != 0) {
         $oMyChange = MetaModel::NewObject("CMDBChange");
         $oMyChange->Set("date", time());
         if (UserRights::IsImpersonated()) {
             $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser());
         } else {
             $sUserString = UserRights::GetUser();
         }
         $oMyChange->Set("userinfo", $sUserString);
         $iChangeId = $oMyChange->DBInsert();
         $oConnection = $oConnectionSet->Fetch();
         $oConnection->DBDeleteTracked($oMyChange);
     }
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:22,代码来源:model.itop-config-mgmt.php


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