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


PHP EfrontUser::verifyUsersList方法代码示例

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


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

示例1: setRoles

 /**
  * Set user roles in lesson
  *
  * This function sets the role for the specified user
  * <br/>Example:
  * <code>
  * $lesson -> addUsers('jdoe', 'student');              //Added the user 'jdoe' in the lesson, having the role 'student'
  * $lesson -> setRoles('jdoe', 'professor');                //Updated jdoe's role to be 'professor'
  * </code>
  * Multiple values can be set if arguments are arrays
  *
  * @param mixed $login The user login name
  * @param mixed $role The user role for this lesson
  * @return boolean true if everything is ok
  * @since 3.5.0
  * @access public
  */
 public function setRoles($users, $roles)
 {
     $users = EfrontUser::verifyUsersList($users);
     $roles = EfrontUser::verifyRolesList($roles, sizeof($users));
     foreach ($users as $key => $value) {
         eF_updateTableData("users_to_lessons", array('archive' => 0, 'user_type' => $roles[$key]), "users_LOGIN='" . $value . "' and lessons_ID=" . $this->lesson['id']);
         //$cacheKey = "user_lesson_status:lesson:".$this -> lesson['id']."user:".$value;
         //EfrontCache::getInstance()->deleteCache($cacheKey);
     }
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:27,代码来源:lesson.class.php

示例2: setRoles

 /**
  * Set user roles in course
  *
  * This function sets the role for the specified user in the course
  * <br/>Example:
  * <code>
  * $course -> addUsers('jdoe', 'student');              //Added the user 'jdoe' in the lesson, having the role 'student'
  * $course -> setRoles('jdoe', 'professor');                //Updated jdoe's role to be 'professor'
  * </code>
  * Multiple values can be set if arguments are arrays
  *
  * @param mixed $users The user login name
  * @param mixed $roles The user role for this course
  * @since 3.5.0
  * @access public
  */
 public function setRoles($users, $roles)
 {
     $users = EfrontUser::verifyUsersList($users);
     $roles = EfrontUser::verifyRolesList($roles, sizeof($users));
     $courseLessons = $this->getCourseLessons();
     foreach ($users as $key => $value) {
         $fields = array('user_type' => $roles[$key]);
         $where = "users_LOGIN='" . $value . "' and courses_ID=" . $this->course['id'];
         self::persistCourseUsers($fields, $where, $this->course['id'], $value);
         foreach ($courseLessons as $lessonId => $lesson) {
             $lesson->setRoles($value, $roles[$key]);
         }
     }
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:30,代码来源:course.class.php

示例3: removeUsers

 /**
  * Remove users from group
  *
  * This function is used to remove users from the current group
  * <br>Example:
  * <code>
  * $group = new EfrontGroup(2);
  * $group -> removeUsers(array('jdoe', 'doej'));
  * </code>
  *
  * @param mixed $users An array of user logins or EfrontUser objects, or a single login or EfrontUser object
  * @return boolean True if everything is ok
  * @since 3.5.2
  * @access public
  */
 public function removeUsers($users)
 {
     $users = EfrontUser::verifyUsersList($users);
     foreach ($users as $user) {
         eF_deleteTableData("users_to_groups", "users_LOGIN='" . $user . "' and groups_ID=" . $this->group['id']);
     }
     return true;
 }
开发者ID:bqq1986,项目名称:efront,代码行数:23,代码来源:group.class.php


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