Gene6 FTP Server Forum: Modifié les proprétés en Php - Gene6 FTP Server Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Modifié les proprétés en Php Rate Topic: -----

#1 User is offline   Codspirit 

  • Mr Code
  • Group: Moderators
  • Posts: 3317
  • Joined: 23-August 04
  • Gender:Male
  • Location:France
  • Interests:Coding, Scripting ...

  Posted 23 August 2004 - 05:21 PM

J'ai un souci avec l'utilisation de l'object COM en php, j'ai essayé ceci :

CODE
$g6Manager = new COM("G6FTPServer.Manager")  or die ("Objet G6FTP impossible à créer.");
$g6Domaine =& $g6Manager->Domains->Item(0) or die ("Impossible d'accéder au domaine");

if ( $g6User =& $g6Domaine->UserList->item( $username ) )
{
    echo "Le compte existe ...<br>";    
} else {
    echo "Le compte n'existe pas...<br>";
    $g6User =& $g6Domaine->UserList->Add( $username )   or die ("Impossible de crééer le compte");    
}

if ( $g6User->Properties->values("Enabled") == 0 ) {
    echo "Le compte n'est pas activé : activation...<br>";
  $g6Val =& $g6User->Properties->values("Enabled");
  $g6Val->value = "1";
  $g6User->Properties->ApplyChanges();
}

if ( $g6User->Properties->values("Enabled") == 0 ) {
    echo "Le compte n'est toujours pas activé .<br>";
}


Le compte est bien créé, mais impossible de modifier la propriété "Enabled" (ou toute autre propriété) sad.gif

J'ai l'impression que c'est PHP qui est limité ... mad.gif

Si quelqu'un a une idée ... je suis preneur biggrin.gif
If you get a "file not found" error when folowing a link to my ftp, please use your favorite ftp client and try getting the file again.
(I have some case sensivity problems)

Please do not use PM for support
0

#2 User is offline   Matthieu 

  • Addicted Member
  • Group: Staff
  • Posts: 1964
  • Joined: 22-October 03
  • Gender:Male
  • Location:France : Mouy
  • Interests:Science-fiction, World news

Posted 23 August 2004 - 05:31 PM

En effet, j'avais déjà essayé de faire un test en php et j'étais arrivé au même point, impossible d'assigner une valeur à une propriété sad.gif Je ne sais pas si c'est une limitation de php avec les objets com ou si je fais qqchose incorrectement.
Gene6, SARL
Do not use PM to ask for support, use the forum or support email.

Special offer : 10% discount with coupon code : DISCOUNT
0

#3 User is offline   Codspirit 

  • Mr Code
  • Group: Moderators
  • Posts: 3317
  • Joined: 23-August 04
  • Gender:Male
  • Location:France
  • Interests:Coding, Scripting ...

Posted 23 August 2004 - 07:16 PM

Ok ... sad.gif

Cependant j'ai lu dans la doc de Php qu'il était possible d'assigner des valeurs à de "vrais" tableaux.
On peut donc imaginer un tableau à la place du Values, non ?

Autre suggestion : une méthode SetValue(PropertyName, NewValue) à l'object Properties pourrait résoudre également le problème ?

En attendant, je vais attaquer directement les fichiers, je ne croit pas avoir d'autre solution ... huh.gif
If you get a "file not found" error when folowing a link to my ftp, please use your favorite ftp client and try getting the file again.
(I have some case sensivity problems)

Please do not use PM for support
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users