user
📦 UserTS
Class UserToosmart Object-oriented wrapper for user-related functions
function __construct(?string $userId = null)
{
global $user;
$this->userId = $userId ?? $user->id;
$userData = fwc6_data_user_get($this->userId);
if ($userData) {
$this->nom = $userData['nom'] ?? null;
$this->prenom = $userData['prenom'] ?? null;
$this->email = $userData['email'] ?? null;
$this->langue = $userData['langue'] ?? null;
$this->externe = $userData['externe'] ?? null;
// ... (truncated)
🔧 __construct
Constructor
function __construct(?string $userId = null)
{
global $user;
$this->userId = $userId ?? $user->id;
$userData = fwc6_data_user_get($this->userId);
if ($userData) {
$this->nom = $userData['nom'] ?? null;
$this->prenom = $userData['prenom'] ?? null;
$this->email = $userData['email'] ?? null;
$this->langue = $userData['langue'] ?? null;
$this->externe = $userData['externe'] ?? null;
// ... (truncated)
⚙️ Parameters
- $userId (string|null) User ID (optional, defaults to current user)
🔧 getUserIdentification
Get user identification details
function getUserIdentification(?string $idChecker = "", $thisIdType = null, bool $allFranchiseDocuments = false): ?array
{
return get_UserIdentification($this->userId, $idChecker, $thisIdType, $allFranchiseDocuments);
}
⚙️ Parameters
- $idChecker (string|null) The ID of the user linked to the object
- $thisIdType (mixed|null) The ID of the object to check
- $allFranchiseDocuments (bool) Whether to get all franchise documents
↩️ Returns
(array|null) User identification details
🔧 getUserId
Get the user ID
function getUserId(): string
{
return $this->userId;
}
↩️ Returns
(string) User ID
🔧 setUserId
Set the user ID
function setUserId(string $userId): self
{
$this->userId = $userId;
return $this;
}
⚙️ Parameters
- $userId (string) New user ID
↩️ Returns
(self) For method chaining
🔧 getAgendasCredentials
Retrieves all CalDAV calendar configurations for the user This method combines both user-specific and franchise-specific calendar configurations
function getAgendasCredentials(): array
{
return array_merge($this->getPersonnalAgendaCredentials(), $this->getFranchiseAgendaCredentials());
}
↩️ Returns
(array) Array of calendar configurations
🔧 fwc7_TS_NOOA_user_infos
Fonction permettant la collecte et la mise en forme des informations de l'utilisateur connecté
function fwc7_TS_NOOA_user_infos($email){
global $user;
$userConnect = fwd7_user_detail($user->id,$email);
$idUser = $userConnect["user_id"];
// Création du bloc info user/groupe/profil/filiale
$userInfos = array();
$findGroups = array_keys(fwc7_droit_user_groups('', $userConnect['user_id']));
$userInfos["group"] = array_values(fwc7_data_user_groups_list('',$user->id))[0]["id_group"];
$userInfos["profil"] = array_values(fwd7_user_profils_list('',$user->id))[0]["id_group"];
$userInfos["user_id"] = $idUser;
$findProfil = fwc7_data_profil('', $findGroups[0]);
// ... (truncated)
↩️ Returns
(array)