Location: PHPKode > projects > PhpMyDVDs > phpmydvds/administration.php
<?php

    /***************************************************************************
                                 administration.php  -  description
                                -------------------

        copyright          : (C) 2002 by Cédric Rochat
        email                : hide@address.com
    ***************************************************************************/
    /***************************************************************************
    *
    *   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.
    *
    ***************************************************************************/

    require ("util.php");

	if (($FirstTime==1 and ((md5($password)==$admin_pwd) or ($password==$admin_pwd))) or (ControleAcces($password, $Internaute, session_id())))
	{
	switch ($MenuChoix)
	{
		/****** Modification des paramètres généraux ***********************/
		case 1:
			function params()
			{
				echo "<center><h1>Paramètres généraux</h1></center><hr>";
				require ("config.php");
				echo "<br><br><br>";

				$ListeTempsLimite= array("1", "3", "5", "10", "15", "20", "30", "45", "60");
				$ListeNombreLimiteEnregistrements= array("10", "20", "30", "50", "100", "200", "500", "1000");
				if ($formats_son==0) $formats_son_modif="1";
				else $formats_son_modif="0";
				$Check=array ("Oui", "Non");

				$form = new Formulaire ("POST", "index.php?sousPage=administration.php&AdminState=1");

				$form->debutTable();

				$form->champMotDePasse ("Nouveau&nbsp;mot&nbsp;de&nbsp;passe&nbsp;administrateur&nbsp;(&nbsp;ou&nbsp;laisser&nbsp;tel&nbsp;quel&nbsp;)","admin_pwd_new","", 20, 30);
				$form->champMotDePasse ("Confirmation&nbsp;du&nbsp;nouveau&nbsp;mot&nbsp;de&nbsp;passe","admin_pwd_confirm_new","", 20, 30);
				$form->champListe("Temps&nbsp;d'inactivité&nbsp;avant&nbsp;la&nbsp;fermeture&nbsp;automatique&nbsp;d'une&nbsp;session&nbsp;(&nbsp;minutes&nbsp;)", "TempsLimiteAdmin_new", $TempsLimiteAdmin, 1, $ListeTempsLimite);
				$form->champTexte ("Mail&nbsp;de&nbsp;l'administrateur&nbsp;du&nbsp;système&nbsp;PhpMyDVDs", "mail_admin_new",$mail_admin, 30, 40);
				$form->champTexte ("Adresse&nbsp;du&nbsp;serveur&nbsp;MySQL", "pServeur_new",$pServeur, 20, 30);
				$form->champTexte ("Nom&nbsp;d'utilisateur&nbsp;de&nbsp;la&nbsp;base&nbsp;de&nbsp;données", "pNom_new",$pNom, 20, 30);
				$form->champMotDePasse ("Mot&nbsp;de&nbsp;passe&nbsp;de&nbsp;la&nbsp;base&nbsp;de&nbsp;donnée", "pMotPasse_new",$pMotPasse, 20, 30);
				$form->champTexte ("Nom&nbsp;de&nbsp;la&nbsp;base&nbsp;de&nbsp;donnée", "pBase_new",$pBase, 20, 30);
				$form->champTexte ("Préfixe&nbsp;des&nbsp;tables&nbsp;(&nbsp;permet&nbsp;de&nbsp;dissocier&nbsp;plusieurs&nbsp;'bases'&nbsp;de&nbsp;DVDs&nbsp;dans&nbsp;la&nbsp;même&nbsp;base&nbsp;)", "pTable_Prefixe_new", $pTable_Prefixe, 10, 20);
				$form->champTexte ("Chemin&nbsp;(&nbsp;relatif&nbsp;)&nbsp;pour&nbsp;les&nbsp;affiches&nbsp;des&nbsp;films&nbsp;(&nbsp;attention&nbsp;à&nbsp;mettre&nbsp;un&nbsp;'/'&nbsp;à&nbsp;la&nbsp;fin&nbsp;)", "pCoversPath_new",$pCoversPath, 30, 254);
				$form->champListe("Nombre&nbsp;limite&nbsp;d'enregistrements&nbsp;par&nbsp;page&nbsp;(dans&nbsp;les&nbsp;listes)", "NombreEnregistrementsLimiteAdmin_new", $NombreEnregistrementsLimiteAdmin, 1, $ListeNombreLimiteEnregistrements);
				$form->champRadio ("Formats de son avanc&eacute;s (consultez INSTALL_README, au sujet de formats_son, avant d'activer cette option)", "formats_son_new",$formats_son_modif, $Check);
				$form->champTexte ("Nom&nbsp;du&nbsp;fichier&nbsp;d'en-tête", "header_new",$header, 30, 40);
				$form->champTexte ("Nom&nbsp;du&nbsp;fichier&nbsp;pied&nbsp;de&nbsp;page", "footer_new",$footer, 30, 40);
				$form->champTexte ("Couleur&nbsp;du&nbsp;fond&nbsp;d'écran", "color_back_new",$color_back, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;cadres", "color_frame_new",$color_frame, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;liens", "color_link_new",$color_link, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;liens&nbsp;actifs", "color_alink_new",$color_alink, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;liens&nbsp;visités", "color_vlink_new",$color_vlink, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;menus&nbsp;inactif", "color_menu_new",$color_menu, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;menus&nbsp;actif", "color_menu_actif_new",$color_menu_actif, 10, 7);
				$form->champTexte ("Couleur&nbsp;des&nbsp;menus&nbsp;(rollover)", "color_menu_over_new",$color_menu_over, 10, 7);
				$form->champCache ("MenuChoix", 1);
				$form->champCache ("password",$admin_pwd);
				$form->champCache ("condition","true");
				$form->finTable();

				$form ->debutTable(HORIZONTAL,1);
				$form->champValider ("Enregistrer", "valider");
				$form->champValider ("Annuler", "annuler");
				$form->champValider ("Défaut", "defaut");
				$form->finTable();

				$form->champCache("ProblemeConnexion", $ProblemeConnexion);

				$form->fin();
				echo "<br><br><br>";
			}

			if($condition == "true")
			{
				if ($defaut)
				{
//					$admin_pwd_new="dvd";
					$FirstTime_new="1";
					$mail_admin_new="hide@address.com";
					$TempsLimiteAdmin_new="10";
					$pServeur_new="machine";
					$pNom_new="user";
					$pMotPasse_new="pass";
					$pBase_new="DVD";
					$pTable_Prefixe_new="DVD_";
					$pCoversPath_new="Affiches/";
					$NombreEnregistrementsLimiteAdmin_new="30";
					$formats_son_new="1";
					$header_new="header.php";
					$footer_new="footer.php";
					$color_back_new="#EEF5FC";
					$color_frame_new="#737373";
					$color_link_new="#000000";
					$color_alink_new="#000000";
					$color_vlink_new="#000000";
					$color_menu_new="#AEB2EF";
					$color_menu_actif_new="#FF5890";
					$color_menu_over_new="#7281E2";
				}
//				$password=$admin_pwd;
				if ($ProblemeConnexion) $FirstTime=1;
				include ("save_parameters.php");
				require ("config.php");

			}
			else params();
			break;
		/****** Suppression ou modification d'enregistrements ********************/
		case 2:
			include ('modifications.php');
			break;
		/******* Ajout d'enregistrements **********************************/
		case 3:
			$ajout='TRUE';
			include ('modifications.php');
			break;
		/******* Administration des prêts **********************************/
		case 4:
			include ('prets.php');
	}
	}
	else echo "<table width='100%' border='0' valign='top'><br><br><tr><td><center><h2>Mot&nbsp;de&nbsp;passe&nbsp;incorrect<BR>ou<BR>session&nbsp;terminée</h2><br><a href='index.php?sousPage=admin-request.php'>Autentifiez-vous&nbsp;ici</a></center></td></tr></table>";

?>
Return current item: PhpMyDVDs