problème installation

cancel
Showing results for 
Search instead for 
Did you mean: 
benoist
Member II

problème installation

Bonjour,

je viens d'intaller josco et j'ai un gros problème

depuis lorsque je tente de me logger sur l'admin j'ai un beau message d'erreur au milieu d'une page blanche :


Parse error: syntax error, unexpected '{' in /homez.10/photoset/www/test/01/plugins/authentication/joosco.php on line 67
:shock:
et puis rien je ne peux acceder au rien d'autre  :evil:  :evil:  :twisted:  :twisted:

please AIDEZ MOI

Merci d'avance pour tous renseignements

benoist
3 Replies
benoist
Member II

Re: problème installation

je suis vraiment désolé mais je ne vois pas ou il faut faire la modif

voici le code de la ligne 66 à 70


66 $ticket = null;
67      
68      try {
69         // Try to create a ticket
70         $ticket = $repository->authenticate($userName, $password);

Merci d'avance
benoist
Member II

Re: problème installation

merci de ton aide voici le code

function onAuthenticate( $credentials, $options, &$response )
   {
      // This file is needed to use the Repository class
      require_once (dirname(__FILE__).'/alfresco-php-library/Repository.php');

      // Get the URL of the Alfresco repository as a parameter of the plugin
      $plugin =& JPluginHelper::getPlugin('authentication', 'joosco');
      $pluginParams = new JParameter( $plugin->params );

      // Set the variables
      $repositoryUrl = $pluginParams->get('alf-url');
      $userName = $credentials['username'];
      $password = $credentials['password'];

      // Connect to the repository
      $repository = new Repository($repositoryUrl);
      $ticket = null;
      
      try {
         // Try to create a ticket
         $ticket = $repository->authenticate($userName, $password);

         // If the ticket fails, it means that the username and/or password are wrong
         $_SESSION["ticket"] = $ticket;
         $response->status = JAUTHENTICATE_STATUS_SUCCESS;

         // There's no way to get the Alfresco name or email address of the user
         // The only thing to do is wait for an update of the Alfresco PHP API
         $response->username = $credentials['username'];
         $response->email = $credentials['username']."@alfresco.user";
         $response->fullname = $credentials['username'];
      }
      catch (Exception $e) {
         // Wrong username or password creates an exception
         $response->status = JAUTHENTICATE_STATUS_FAILURE;
         $response->error_message = 'Authentication failed';
      }

   }
}

je t'ai mis de code quasi complet car je ne vois vraiment pas ou il manque un { / }

Merci
kreaclic
Member II

Re: problème installation

Bonjour,

Je tente d'installer joosco. Comme Benoist j'ai un problème d'installation qui m'indique la même erreur ligne 67 dans joosco.php à savoir
"Parse error: syntax error, unexpected '{' in /homez.184/ecovexin/www/plugins/authentication/joosco.php on line 67"

Le problème est que je n'ai pas le même code que Benoist

Je joins le code de u fichier. Peut-être pourrez-vous m'éclairer car je ne trouve pas d'accolade manquante mais je ne suis pas une experte en code…


Merci

<?php

/**

* @version      $Id: alfresco.php $

* @package      D-Bog

* @subpackage   Joosco

* @copyright   (C) 2007 SARL D-Bog

* @license      GNU/GPL, see LICENSE.php

*/



// Check to ensure this file is included in Joomla!

defined('_JEXEC') or die();



jimport('joomla.event.plugin');



/**

* Joosco Authentication Plugin

*

* @author Dhjiz Trevian <dhjiz@d-bog.com>

* @package      D-Bog

* @subpackage   Joosco

* @since 1.5

*/

class plgAuthenticationJoosco extends JPlugin

{

   /**

    * Constructor

    *

    * For php4 compatability we must not use the __constructor as a constructor for plugins

    * because func_get_args ( void ) returns a copy of all passed arguments NOT references.

    * This causes problems with cross-referencing necessary for the observer design pattern.

    *

    * @param object $subject The object to observe

    * @since 1.5

    */

   function plgAuthenticationJoosco(& $subject) {

      parent::__construct($subject);

   }



   /**

    * This method should handle any authentication and report back to the subject

    *

    * @access   public

    * @param   array    $credentials Array holding the user credentials   

    * @param    array   $options     Array of extra options

    * @param   object   $response   Authentication response object

    * @return   boolean

    * @since 1.5

    */

   function onAuthenticate( $credentials, $options, &$response )

   {

      // This file is needed to use the Repository class

      require_once (dirname(__FILE__).'/alfresco-php-library/Repository.php');



      // Get the URL of the Alfresco repository as a parameter of the plugin

      $plugin =& JPluginHelper::getPlugin('authentication', 'joosco');

      $pluginParams = new JParameter( $plugin->params );



      // Set the variables

      $repositoryUrl = $pluginParams->get('alf-url');

      $userName = $credentials['username'];

      $password = $credentials['password'];



      // Connect to the repository

      $repository = new Repository($repositoryUrl);

      $ticket = null;

      

      try {

         // Try to create a ticket

         $ticket = $repository->authenticate($userName, $password);



         // If the ticket fails, it means that the username and/or password are wrong

         $_SESSION["ticket"] = $ticket;

         $response->status = JAUTHENTICATE_STATUS_SUCCESS;



         // There's no way to get the Alfresco name or email address of the user

         // The only thing to do is wait for an update of the Alfresco PHP API

         $response->username = $credentials['username'];

         $response->email = $credentials['username']."@alfresco.user";

         $response->fullname = $credentials['username'];

      }

      catch (Exception $e) {

         // Wrong username or password creates an exception

         $response->status = JAUTHENTICATE_STATUS_FAILURE;

         $response->error_message = 'Authentication failed';

      }



   }

}

?>