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


PHP BizSystem::GetUserProfile方法代码示例

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


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

示例1: getFormReferences

 protected function getFormReferences()
 {
     // get user widgets of this view
     $user_id = BizSystem::GetUserProfile("Id");
     $viewName = $this->m_Name;
     $searchRule = "[user_id]='{$user_id}' AND [view]='{$viewName}'";
     $do = BizSystem::GetObject($this->m_UserWidgetDO);
     $formRecs = $do->directfetch($searchRule);
     // if no user widgets found, get system widgets of this view
     if (count($formRecs) == 0) {
         $searchRule = "[user_id]=0 AND [view]='{$viewName}'";
         $formRecs = $do->directfetch($searchRule);
     }
     $formRefXML = array();
     foreach ($formRecs as $form) {
         $formRefXML[] = array("ATTRIBUTES" => array("NAME" => $form['widget']), "VALUE" => null);
         $this->columns[$form['column']][] = $form['widget'];
     }
     return $formRefXML;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:20,代码来源:DashboardView.php

示例2: getSearchRule

 public function getSearchRule()
 {
     $value = BizSystem::clientProxy()->getFormInputs($this->m_Name);
     $searchRule = "";
     $my_user_id = BizSystem::getUserProfile("Id");
     $user_groups = BizSystem::GetUserProfile('groups');
     if (count($user_groups)) {
         $group_id_range = implode(",", $user_groups);
         $group_where = "  ( [group_id] IN ({$group_id_range} ) )";
     }
     if (count($user_groups)) {
         $group_id_range = implode(",", $user_groups);
         $other_where = "  ( [group_id] NOT IN ({$group_id_range} ) )";
     }
     switch ((int) $value) {
         case 1:
             if ($this->hasOwnerField()) {
                 $searchRule = "([create_by]= '{$my_user_id}' OR [owner_id]='{$my_user_id}')";
             } else {
                 $searchRule = "([create_by]= '{$my_user_id}')";
             }
             break;
         case 2:
             $searchRule = "({$group_where} and [create_by]!= '{$my_user_id}')";
             break;
         case 3:
             $searchRule = "({$other_where} and [create_by] != '{$my_user_id}' )";
             break;
         case 4:
             $searchRule = "([create_by]= '{$my_user_id}')";
             break;
         case 5:
             $searchRule = "([create_by] != '{$my_user_id}' AND [owner_id]  = '{$my_user_id}' )";
             break;
         case 6:
             $searchRule = "([create_by]  = '{$my_user_id}' AND [owner_id] != '{$my_user_id}' )";
             break;
     }
     return $searchRule;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:40,代码来源:ShareDataFilter.php

示例3: getValue

 public function getValue()
 {
     $user_id = BizSystem::GetUserProfile("Id");
     $groups = BizSystem::GetUserProfile("groups");
     if (!$groups) {
         $groups = array();
     }
     $this->m_hasOwnerField = $this->hasOwnerField();
     if ($this->m_hasOwnerField) {
         if ($this->m_RecordOwnerId != $this->m_RecordCreatorId) {
             if ($this->m_RecordOwnerId == $user_id) {
                 $this->m_Value = 4;
                 return $this->m_Value;
             } elseif ($this->m_RecordCreatorId == $user_id) {
                 $this->m_Value = 5;
                 return $this->m_Value;
             }
         }
     }
     if ($user_id == $this->m_RecordOwnerId) {
         if ((int) $this->m_RecordGroupPerm > 0 || (int) $this->m_RecordOtherPerm > 0) {
             $this->m_Value = 1;
         } else {
             $this->m_Value = 0;
         }
     } elseif ($this->m_RecordOtherPerm > 0) {
         $this->m_Value = 3;
     } else {
         foreach ($groups as $group_id) {
             if ($group_id == $this->m_RecordGroupId) {
                 $this->m_Value = 2;
                 break;
             }
         }
     }
     return $this->m_Value;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:37,代码来源:ColumnShare.php

示例4: fetchData

 public function fetchData()
 {
     if ($this->m_ActiveRecord != null) {
         return $this->m_ActiveRecord;
     }
     $prtForm = $this->m_ParentFormName;
     $prtFormObj = BizSystem::GetObject($prtForm);
     if (!$prtForm) {
         return array();
     }
     $this->SetPrtRecordId($this->m_RecordId);
     $recId = $this->m_ParentRecordId;
     $dataObj = $prtFormObj->getDataObj();
     $dataRec = $dataObj->fetchById($recId);
     $user_id = BizSystem::GetUserProfile("Id");
     $group_id = BizSystem::GetUserProfile("default_group");
     $this->m_hasOwnerField = $this->hasOwnerField();
     $result = array();
     $result['Id'] = $dataRec['Id'];
     $result['editable'] = 0;
     $result['has_ref_data'] = 0;
     if ($dataObj->m_ObjReferences->count()) {
         $result['has_ref_data'] = 1;
     }
     if ($user_id == $dataRec['create_by']) {
         $result['shared_data'] = 0;
         $result['editable'] = 1;
     } elseif ($this->m_hasOwnerField && $owner_id == $user_id) {
         $result['shared_data'] = 0;
         $result['editable'] = 1;
     } elseif ($group_id == $dataRec['group_id']) {
         $result['shared_data'] = 1;
     } else {
         $result['shared_data'] = 2;
     }
     if ($dataRec['name'] != '') {
         $result['data_record'] = $dataRec['name'];
     } elseif ($dataRec['subject'] != '') {
         $result['data_record'] = $dataRec['subject'];
     } elseif ($dataRec['title'] != '') {
         $result['data_record'] = $dataRec['title'];
     } elseif ($dataRec['display_name'] != '') {
         $result['data_record'] = $dataRec['display_name'];
     } else {
         $result['data_record'] = $dataRec['Id'];
     }
     $this->m_DataRecordName = $result['data_record'];
     if ($this->m_hasOwnerField) {
         $owner_id = $dataRec['owner_id'];
         $result['owner_id'] = $dataRec['owner_id'];
         if ($dataRec['owner_id'] != $dataRec['create_by']) {
             if ($dataRec['owner_id'] == $user_id) {
                 $result['shared_data'] = 3;
                 $result['editable'] = 1;
             } elseif ($dataRec['create_by'] == $user_id) {
                 $result['shared_data'] = 4;
                 $result['editable'] = 1;
             }
         }
     } else {
         $owner_id = $dataRec['create_by'];
     }
     $result['data_record'] = str_replace("<br />", "", $result['data_record']);
     $result['owner_perm'] = 3;
     $result['create_by'] = $dataRec['create_by'];
     $inputArr = $this->readInputRecord();
     $result['group_id'] = $dataRec['group_id'];
     $result['group_perm'] = isset($inputArr['group_perm']) ? $inputArr['group_perm'] : $dataRec['group_perm'];
     $result['other_perm'] = isset($inputArr['other_perm']) ? $inputArr['other_perm'] : $dataRec['other_perm'];
     $result['group_name'] = $this->_getGroupName($dataRec['group_id']);
     $result['owner_name'] = $this->_getOwnerName($owner_id);
     $result['creator_name'] = $this->_getOwnerName($dataRec['create_by']);
     $result['hasOwnerField'] = (int) $this->m_hasOwnerField;
     $result['form_title'] = $prtFormObj->m_Title;
     $result['action_timestamp'] = date("Y-m-d H:i:s");
     $result['refer_url'] = SITE_URL;
     if ($result['editable'] == 0) {
         $svcObj = BizSystem::GetService(DATAPERM_SERVICE);
         $result['editable'] = (int) $svcObj->checkDataPerm($dataRec, 3, $dataObj);
     }
     if ($result['editable'] == 0) {
         $result['has_ref_data'] = 0;
     }
     $this->m_RecordId = $result['Id'];
     $this->m_ParentRecordId = $result['Id'];
     //$this->setActiveRecord($result);
     if (BizSystem::allowUserAccess("data_manage.manage")) {
         $result['editable'] = 1;
         $result['data_manage'] = 1;
     } else {
         $result['data_manage'] = 0;
     }
     return $result;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:94,代码来源:DataSharingForm.php

示例5: BuildSQLRule

 public function BuildSQLRule($dataObj, $type, $hasOwnerField = false, $alias = false)
 {
     if (BizSystem::allowUserAccess("data_manage.manage")) {
         return " TRUE ";
     }
     $sql_where = null;
     $user_id = BizSystem::GetUserProfile('Id');
     $user_groups = BizSystem::GetUserProfile('groups');
     if ($hasOwnerField) {
         $sql_where = " ( ([create_by]='{$user_id}' OR [owner_id]='{$user_id}') ";
     } else {
         $sql_where = " ( [create_by]='{$user_id}' ";
     }
     if (GROUP_DATA_SHARE == 0) {
         return $sql_where . " ) ";
     }
     switch ($type) {
         default:
         case 'select':
             $perm_limit = ">=1";
             break;
         case 'update':
             $perm_limit = ">=2";
             break;
         case 'delete':
             $perm_limit = ">=3";
             break;
     }
     if (count($user_groups)) {
         $sql_where .= " OR ( [group_perm] {$perm_limit} AND (";
         foreach ($user_groups as $group_id) {
             $sql_where .= " [group_id] = '{$group_id}' OR ";
         }
         $sql_where .= " FALSE ) )";
     }
     $sql_where .= " OR [other_perm] {$perm_limit} ";
     $aclDO = BizSystem::getObject("common.do.DataACLDO");
     if ($aclDO && DATA_ACL) {
         $acl_table = $aclDO->m_MainTable;
         if ($type == 'select' || $alias == true) {
             $record_table = "T0";
         } else {
             $record_table = $dataObj->m_MainTable;
         }
         $record_main_table = $dataObj->m_MainTable;
         $record_id_field = $dataObj->getField("Id")->m_Column;
         $sql_where .= " OR (\n\t\t\t\t\t\t\t\tSELECT COUNT(*) FROM `{$acl_table}` WHERE \t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t`{$acl_table}`.`user_id`='{$user_id}' AND\n\t\t\t\t\t\t\t\t`{$acl_table}`.`record_table` = '{$record_main_table}' AND\n\t\t\t\t\t\t\t\t`{$acl_table}`.`record_id` = `{$record_table}`.`{$record_id_field}`\n\t\t\t\t\t\t\t\t )";
     }
     $sql_where .= " )";
     return $sql_where;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:51,代码来源:dataPermService.php

示例6: getConfig

 public function getConfig($widget = null)
 {
     if (!$widget) {
         if ($this->widgetForm) {
             $widget = $this->widgetForm;
         } else {
             $widget = $this->m_Name;
         }
     }
     $user_id = BizSystem::GetUserProfile("Id");
     $searchRule = "[widget]='{$widget}' AND [user_id]='{$user_id}'";
     $do = BizSystem::GetObject($this->m_UserWidgetDO);
     $configRec = $do->fetchOne($searchRule);
     $config = $configRec['config'];
     $configArr = unserialize($config);
     return $configArr;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:17,代码来源:WidgetForm.php


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