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


PHP AppConfig::security方法代码示例

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


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

示例1: checkPermission

 public function checkPermission(Vtiger_Request $request)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $record = $request->get('record');
     if (!AppConfig::security('SHOW_MY_PREFERENCES')) {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
     if ($currentUserModel->isAdminUser() == true || $currentUserModel->get('id') == $record) {
         return true;
     } else {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:13,代码来源:PreferenceDetail.php

示例2: checkPermission

 public function checkPermission(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $record = $request->get('record');
     if (!AppConfig::security('SHOW_MY_PREFERENCES')) {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
     if (!empty($record) && $currentUserModel->get('id') != $record) {
         $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
         if ($recordModel->get('status') != 'Active') {
             throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
         }
     }
     if ($currentUserModel->isAdminUser() == true || $currentUserModel->get('id') == $record) {
         return true;
     } else {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:20,代码来源:PreferenceEdit.php

示例3: load

 public static function load($key, $config)
 {
     switch ($key) {
         case 'debug':
             self::$debug = $config;
             break;
         case 'developer':
             self::$developer = $config;
             break;
         case 'security':
             self::$security = $config;
             break;
         case 'securityKeys':
             self::$securityKeys = $config;
             break;
         case 'performance':
             self::$performance = $config;
             break;
         case 'relation':
             self::$relation = $config;
             break;
     }
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:23,代码来源:ConfigUtils.php

示例4: getHeaderLinks

 /**
  * Function to get the list of Header Links
  * @return <Array> - List of Vtiger_Link_Model instances
  */
 public function getHeaderLinks(Vtiger_Request $request)
 {
     $userModel = Users_Record_Model::getCurrentUserModel();
     $headerLinks = [];
     if ($userModel->isAdminUser()) {
         if ($request->get('parent') != 'Settings') {
             $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SYSTEM_SETTINGS', 'linkurl' => 'index.php?module=Vtiger&parent=Settings&view=Index', 'glyphicon' => 'glyphicon glyphicon-cog'];
         } else {
             $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_USER_PANEL', 'linkurl' => 'index.php', 'glyphicon' => 'glyphicon glyphicon-user'];
         }
     }
     //TODO To remove in the future
     if (AppConfig::security('SHOW_MY_PREFERENCES')) {
         $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MY_PREFERENCES', 'linkurl' => $userModel->getPreferenceDetailViewUrl(), 'glyphicon' => 'glyphicon glyphicon-tasks'];
     }
     $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SIGN_OUT', 'linkurl' => 'index.php?module=Users&parent=Settings&action=Logout', 'glyphicon' => 'glyphicon glyphicon-off'];
     if (Users_Module_Model::getSwitchUsers()) {
         $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'SwitchUsers', 'linkurl' => '', 'glyphicon' => 'glyphicon glyphicon-transfer', 'nocaret' => true, 'linkdata' => ['url' => $userModel->getSwitchUsersUrl()], 'linkclass' => 'showModal'];
     }
     $headerLinkInstances = [];
     foreach ($headerLinks as $headerLink) {
         $headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink);
         if (isset($headerLink['childlinks'])) {
             foreach ($headerLink['childlinks'] as $childLink) {
                 $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink));
             }
         }
         $headerLinkInstances[] = $headerLinkInstance;
     }
     $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, ['HEADERLINK']);
     foreach ($headerLinks as $headerType => $headerLinks) {
         foreach ($headerLinks as $headerLink) {
             $headerLinkInstances[] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
         }
     }
     return $headerLinkInstances;
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:41,代码来源:Header.php

示例5: run

 public static function run($request)
 {
     $instance = new self();
     if (isset($_REQUEST['user_name']) && isset($_REQUEST['emailId'])) {
         if (AppConfig::security('RESET_LOGIN_PASSWORD')) {
             $instance->requestForgotPassword($request);
         } else {
             die(vtranslate('LBL_PERMISSION_DENIED'));
         }
     } else {
         $instance->changePassword($request);
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:13,代码来源:ForgotPassword.php


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