|
|
|
@ -58,6 +58,7 @@ class UserManager |
|
|
|
|
{ |
|
|
|
|
/** @var UserRepository $userRepository */ |
|
|
|
|
$userRepository = Database::getManager()->getRepository('ChamiloUserBundle:User'); |
|
|
|
|
|
|
|
|
|
return $userRepository; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -677,10 +678,11 @@ class UserManager |
|
|
|
|
* |
|
|
|
|
* @param int The ID of th user to be deleted |
|
|
|
|
* |
|
|
|
|
* @throws Exception |
|
|
|
|
* |
|
|
|
|
* @return bool true if user is successfully deleted, false otherwise |
|
|
|
|
* @assert (null) === false |
|
|
|
|
* @assert ('abc') === false |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
public static function delete_user($user_id) |
|
|
|
|
{ |
|
|
|
@ -967,6 +969,7 @@ class UserManager |
|
|
|
|
$r = Database::query($sql); |
|
|
|
|
if ($r !== false) { |
|
|
|
|
Event::addEvent(LOG_USER_DISABLE, LOG_USER_ID, $ids); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1002,6 +1005,7 @@ class UserManager |
|
|
|
|
$r = Database::query($sql); |
|
|
|
|
if ($r !== false) { |
|
|
|
|
Event::addEvent(LOG_USER_ENABLE, LOG_USER_ID, $ids); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1034,6 +1038,7 @@ class UserManager |
|
|
|
|
if (Database::query($sql) !== false) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4098,8 +4103,10 @@ class UserManager |
|
|
|
|
$sql = "INSERT INTO $table_user_tag_values SET user_id = $user_id, tag_id = $last_insert_id"; |
|
|
|
|
Database::query($sql); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4354,6 +4361,7 @@ class UserManager |
|
|
|
|
|
|
|
|
|
return $whereFilter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4362,8 +4370,9 @@ class UserManager |
|
|
|
|
* |
|
|
|
|
* @param string $query the value of the search box |
|
|
|
|
* |
|
|
|
|
* @return string HTML form |
|
|
|
|
* @throws Exception |
|
|
|
|
* |
|
|
|
|
* @return string HTML form |
|
|
|
|
*/ |
|
|
|
|
public static function get_search_form($query, $defaultParams = []) |
|
|
|
|
{ |
|
|
|
@ -5098,6 +5107,7 @@ class UserManager |
|
|
|
|
|
|
|
|
|
return $row['uid']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5276,7 +5286,8 @@ class UserManager |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns an array of the different types of user extra fields [id => title translation] |
|
|
|
|
* Returns an array of the different types of user extra fields [id => title translation]. |
|
|
|
|
* |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|
public static function get_user_field_types() |
|
|
|
@ -5417,6 +5428,7 @@ class UserManager |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $inserted; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5774,6 +5786,7 @@ SQL; |
|
|
|
|
|
|
|
|
|
return Display::tabsOnlyLink($headers, $optionSelected); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5933,6 +5946,7 @@ SQL; |
|
|
|
|
* Send user confirmation mail. |
|
|
|
|
* |
|
|
|
|
* @param User $user |
|
|
|
|
* |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
public static function sendUserConfirmationMail(User $user) |
|
|
|
@ -5990,6 +6004,7 @@ SQL; |
|
|
|
|
* |
|
|
|
|
* @param int $user_id |
|
|
|
|
* @param int $active Enable or disable |
|
|
|
|
* |
|
|
|
|
* @return bool True on success, false on failure |
|
|
|
|
* @assert (-1,0) === false |
|
|
|
|
* @assert (1,1) === true |
|
|
|
|