USER ACCES CONTROL

Moderators: Aidan38, sarki

Forum rules
Règles du forum
Locked
maiky
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Tue Jul 01, 2014 9:03 am

USER ACCES CONTROL

Post by maiky » Tue Jul 01, 2014 9:13 am

BJR LES AMIS(ES),

POUR UN BESOIN ASSEZ PARTICULIER J'AIMERAIS TROUVER LE MOYEN DE SUPPRIMER AUTOMATIQUEMENT UN UTILISATEUR DE MON SITE LORSQUE CELUI CI SE DECONNECTE.

COMMENT Y ARRIVER MERCI.

Aidan38
Joomla! Ace
Joomla! Ace
Posts: 1394
Joined: Mon Aug 06, 2012 8:51 am
Location: France Paris/Grenoble
Contact:

Re: USER ACCES CONTROL

Post by Aidan38 » Tue Jul 01, 2014 9:20 am

Bonjour et bienvenue,

je ne pense pas qu'il soit possible de faire cela nativement avec Joomla!.

Une solution serait d'utiliser Community Builder et CBSubs qui permettrait de désactiver le compte.

A l'avenir, merci de ne pas tout écrire en lettre capitale.
Learn how create your website with Joomla! 4 The book https://cinnk.com/en/books/joomla-4-the-book
Create your online shop with Joomla! & HikaShop https://cinnk.com/en/books/create-your- ... a-hikashop

maiky
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Tue Jul 01, 2014 9:03 am

Re: USER ACCES CONTROL

Post by maiky » Tue Jul 01, 2014 6:39 pm

ok merci, pouvez vous me dire comment trouver le script qui permet de désactiver un utilisateur connecter je veux tenter certaines manip

maiky
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Tue Jul 01, 2014 9:03 am

Re: USER ACCES CONTROL

Post by maiky » Tue Jul 29, 2014 12:08 pm

Re bonjour a vous

jai trouver le script qui permet de deconnecté un utilisateur. Du coup je peux parti de là pour aboutir a ma quette.

Si je suppose que l'on peut obtenir les details de l'utilistateurs à partir du script

$user =& JFactory::getUser();
$id =$user->get('id');

je peux dès lors rechercher $id dans la base de donnée et supprimer toute la ligne je place ce script juste après le logout script.

Ca pourrait marcher???

maiky
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Tue Jul 01, 2014 9:03 am

Re: USER ACCES CONTROL

Post by maiky » Tue Jul 29, 2014 12:22 pm

Voici le code que j'ai écris. Avec ce code l'utilisteur est deconnecter mais n'est pas supprimé

public function logout()
{
JSession::checkToken('request') or jexit(JText::_('JInvalid_Token'));

$app = JFactory::getApplication();

// Perform the log in.
$error = $app->logout();

// Check if the log out succeeded.
if (!($error instanceof Exception)) {
// Get the return url from the request and validate that it is internal.
$return = JRequest::getVar('return', '', 'method', 'base64');
$return = base64_decode($return);
if (!JURI::isInternal($return)) {
$return = '';
}
$user =& JFactory::getUser();
$id =$user->get('id');

mysql_connect('xxxxxx','xxxxx','xxxxx') or die ("Connexion failed");

mysql_select_db("xxxxxx");

$query = "DELETE FROM `prefix_users` WHERE `id`= $id";

mysql_close();

$app->redirect(JRoute::_($return, false));
} else {
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
}
}


Locked

Return to “French Forum”