當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Groups::removeUserOfGroup方法代碼示例

本文整理匯總了PHP中Groups::removeUserOfGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::removeUserOfGroup方法的具體用法?PHP Groups::removeUserOfGroup怎麽用?PHP Groups::removeUserOfGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Groups的用法示例。


在下文中一共展示了Groups::removeUserOfGroup方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeUserFromGroup

    /**

     * remove user from group

     *

     * @param string $appDocUid

     * @return $result will return an object

     */

    public function removeUserFromGroup ($userId, $groupId)

    {

        try {

            G::LoadClass( 'groups' );

            global $RBAC;



            $RBAC->initRBAC();

            $user = $RBAC->verifyUserId( $userId );



            if ($user == 0) {

                $result = new wsResponse( 3, G::loadTranslation( 'ID_USER_NOT_REGISTERED_SYSTEM' ) );



                return $result;

            }



            $groups = new Groups();

            $very_group = $groups->verifyGroup( $groupId );



            if ($very_group == 0) {

                $result = new wsResponse( 9, G::loadTranslation( 'ID_GROUP_NOT_REGISTERED_SYSTEM' ) );



                return $result;

            }



            $very_user = $groups->verifyUsertoGroup( $groupId, $userId );



            if ($very_user == 1) {

                $oGroup = new Groups();

                $oGroup->removeUserOfGroup( $groupId, $userId );

                $result = new wsResponse( 0, G::loadTranslation( 'ID_COMMAND_EXECUTED_SUCCESSFULY' ) );



                return $result;

            }



            //$oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);

            $result = new wsResponse( 8, G::loadTranslation( 'ID_USER_NOT_REGISTERED_GROUP' ) );



            return $result;

        } catch (Exception $e) {

            $result = new wsResponse( 100, $e->getMessage() );



            return $result;

        }



//.........這裏部分代碼省略.........
開發者ID:nhenderson,項目名稱:processmaker,代碼行數:101,代碼來源:class.wsBase.php

示例2: groupRemoveUsers

 public function groupRemoveUsers($groupUid, array $arrayUserUid)
 {
     try {
         $group = new Groups();
         foreach ($arrayUserUid as $value) {
             $userUid = $value;
             $group->removeUserOfGroup($groupUid, $userUid);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:emildev35,項目名稱:processmaker,代碼行數:12,代碼來源:ldapadvanced.php

示例3: explode

        break;
    case 'assignUsersToGroupsMultiple':
        $GRP_UID = $_POST['GRP_UID'];
        $uUIDs = explode(',', $_POST['USR_UID']);
        G::LoadClass('groups');
        $oGroup = new Groups();
        foreach ($uUIDs as $USR_UID) {
            $oGroup->addUserToGroup($GRP_UID, $USR_UID);
        }
        break;
    case 'deleteUsersToGroupsMultiple':
        $GRP_UID = $_POST['GRP_UID'];
        $uUIDs = explode(',', $_POST['USR_UID']);
        G::LoadClass('groups');
        $oGroup = new Groups();
        foreach ($uUIDs as $USR_UID) {
            $oGroup->removeUserOfGroup($GRP_UID, $USR_UID);
        }
        break;
    case 'updatePageSize':
        G::LoadClass('configuration');
        $c = new Configurations();
        $arr['pageSize'] = $_REQUEST['size'];
        $arr['dateSave'] = date('Y-m-d H:i:s');
        $config = array();
        $config[] = $arr;
        $c->aConfig = $config;
        $c->saveConfig('groupList', 'pageSize', '', $_SESSION['USER_LOGGED']);
        echo '{success: true}';
        break;
}
開發者ID:ralpheav,項目名稱:processmaker,代碼行數:31,代碼來源:groups_Ajax.php

示例4: delete

 /**
  * Unassign User of the Group
  *
  * @param string $groupUid Unique id of Group
  * @param string $userUid  Unique id of User
  *
  * return void
  */
 public function delete($groupUid, $userUid)
 {
     try {
         //Verify data
         $process = new \ProcessMaker\BusinessModel\Process();
         $group = new \ProcessMaker\BusinessModel\Group();
         $group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
         $process->throwExceptionIfNotExistsUser($userUid, $this->arrayFieldNameForException["userUid"]);
         $this->throwExceptionIfNotExistsGroupUser($groupUid, $userUid, $this->arrayFieldNameForException["userUid"]);
         //Delete
         $group = new \Groups();
         $group->removeUserOfGroup($groupUid, $userUid);
     } catch (\Exception $e) {
         throw $e;
     }
 }
開發者ID:emildev35,項目名稱:processmaker,代碼行數:24,代碼來源:User.php


注:本文中的Groups::removeUserOfGroup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。