當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。