download siteweb.php
Language: PHP
License: GPL
Copyright: (C) 2002 Loc Dayot - Mairie de Pierrefitte (93)
LOC: 455
Project Info
epnadmin
Server: Savannah NonGNU
Type: cvs
...epnadmin\epnadmin\epnadmin\
   6cartes.inc.php
   add_message.sh
   add_message_file.sh
   animateur.php
   ...eurs-disponibilites.php
   animateurs-horaires.php
   animateurs.inc.php
   autoeval.js
   barcode.inc.php
   basdepage.inc.php
   camembert.inc.php
   cartes.inc.php
   common.initial.sql
   config.php
   configuration.php
   constantes.inc.php
   courriel.php
   dateheure.inc.php
   debug.inc.php
   domaines.php
   en.lang.inc.php
   entete.inc.php
   epnadmin.css
   epnadminv.css
   exemple.sql
   fonctions.inc.php
   footer.inc.php
   fr.initial.sql
   fr.lang.inc.php
   header.inc.php
   horaires.php
   i25object.inc.php
   image.inc.php
   index.php
   initial.sql
   initiations.inc.php
   initiations.php
   inscription_session.php
   localisations.php
   logiciels.php
   materiels.php
   menu2.js
   mysql.inc.php
   parcours.inc.php
   parcours.php
   positionnement.php
   prets.php
   print.php
   questions.php
   remove_message.sh
   reservations.inc.php
   reservations.php
   session.php
   sessions.inc.php
   siteweb.inc.php
   siteweb.php
   stats.php
   structure.sql
   structures.inc.php
   structures.php
   table_horaire.php
   table_horaire_session.php
   tableaux.inc.php
   tarifs.php
   themes.php
   usagers.inc.php
   usagers.php
   usages.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
<?php
/*
    Copyright (C) 2002 Loc Dayot - Mairie de Pierrefitte (93)

    EPNadmin - Version 0.6

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://epnadmin.pierrefitte93.fr/
*/

require_once("header.inc.php");
require_once("constantes.inc.php");             // dfinition des constantes
if (!defined("FCT_SITES"))
{
	echo $fctnonactive;
	exit;
}
require_once("fonctions.inc.php");              // concernant des fonctions transversales inclassables
require_once("mysql.inc.php");                  // concernant mysql
//require_once("sessions.inc.php");             // concernant les sessions et initiations
//require_once("usagers.inc.php");              // concernant la gestion des usagers
//require_once("reservations.inc.php");         // concernant les rservations des postes en accs individuel par des usagers
//require_once("tableaux.inc.php");             // Concernant l'affichage transpos d'un tableau
require_once("siteweb.inc.php");              // concernant les pages perso des usagers et les sites web des structures
//require_once("dateheure.inc.php");            // concernant la manipulation des heures et des dates, formulaire, conversion...
require_once("structures.inc.php");           // concernant les structures
//require_once("initiations.inc.php");          // concernant les initiations et les thmes
//require_once("parcours.inc.php");             // concernant les parcours des usagers et leur positionnement

$ptitr=$ssites;
$titr = $stitresites;
define("COULEUR", COULEUR_SITES);
$datemaj="3 mai 2003";
require("entete.inc.php");

// Cration d'un sous-domaine ou d'un alias
function form_sousdomaine($operation, $id_sousdomaine=0, $id_domaine=1)
{
global $id_structure, $id_usager, $seditsite, $seditalias,
  $seditionsite,$sstrugerante,$saliasdesite,$snomdesousdom,$sIdentifiant,
	$sconfirmer,$sdirigeverssite,$sMotdepasse;

	switch ($operation)
	{
	case 201 : $sentete=$seditsite; break;
	case 221 : $sentete=$seditalias; break;
	}
  echo cadre_debut($sentete);

	echo "<table border=1>
				<form action=\"$PHP_SELF\">
				<input type=\"hidden\" name=\"operation\" value=\"$operation\">";
 // il s'agit d'un site web de structure
  echo "<tr><td>$sstrugerante* :</td>";
  echo "<td>";
  if (SITES_AUTRES<"w")
    echo "<input type=\"hidden\" name=\"id_stru\" value=\"$id_structure\">".structure($id_structure);
  else
    choix_structure($id_structure, "id_stru");
  echo "</td></tr>\n";

	echo "<tr><td>";
	if ($operation>=221)
		echo "$saliasdesite*";
	else
		echo "$snomdesousdom*";
	echo " :</td><td><input type=\"text\" name=\"sousdomaine\">";
	choix_domaine($id_domaine, "id_domaine");
	echo "</td></tr>";
	if ($operation==201)
		echo "<tr><td>$sIdentifiant* :</td><td><input name=\"login\"></td></tr>
				<tr><td>$sMotdepasse* :</td><td><input name=\"motdepasse\" type=\"password\"></td></tr>
				<tr><td>$sMotdepasse* (2):</td><td><input name=\"motdepasse2\" type=\"password\"></td></tr>";
	else
	{
		echo "<tr><td>$sdirigeverssite* :</td><td>";
		choix_sousdomaine($id_sousdomaine, "id_sousdomaine");
		echo "</td></tr>\n";
	}
	echo "<tr><td colspan=2 align=center>
	        <input type=\"submit\" name=\"Envoyer\" value=\"$sconfirmer\">
	      </td></tr>
				</table>\n";

	echo cadre_fin();
} // function form_sousdomaine


// Dbut de la page
switch ($operation)
{
case 10 : // Liste de tous les sites web  
  echo cadre_debut($slistesites);
  if (SITES_AUTRES<"r")
  {
    echo $pasledroit;
		echo cadre_fin();
    break;
  }
  echo "<table border=1>
      <tr><th align=center>Gestionnaire</th><th align=center>Sous-domaine</th><th align=center>Actions</th></tr>";
  $req="SELECT * FROM hebergements
                WHERE type=\"siteweb\" OR type=\"aliassiteweb\"
                ORDER BY id_structure, sousdomaine";
  $res=executeRequete($req);
  while ($sousdomaine=fetch_object($res))
  {
    if (  $sousdomaine->id_structure!=$idstranc
       || $sousdomaine->id_usager!=$idusaanc)
    {
      if ($coul!="")
        $coul="";
      else
        $coul=" bgcolor=\"lightgrey\"";
      $idstranc=$sousdomaine->id_structure;
      $idusaanc=$sousdomaine->id_usager;
    }
    echo "<tr$coul><td>";
    if ($sousdomaine->id_structure)
      echo structure($sousdomaine->id_structure);
    else
      echo usager($sousdomaine->id_usager);
    echo "</td><td>";
    if ($sousdomaine->type=="siteweb") echo "<b>";
    echo "<a target='_blank' href=\"http://$sousdomaine->sousdomaine\">http://$sousdomaine->sousdomaine</a>";
    if ($sousdomaine->type=="siteweb") echo "</b>";
    if ($sousdomaine->type=="aliassiteweb")
      echo " -> http://$sousdomaine->login";
    echo "</td><td nowrap><a href=\"$PHP_SELF?id_sousdomaine=$sousdomaine->id&operation="; //"
    if ($sousdomaine->id_structure) echo "50"; else echo "51";
    echo "\">$info $sparametres</a>"; //"
    /* if ($sousdomaine->id_structure) // pas encore prets
      echo "<br><a href=\"$PHP_SELF?id_sousdomaine=$sousdomaine->id&operation=40\">
            $modifier changer mot-de-passe</a>"; */
    if (SITES_AUTRES>="w")
    {
      echo "<br><a href=\"$PHP_SELF?id_sousdomaine=$sousdomaine->id&operation="; //"
      if ($sousdomaine->id_structure) echo "30"; else echo "31";
      echo "\">$supprimer $ssupprimer</a>"; //"
    }
    echo "</td></tr>\n";
  }
  echo "</table>\n";

  if (SITES_AUTRES>="w" || SITES_MOI>="w")
	{
		echo "<p><a href=\"$PHP_SELF?operation=20\">$ssitecreer</a></p>\n";
		echo "<p><a href=\"$PHP_SELF?operation=22\">$ssitecreeralias</a></p>\n";
  }
	echo cadre_fin();

  break;

case 11 : // Liste des sites web de la structure
  echo cadre_debut($ssitesgerespar.structure($id_stru));
  if (!$id_structure)
  {
    echo "<p>La sortie n'est pas par l...</p>\n";
		echo cadre_fin();
    break;
  }
  if (SITES_AUTRES<"r" || !$id_stru) $id_stru=$id_structure;
  echo "<table border=1>
      <tr><th align=center>$ssousdomaines</th><th align=center>$sActions</th></tr>";
  $req="SELECT * FROM hebergements
                 WHERE (type=\"siteweb\" OR type=\"aliassiteweb\") AND ";
  if ($id_structure)
    $req.="id_structure=$id_stru";
  else
    $req.="id_usager=$id_usager";
  $req.="        ORDER BY id_structure, sousdomaine";
  $res=executeRequete($req);
  while ($sousdomaine=fetch_object($res))
  {
    echo "<tr><td><a href='http://$sousdomaine->sousdomaine' target='_blank'>$sousdomaine->sousdomaine</a>";
    if ($sousdomaine->type=="aliassiteweb")
      echo " -> $sousdomaine->login";
    echo "</td><td>
          <a href=\"http://$sousdomaine->sousdomaine/webalizer\">$info statistiques</a> ";
    echo "- <a href=\"$PHP_SELF?operation=";
    if ($sousdomaine->id_structure) echo "50"; else echo "51";
    echo "&id_sousdomaine=$sousdomaine->id\">$info $sparametres</a> ";
		/* Pas encore fait.
    if ($sousdomaine->id_structure && $sousdomaine->type!="aliassiteweb")
      echo "      - <a href=\"$PHP_SELF?operation=40&id_sousdomaine=$sousdomaine->id\">$modifier changer mot-de-passe</a>";
		*/
    echo "        - <a href=\"$PHP_SELF?operation=";
    if ($sousdomaine->id_structure) echo "30"; else echo "31";
    echo "&id_sousdomaine=$sousdomaine->id\">$supprimer $ssupprimer</a></td></tr>\n";
  }
  echo "</table>\n";

  if (SITES_AUTRES>="w" || SITES_MOI>="w")
	{
		echo "<p><a href=\"$PHP_SELF?operation=20\">$ssitecreer</a></p>\n";
		echo "<p><a href=\"$PHP_SELF?operation=22\">$ssitecreeralias</a></p>\n";
  }
	echo cadre_fin();
  break;

case 20 : // Crer un nouveau site web
  form_sousdomaine(201);
  break;

case 22 : // Crer un alias de site web
  form_sousdomaine(221);
  break;

case 201 : // Aprs saisie d'un nouveau site web
  // Vrification des informations        
	echo cadre_debut($seditsite);
  $mes="";
  // le login n'existe-t-il pas dj ?
  $req = "SELECT * FROM hebergements WHERE login=\"$login\"";
  if ($res = executeRequete($req))
    if (fetch_object($res))
      $mes .= "$ssiteidentexistant<br>";
  $req = "SELECT * FROM usagers WHERE login=\"$login\"";
  $res = executeRequete($req);
  if ($res)
    if (fetch_object($res))
      $mes .="$ssiteidentexistantusager<br>";
  // le sous-domaine n'existe-t-il pas dj ?
  $res = recherche("domaines", "id", $id_domaine);
  $domaine = fetch_object($res);
  $domaine = $domaine->domaine;
  $req = "SELECT * FROM hebergements
           WHERE sousdomaine='$sousdomaine.$domaine'
             AND (type='siteweb' OR type='aliassiteweb')";
  $res = executeRequete($req);
  if (fetch_object($res))
     $mes .="$ssitedomainepris<br>";
  // vrification mot de passe
  if ($motdepasse=="")
    $mes.="$manquemotdepasse<br>";
	elseif ($motdepasse!=$motdepasse2)
		$mes.="$motdepassedifferents<br>";
  if ($mes!="")
  {
    echo "<p>$mes</p>\n";
		echo cadre_fin();
    require("basdepage.inc.php");
    echo "</body></html>";
    require("footer.inc.php");
    exit;
  }

  // Ajouter l'enregistrement dans la base de donnes hbergement
  $motdepassec= md5($motdepasse);
  $req="INSERT INTO hebergements (id_structure, type, sousdomaine, login, motdepasse)
        VALUES ('$id_stru', 'siteweb', '$sousdomaine.$domaine', \"$login\", \"$motdepassec\")";
  $res = executeRequete($req);

  // Retourver le numro de l'enregistrement
  $res = recherche("hebergements", "sousdomaine", "$sousdomaine.$domaine");
  $enr = fetch_object($res);
  $id_hebergement = $enr->id;

  // Ajouter le compte sur la machine serveur (pour le FTP)
  $motdepassec = crypt($motdepasse, "Sa");
  $comm="useradd -d /home/wwwusers/".$sousdomaine.".".$domaine
             ." -c \"Site web $sousdomaine.$domaine\" -m -k /home/wwwusers/skel/"
             ." -g www -s /bin/bash -p $motdepassec $login";
  executecommande("sudo $comm");

  echo "<p>$ssitecreeok</p>\n";

  //  Envoi d'un courriel pour la demande de cration d'hte virtuel.
  $corps = sprintf($ssitemessagecree, 
	  structure($id_stru),
	  "http://$sousdomaine.$domaine",
	  "/home/wwwusers/$sousdomaine.$domaine/www");
	$to=$administrateursitesweb;
  $from=courriel("structures", $id_stru);   // on recherche le courriel de la structure qui demande
	if (!$from)
	  $from=$administrateursitesweb; // si on l'a pas, c'est pas grave
	else
	  $to.=",".$from; // mais si on l'a, on envoi aussi le courriel.
  $ok = mail($to, $ssiteobjetmessagecree,
             $corps, "From:$from");
  echo "<p>$corps</p>\n";

  // Et si c'tait automatique...
  $conf ="\n# $id_hebergement\n";
  $conf.="<VirtualHost $ip_serveur:80>\n";
  $conf.="    ServerAdmin $administrateursitesweb\n";
  $conf.="    ServerName $sousdomaine.$domaine\n";
  $conf.="    VirtualDocumentRoot /home/wwwusers/$sousdomaine.$domaine/www/\n";
  $conf.="    VirtualScriptAlias /home/wwwusers/$sousdomaine.$domaine/cgi-bin/\n";
  $conf.="    ErrorLog /var/log/apache-ssl/$sousdomaine.$domaine-error.log\n";
  $conf.="    TransferLog /var/log/apache-ssl/$sousdomaine.$domaine-access.log\n";
  $conf.="    CustomLog /var/log/apache-ssl/$sousdomaine.$domaine.log combined\n";
  $conf.="    Alias /webalizer /home/wwwusers/$sousdomaine.$domaine/public_html/webalizer\n";
  $conf.="</VirtualHost>\n";
  $conf.="## $id_hebergement\n";

  if (! config_apache_ajoute($conf))
    debug($ssitepbconfapache);

	echo cadre_fin();
  break;

case 221 : // Aprs saisie d'un nouvel alias de site web
  echo cadre_debut($seditalias);
	// Vrification des informations
  $mes="";
  // le sous-domaine n'existe-t-il pas dj ?
  $res = recherche("domaines", "id", $id_domaine);
  $domaine = fetch_object($res);
  $domaine = $domaine->domaine;
  $req = "SELECT * FROM hebergements WHERE sousdomaine='$sousdomaine.$domaine'
                                       AND (type='siteweb' OR type='aliassiteweb')";
  $res = executeRequete($req);
  if (fetch_object($res))
     $mes .="$ssitedomainepris<br>";
  if ($mes!="")
  {
    echo "<p>$mes</p>\n";
		echo cadre_fin();
    require("basdepage.inc.php");
    echo "</body></html>";
    require("footer.inc.php");
    exit;
  }
  $req = "SELECT * FROM hebergements WHERE id=$id_sousdomaine";
  $res = executeRequete($req);
  $sousdomainedestination=fetch_object($res);

  // Ajouter l'enregistrement dans la base de donnes hbergement
  $req="INSERT INTO hebergements (id_structure, type, sousdomaine, login)
        VALUES ('$id_stru', 'aliassiteweb', '$sousdomaine.$domaine', \"$sousdomainedestination->sousdomaine\")";
  $res = executeRequete($req);

  // Retrouver l'id_hebergement
	$id_hebergement=insert_id();

  // Envoi d'un courriel pour demande la cration de l'alias
  $corps = sprintf($ssitemessagealiascree,
	  structure($id_stru),
    "http://$sousdomaine.$domaine",
		"http://$sousdomainedestination->sousdomaine");
	$to=$administrateursitesweb;
  $from=courriel("structures", $id_stru);   // on recherche le courriel de la structure qui demande
	if (!$from)
	  $from=$administrateursitesweb; // si on l'a pas, c'est pas grave
	else
	  $to.=",".$from; // mais si on l'a, on envoi aussi le courriel.
  $ok = mail($to, $ssiteobjetmessagealiascree,
             $corps, "From: $from");
  echo "<p>$corps</p>\n";
  //debug($hebergement->id);
  // Et si c'tait automatique
  $conf ="\n# $hebergement->id\n";
  $conf.="<VirtualHost $ip_serveur:80>\n";
  $conf.="    ServerName $sousdomaine.$domaine\n";
  $conf.="    Redirect permanent / http://$sousdomainedestination->sousdomaine\n";
  $conf.="</VirtualHost>\n";
  $conf.="## $hebergement->id\n";
  if (! config_apache_ajoute($conf))
    debug($ssitepbconfapache);
  
	echo cadre_fin();
	break;

case 30 : // Confirmation de destruction d'un site web   
  echo cadre_debut($ssitesuppr);
  if (!$id_structure || SITES_AUTRES<"w")
  {
    echo $pasledroit;
		echo cadre_fin();
    break;
  }
  // On retrouve l'enregistrement du sous domaine
  $res=recherche("hebergements", "id", $id_sousdomaine);
  if (!$sousdomaine=fetch_object($res))
  {
    echo "<p>$ssiteintrouvable</p>\n";
		echo cadre_fin();
    break;
  }
  echo "<table border=1>";  
	echo "<tr><th colspan=2 align=center>$sousdomaine->sousdomaine</th></tr>";
  echo "<tr><td>$sstrugerante :</td>";
  echo "<td>".structure($sousdomaine->id_structure);
  echo "</td></tr>\n";

  if ($sousdomaine->type=="aliassiteweb")
    echo "<tr><td>$ssitealiasde :</td><td>$sousdomaine->login</td></tr>\n";
  else
  {
    echo "<tr><td>$sServeur FTP :</td><td>ftp.pierrefitte93.fr</td></tr>";
    echo "<tr><td>$sIdentifiant FTP :</td><td>$sousdomaine->login</td></tr>";
    echo "<tr><td>$sMotdepasse FTP :</td><td>Celui que vous avez saisi lors de la cration du site</td></tr>";
    echo "<tr><td>$sdossierbase :</td><td>/www/</td></tr>\n";
  }
  echo "<tr><td colspan=2 align=center>
        <form action=\"$PHP_SELF\" method=\"POST\" enctype=\"multipart/form-data\">
        <input type=\"hidden\" name=\"operation\" value=301>
        <input type=\"hidden\" name=\"id_sousdomaine\" value=$sousdomaine->id>";
  if ($sousdomaine->type=="siteweb")
    echo "
        <input type=\"checkbox\" name=\"suppr_compte\" checked>Supprimer le compte (FTP)<br>
        <input type=\"checkbox\" name=\"suppr_fichiers\">Supprimer les fichiers<br>";
  echo "<input type=\"submit\" name=\"Supprimer\" value=\"Confirmer\">
        </form>
        </td></tr>\n";
  echo "</table>\n";
	
	echo cadre_fin();
  break;

case 301 : // Destruction de site web
  echo cadre_debut($ssitesuppr);
  if (!$id_structure || SITES_MOI<"w")
  {
    echo $pasledroit;
		echo cadre_fin();
    break;
  }
  // Vrification des informations
  $mes="";
  // le sous-domaine existe-t-il ?
  $res=recherche("hebergements", "id", $id_sousdomaine);
  if (!$sousdomaine=fetch_object($res))
  {
    echo "<p>$ssiteintrouvable</p>\n";
		echo cadre_fin();
    break;
  }

  $req = "DELETE FROM hebergements WHERE id=$id_sousdomaine";
  $res = executeRequete($req);

  // Envoi d'un courriel pour demande la suppression du site
  $corps = sprintf($ssitemessagesuppr,
	  structure($id_stru),
    "http://$hebergement->sousdomaine");
	$to=$administrateursitesweb;
  $from=courriel("structures", $id_stru);   // on recherche le courriel de la structure qui demande
	if (!$from)
	  $from=$administrateursitesweb; // si on l'a pas, c'est pas grave
	else
	  $to.=",".$from; // mais si on l'a, on envoi aussi le courriel.
  $ok = mail($to, $ssiteobjetmessagesuppr,
             $corps, "From: $from");

	echo "<p>$corps</p>\n";

  // Et si c'tait automatique
  if (! config_apache_supprime($id_sousdomaine))
    debug($ssitepbconfapache);
	else
	  echo $ssitesupprok;

	// Controle des droits pour rellement supprimer le compte...
  if ($suppr_compte!="on" || SITES_AUTRES<"w")
  {
    echo $ssitepasledroitsupprfichiers;
		echo cadre_fin();
    break;
  }

  echo "<p>$ssitesupprcompte";
  if ($suppr_fichiers=="on")
  {
    $comm="userdel -r $sousdomaine->login";
    echo $ssitesupprfichiers;
  }
  else
    $comm="userdel $sousdomaine->login";
  echo ".</p>\n";

  executecommande("sudo $comm");

	echo cadre_fin();
  break;

case 40 : // TODO : Changer de mot de passe pour un site (structure uniquement)
  break;

case 50 : // Afficher les paramtres site web structure
  echo cadre_debut($ssiteparametres);

  $res=recherche("hebergements", "id", $id_sousdomaine);
  if (!$sousdomaine=fetch_object($res))
  {
    echo $ssiteintrouvable;
		echo cadre_fin();
    break;
  }

	if (($sousdomaine->id_structure==$id_structure && SITES_MOI<"r")
	    || SITES_AUTRES<"r")
  {
    echo $pasledroit;
		echo cadre_fin();
    break;
  }
  // On retrouve l'enregistrement du sous domaine
  echo "<table border=1>
        <tr><th align=center colspan=2>$sousdomaine->sousdomaine</th></tr>";
  // recherche des alias de sitesweb
  $res2=recherche("hebergements", "login", $sousdomaine->sousdomaine);
  while ($alias=fetch_object($res2))
    if ($alias->type=="aliassiteweb")
      echo "<tr><td align=center>$sAlias : $alias->sousdomaine</td></tr>\n";

  echo "<tr><td>$sstrugerante :</td>";
  echo "<td>".structure($sousdomaine->id_structure);
  echo "</td></tr>\n";

  if ($sousdomaine->type=="aliassiteweb")
    echo "<tr><td>$ssitealiasde :</td><td>$sousdomaine->login</td></tr>\n";
  else
  {
    echo "<tr><td>$sServeur FTP :</td><td>ftp.pierrefitte93.fr</td></tr>";
    echo "<tr><td>$sIdentifiant FTP :</td><td>$sousdomaine->login</td></tr>";
    echo "<tr><td>$sMotdepasse FTP :</td><td>Celui que vous avez saisi lors de la cration du site</td></tr>";
    echo "<tr><td>$sdossierbase :</td><td>/www/</td></tr>\n";
  }
  echo "<tr><td>$ssitepagedaccueil :</td><td><a href=\"http://$sousdomaine->sousdomaine/\" target='_blank'>http://$sousdomaine->sousdomaine/</a></td></tr>";
  echo "<tr><td>$sStatistiques :</td><td><a target='_blank' href=\"http://$sousdomaine->sousdomaine/webalizer/\">http://$sousdomaine->sousdomaine/webalizer/</a></td></tr>";

  echo "</table>\n";
	
	echo cadre_fin();
  break;

case 60 : // Modifier le site par dfaut

case 51 : // Afficher les paramtre page perso
default :            
  echo cadre_debut($ssiteparametrepageperso);
  if ($id_usager)
  { // Il s'agit d'un usager individuel
	  $res=recherche("usagers", "id", $id_usager);                 
		$usager=fetch_object($res);  
		echo "<table><tr><td>";
    printf($ssiteinfopageperso,
			"public_html/",
			"<a href='http://perso.pierrefitte93.fr/~$usager->login'>http://perso.pierrefitte93.fr/~$usager->login</a>",
      "<a href='http://perso.pierrefitte93.fr/~$usager->login/webalizer'>http://perso.pierrefitte93.fr/~$usager->login/webalizer</a>",
      "ftp.pierrefitte93.fr",
      "$usager->login@arobase.pierrefitte93.fr",
      "/public_html/");    
		echo "</td></tr></table>\n";
  }                    
	else
	  $pasledroit;
  echo cadre_fin();
}
// Fin de la page

require("basdepage.inc.php");
echo "</body></html>";
require("footer.inc.php");
?>

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us