本文整理汇总了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);
}
}
示例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]);
}
}
}
示例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;
}