Bloqué l'accès aux utilisateurs d'un certain groupe !

Réduire
X
 
  • Filtrer
  • Heure
  • Afficher
Tout effacer
nouveaux messages

  • [Problème] Bloqué l'accès aux utilisateurs d'un certain groupe !

    Bonjour,

    Je souhaiterais que les utilisateurs enregistré sur mon site ( non-membre ) ne puisse pas s'inscrire à certains événements proposé. Le calendrier que j'utilise s'appelle Ohanah.

    Il faut que je change le
    Code PHP:
    JFactory::getUser()->guest 
    de mon code pour que ce soit les utilisateurs du groupe (id 9) qui ne puisse pas s'enregistré.

    Mais je ne sais pas comment faire ! Quelqu'un pourrais m'aider ?

    Code PHP:
    if ($event->who_can_register == '0' && JFactory::getUser()->guest) {
        
    $str 'OHANAH_REGISTRATION_IS_DISABLED_FOR_GUESTS'$text JText::_($str);
        
    $output = ($text == "" || $text == $str) ? 'Registration for this event is disabled for guests.' $text;
    } else { 
    Voici le code source du fichier pour l'inscription :

    Code PHP:
    <?php
    /**
     * @package        com_ohanah
     * @copyright    Copyright (C) 2012 Beyounic SA. All rights reserved.
     * @license        GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
     * @link        http://www.beyounic.com
     */

    defined'_JEXEC' ) or die( 'Restricted access' );

    class 
    ComOhanahViewRegistrationHtml extends ComOhanahViewHtml
    {
        public function 
    display()
        {
            
    $params JComponentHelper::getParams('com_ohanah');

            
    $event $this->getService('com://site/ohanah.model.events')->id(KRequest::get('get.ohanah_event_id''int'))->getItem();

            if (
    $event->isPast()) {
                
    $str 'OHANAH_THIS_IS_PAST_EVENT'$text JText::_($str);
                return (
    $text == "" || $text == $str) ? 'This is a past event. You cannot register for past event.' $text;
            }

            
    $output '';

            
    $date = new KDate();
            if (
    $event->who_can_register == '2') { // who can register = nobody
                
    $str 'OHANAH_REGISTRATION_IS_DISABLED'$text JText::_($str);
                
    $output = ($text == "" || $text == $str) ? 'Registration is disabled' $text;
            } else {
                if (
    $event->who_can_register == '1,0' && JFactory::getUser()->guest) { // who can register = registered and members but this is guest
                    
    $str 'OHANAH_REGISTRATION_IS_DISABLED_FOR_GUESTS'$text JText::_($str);
                    
    $output = ($text == "" || $text == $str) ? 'Registration for this event is disabled for guests. Please log in to be able to register.' $text;
                } else {     
                    if (
    $event->who_can_register == '0' && JFactory::getUser()->guest) { // who can register = registered and members but this is guest
                        
    $str 'OHANAH_REGISTRATION_IS_DISABLED_FOR_GUESTS'$text JText::_($str);
                        
    $output = ($text == "" || $text == $str) ? 'Registration for this event is disabled for guests. Please log in to be able to register.' $text;
                    } else {
                    
                    
    // now we must check if time for registration expired

                    
    if (($event->close_registration_day == '0000-00-00') || ($event->close_registration_day == '1970-01-01') || ($date->format('%Y-%m-%d') <= $event->close_registration_day)) {
                        
    JFactory::getDocument()->setTitle(JText::sprintf('OHANAH_REGISTRATION_TO_THE_EVENT'$event->title));
                        
    JFactory::getDocument()->setDescription($event->description strip_tags($event->description) : $event->title);

                        
    $output parent::display();

                        
    $this->getService('com://site/ohanah.template.filter.chrome', array(
                            
    'title' => $event->title,
                            
    'class' => array($params->get('moduleclass_sfx')),
                            
    'styles' => array($params->get('module_chrome'))))
                            ->
    write($output);
                    } else { 
    // time passed
                        
    $str 'OHANAH_REGISTRATION_EXPIRED'$text JText::_($str);
                        
    $output = ($text == "" || $text == $str) ? 'Registration for this event is no longer possible' $text;
                    }
                }
                }
            }
            return 
    $output;
        }
    }
    Nathanaël Dürst
    Dürst Webmaster Corp.
    Contactez-nous !

Annonce

Réduire
Aucune annonce pour le moment.

Partenaire de l'association

Réduire

Hébergeur Web PlanetHoster
Travaille ...
X