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


PHP Roles::loadByCode方法代码示例

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


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

示例1: LoginLog

     $oDataset = UsersPeer::DoSelectRs($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $Login = new LoginLog();
     $aLogin = $Login->getLastLoginAllUsers();
     $Cases = new AppCacheView();
     $aCases = $Cases->getTotalCasesByAllUsers();
     $Department = new Department();
     $aDepart = $Department->getAllDepartmentsByUser();
     $aAuthSources = $RBAC->getAllAuthSourcesByUser();
     require_once PATH_CONTROLLERS . 'adminProxy.php';
     $uxList = adminProxy::getUxTypesList();
     $oRoles = new Roles();
     $rows = array();
     while ($oDataset->next()) {
         $row = $oDataset->getRow();
         $uRole = $oRoles->loadByCode($row['USR_ROLE']);
         $row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? $uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE'] : $uRole['USR_ROLE'];
         $row['DUE_DATE_OK'] = date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE'])) ? 0 : 1;
         $row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';
         $row['TOTAL_CASES'] = isset($aCases[$row['USR_UID']]) ? $aCases[$row['USR_UID']] : 0;
         $row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : '';
         $row['USR_UX'] = isset($uxList[$row['USR_UX']]) ? $uxList[$row['USR_UX']] : $uxList['NORMAL'];
         $row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
         $rows[] = $row;
     }
     echo '{users: ' . G::json_encode($rows) . ', total_users: ' . $totalRows . '}';
     break;
 case 'updatePageSize':
     G::LoadClass('configuration');
     $c = new Configurations();
     $arr['pageSize'] = $_REQUEST['size'];
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:users_Ajax.php

示例2: uxUserUpdate

 public function uxUserUpdate($httpData)
 {
     require_once 'classes/model/Users.php';
     $data = G::json_decode($httpData->users);
     $list = array();
     if (!is_array($data)) {
         $list[0] = (array) $data;
     } else {
         $list = $data;
     }
     $oRoles = new Roles();
     $rows = array();
     foreach ($list as $value) {
         $value = (array) $value;
         $user = UsersPeer::retrieveByPK($value['USR_UID']);
         $user->setUsrUx($value['USR_UX']);
         $user->save();
         $row = $user->toArray(BasePeer::TYPE_FIELDNAME);
         try {
             $uRole = $oRoles->loadByCode($row['USR_ROLE']);
         } catch (exception $oError) {
             $uRole['ROL_NAME'] = G::loadTranslation('ID_DELETED');
         }
         $row['USR_ROLE_ID'] = $row['USR_ROLE'];
         $row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? $uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE'] : $uRole['USR_ROLE'];
         $uxList = self::getUxTypesList();
         $row['USR_UX'] = $uxList[$user->getUsrUx()];
         $rows[] = $row;
     }
     if (count($rows) == 1) {
         $retRow = $rows[0];
     } else {
         $retRow = $rows;
     }
     return array('success' => true, 'message' => 'done', 'users' => $retRow);
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:36,代码来源:adminProxy.php

示例3: loadDetailed

    public function loadDetailed ($UsrUid)
    {
        try {
            $result = array ();
            $oUser = UsersPeer::retrieveByPK( $UsrUid );

            if (! is_null( $oUser )) {
                $aFields = $oUser->toArray( BasePeer::TYPE_FIELDNAME );
                $this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
                $this->setNew( false );

                $aIsoCountry = IsoCountry::findById( $aFields['USR_COUNTRY'] );
                $aIsoSubdivision = IsoSubdivision::findById( $aFields['USR_COUNTRY'], $aFields['USR_CITY'] );
                $aIsoLocation = IsoLocation::findById( $aFields['USR_COUNTRY'], $aFields['USR_CITY'], $aFields['USR_LOCATION'] );

                $aFields["USR_COUNTRY_NAME"]  = (!empty($aIsoCountry["IC_NAME"]))? $aIsoCountry["IC_NAME"] : "";
                $aFields["USR_CITY_NAME"]     = (!empty($aIsoSubdivision["IS_NAME"]))? $aIsoSubdivision["IS_NAME"] : "";
                $aFields["USR_LOCATION_NAME"] = (!empty($aIsoLocation["IL_NAME"]))? $aIsoLocation["IL_NAME"] : "";

                require_once PATH_RBAC . "model/Roles.php";
                $roles = new Roles();
                $role = $roles->loadByCode($aFields['USR_ROLE']);
                $aFields['USR_ROLE_NAME'] = $role['ROL_NAME'];

                $result = $aFields;

                return $result;
            } else {
                //return $result;
                throw (new Exception(G::LoadTranslation("ID_USER_UID_DOESNT_EXIST", SYS_LANG, array("USR_UID" => $UsrUid))));
            }
        } catch (Exception $oError) {
            throw ($oError);
        }
    }
开发者ID:nhenderson,项目名称:processmaker,代码行数:35,代码来源:Users.php


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