<?PHP
/************************************************************************/
/* NPDS V : Net Portal Dynamic System                                   */
/* ===========================                                          */
/*                                                                      */
/* Original Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)   */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This version name NPDS Copyright (c) 2001-2005 by Philippe Brunier   */
/*                                                                      */
/* 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.       */
/************************************************************************/
function Access_Error () {
  if (file_exists("meta/meta.php"))
     include ("meta/meta.php");
  echo "<title>NPDS</title></head><body bgcolor=\"white\"><br /><p align=\"center\"><span style=\"font-size: 14px; font-family: Arial; font-weight: bold; color: red;\">";
  echo "Access Denied / Acc&egrave;s Refus&eacute;";
  if (cur_charset=="utf-8") echo" / &#x901A;&#x5165;&#x88AB;&#x5426;&#x8BA4;";
  echo "</span>";
  echo "<br /><br /><span style=\"font-size: 12px; font-family: Arial; font-weight: bold; color: black;\">NPDS - Portal System";
  echo "</span></p></body></html>";
  die();
}
if (!eregi("admin.php", $PHP_SELF)) { Access_Error(); }
global $pdst; $pdst="0";

global $language;
$hlpfile = "manuels/$language/authors.html";
$result = mysql_query("select radminsuper from authors where aid='$aid'");
list($radminsuper) = mysql_fetch_row($result);
if ($radminsuper!=1) {
   Access_Error();
}

function displayadmins() {
    global $hlpfile;
    $titlebar = "<b>".adm_translate("Auteurs actuels")."</b>";
    include("header.php");
    GraphicAdmin($hlpfile);
    OpenTable();
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">";
    echo adm_translate("Editer les Administrateurs");
    echo "</td></tr></table>\n";
    echo "<br />";
    $result = mysql_query("select aid, name from authors");
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
    echo "<tr><td class=\"ONGL\" colspan=\"3\">".adm_translate("Nom")." : </td></tr>";
    while(list($a_aid, $name) = mysql_fetch_row($result)) {
       $rowcolor = tablos();
       echo "<tr $rowcolor><td width=\"70%\">$a_aid</td>";
       echo "<td align=\"right\" nowrap=\"nowrap\"><a href=\"admin.php?op=modifyadmin&amp;chng_aid=$a_aid\" class=\"NOIR\">".adm_translate("Modifier l'information")."</a>";
       echo " | <a href=\"admin.php?op=deladmin&amp;del_aid=$a_aid\" class=\"ROUGE\">".adm_translate("Effacer l'Auteur")."</a></td></tr>";
    }
    echo "</table><br />";
    echo "<form action=\"admin.php\" method=\"post\">";
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
    echo "<tr><td>".adm_translate("Surnom")." <span class=\"ROUGE\">*</span></td>";
    echo "<td><input class=\"TEXTBOX\" type=\"text\" name=\"add_aid\" size=\"30\" maxlength=\"30\"></td></tr>";
    echo "<tr><td>".adm_translate("Nom")." <span class=\"ROUGE\">*</span></td>";
    echo "<td><input class=\"TEXTBOX\" type=\"text\" name=\"add_name\" size=\"30\" maxlength=\"50\"></td></tr>";
    echo "<tr><td>".adm_translate("E-mail")." <span class=\"ROUGE\">*</span></td>";
    echo "<td><input class=\"TEXTBOX\" type=\"text\" name=\"add_email\" size=\"30\" maxlength=\"60\"></td></tr>";
    echo "<tr><td>".adm_translate("URL")."</td>";
    echo "<td><input class=\"TEXTBOX\" type=\"text\" name=\"add_url\" size=\"30\" maxlength=\"60\"></td></tr>";
    echo "<tr><td>".adm_translate("Actif(s)")."</td><td>";
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"1\" width=\"100%\">";
    echo "<tr class=\"TEXTBOX_STANDARD\">";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radminarticle\" value=\"1\"></td>";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radmintopic\" value=\"1\"></td>";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radminsection\" value=\"1\"></td>";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radminleft\" value=\"1\"></td>";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radminmain\" value=\"1\"></td>";
    echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"add_radminright\" value=\"1\"></td>";
    echo "</tr><tr class=\"HEADER\">";
    echo "<td align=\"center\">".adm_translate("Articles")."</TD>";
    echo "<td align=\"center\">".adm_translate("Sujet")."</td>";
    echo "<td align=\"center\">".adm_translate("Rubriques")."</td>";
    echo "<td align=\"center\">".adm_translate("Edition des Blocs de gauche")."</td>";
    echo "<td align=\"center\">".adm_translate("Bloc Principal")."</td>";
    echo "<td align=\"center\">".adm_translate("Edition des Blocs de droite")."</td>";
    echo "</tr><tr class=\"TEXTBOX_STANDARD\">";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminuser\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminsurvey\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminlink\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminfaq\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radmindownload\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminfilem\" value=\"1\"></td>";
    echo "</tr><tr class=\"HEADER\">";
    echo "<td align=\"center\">".adm_translate("Edition des Utilisateurs")."</td>";
    echo "<td align=\"center\">".adm_translate("Sondage")."s</td>";
    echo "<td align=\"center\">".adm_translate("Liens Web")."</td>";
    echo "<td align=\"center\">".adm_translate("Faq")."</td>";
    echo "<td align=\"center\">".adm_translate("Téléchargement")."</td>";
    echo "<td align=\"center\">".adm_translate("Gestionnaire de Fichiers")."</td>";
    echo "</tr><tr class=\"TEXTBOX_STANDARD\">";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminhead\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminephem\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminreviews\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminforum\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminsdv\" value=\"1\"></td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminlnl\" value=\"1\"></td>";
    echo "</tr><tr class=\"HEADER\">";
    echo "<td align=\"center\">".adm_translate("Grands Titres de sites de News")."</td>";
    echo "<td align=\"center\">".adm_translate("Ephémérides")."</td>";
    echo "<td align=\"center\">".adm_translate("Critiques")."</td>";
    echo "<td align=\"center\">".adm_translate("Edition des Forums")."</td>";
    echo "<td align=\"center\">".adm_translate("Gestion des groupes")."</td>";
    echo "<td align=\"center\">".adm_translate("La Lettre")."</td>";
    echo "</tr><tr class=\"TEXTBOX_STANDARD\">";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\"><input type=\"checkbox\" name=\"add_radminsuper\" value=\"1\"></td>";
    echo "</tr><tr class=\"HEADER\">";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\">&nbsp;</td>";
    echo "<td align=\"center\" class=\"ROUGE\">".adm_translate("Super Utilisateur")."</td>";
    echo "</tr>";
    echo "</table>";
    echo "</td></tr>";
    echo "<tr><td>&nbsp;</td><td colspan=\"2\">".adm_translate("Si <b>Super Utilisateur</b> est coché, l'Utilisateur aura TOUS les Droits.")."</td></tr>";
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
    echo "<tr><td nowrap=\"nowrap\">".adm_translate("Mot de Passe")." <span class=\"ROUGE\">*</span></td>";
    echo "<td><input class=\"TEXTBOX_STANDARD\" type=\"password\" name=\"add_pwd\" size=\"12\" maxlength=\"12\"> - ";
    echo "<input type=\"hidden\" name=\"op\" value=\"AddAuthor\">";
    echo "<input class=\"BOUTON_STANDARD\" type=\"submit\" value=\"".adm_translate(" Ajouter un Auteur ")."\"></td></tr>";
    echo "</table></form>";
    echo "<p align=\"center\" class=\"ROUGE\">".adm_translate("* indique les champs requis")."</p><br />";
    closetable();
    include("footer.php");
}

function modifyadmin($chng_aid) {
    global $hlpfile, $aid;
    $titlebar = "<b>".adm_translate("mise à jour")." $chng_aid</b>";
    include("header.php");
    GraphicAdmin($hlpfile);
    OpenTable();
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">";
    echo adm_translate("mise à jour")." : $chng_aid";
    echo "</td></tr></table>\n";
    echo "<br />";
    $result = mysql_query("select aid, name, url, email, pwd, radminarticle,radmintopic,radminleft,radminright,radminuser,radminmain,radminsurvey,radminsection,radminlink,radminephem,radminfilem,radminhead,radminfaq,radmindownload,radminforum,radminreviews,radminsdv,radminlnl,radminsuper from authors where aid='$chng_aid'");
    list($chng_aid, $chng_name, $chng_url, $chng_email, $chng_pwd, $chng_radminarticle, $chng_radmintopic, $chng_radminleft, $chng_radminright, $chng_radminuser, $chng_radminmain, $chng_radminsurvey, $chng_radminsection, $chng_radminlink, $chng_radminephem, $chng_radminfilem, $chng_radminhead, $chng_radminfaq, $chng_radmindownload, $chng_radminforum, $chng_radminreviews, $chng_radminsdv, $chng_radminlnl, $chng_radminsuper) = mysql_fetch_row($result);

    $result = mysql_query("select radminsuper from authors where aid='$aid'");
    list($radminsuper) = mysql_fetch_array($result);
    if ($radminsuper == 1) {
       echo "<form action=\"admin.php\" method=\"post\">";
       echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
       echo "<tr><td>".adm_translate("Nom")."</td>";
       echo "<td>$chng_aid<input type=\"hidden\" name=\"chng_aid\" value=\"$chng_aid\"></td></tr>\n";
       echo "<tr><td>".adm_translate("Surnom")." <span class=\"ROUGE\">*</span></td>";
       echo "<td><input class=\"textbox\" type=\"text\" name=\"chng_name\" value=\"$chng_name\" size=\"30\" maxlength=\"30\"></td></tr>\n";
       echo "<tr><td>".adm_translate("E-mail")." <span class=\"ROUGE\">*</span></td>";
       echo "<td><input class=\"textbox\" type=\"text\" name=\"chng_email\" value=\"$chng_email\" size=\"30\" maxlength=\"60\"></td></tr>\n";
       echo "<tr><td>".adm_translate("URL")."</td>";
       echo "<td><input class=\"textbox\" type=\"text\" name=\"chng_url\" value=\"$chng_url\" size=\"30\" maxlength=\"60\"></td></tr>\n";
       echo "<tr><td>".adm_translate("Actif(s)")."</td><td>";
       echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"1\">";
       echo "<tr class=\"TEXTBOX_STANDARD\">";
       if ($chng_radminarticle == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminarticle\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminarticle\" value=\"1\"></td>";
       }
       if ($chng_radmintopic == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radmintopic\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radmintopic\" value=\"1\"></td>";
       }
       if ($chng_radminsection == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminsection\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminsection\" value=\"1\"></td>";
       }
       if ($chng_radminleft == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminleft\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminleft\" value=\"1\"></td>";
       }
       if ($chng_radminmain == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminmain\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminmain\" value=\"1\"></td>";
       }
       if ($chng_radminright == 1) {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminright\" value=\"1\" checked></td>";
       } else {
          echo "<td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"chng_radminright\" value=\"1\"></td>";
       }
       echo "</tr><tr class=\"HEADER\">\n";
       echo "<td align=\"center\">".adm_translate("Articles")."</td>";
       echo "<td align=\"center\">".adm_translate("Sujet")."</td>";
       echo "<td align=\"center\">".adm_translate("Rubriques")."</td>";
       echo "<td align=\"center\">".adm_translate("Edition des Blocs de gauche")."</td>";
       echo "<td align=\"center\">".adm_translate("Bloc Principal")."</td>";
       echo "<td align=\"center\">".adm_translate("Edition des Blocs de droite")."</td>";
       echo "</tr>\n<tr class=\"TEXTBOX_STANDARD\">";
      if ($chng_radminuser == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminuser\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminuser\" value=\"1\"></td>";
      }
      if ($chng_radminsurvey == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsurvey\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsurvey\" value=\"1\"></td>";
      }
      if ($chng_radminlink == 1) {
         echo "<td  align=\"center\"><input type=\"checkbox\" name=\"chng_radminlink\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminlink\" value=\"1\"></td>";
      }
      if ($chng_radminfaq == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminfaq\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminfaq\" value=\"1\"></td>";
      }
      if ($chng_radmindownload == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radmindownload\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radmindownload\" value=\"1\"></td>";
      }
      if ($chng_radminfilem == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminfilem\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminfilem\" value=\"1\"></td>";
      }
      echo "</tr>\n<tr class=\"HEADER\">";
      echo "<td align=\"center\">".adm_translate("Edition des Utilisateurs")."</td>";
      echo "<td align=\"center\">".adm_translate("Sondage")."s</td>";
      echo "<td align=\"center\">".adm_translate("Liens Web")."</td>";
      echo "<td align=\"center\">".adm_translate("Faq")."</td>";
      echo "<td align=\"center\">".adm_translate("Téléchargement")."</td>";
      echo "<td align=\"center\">".adm_translate("Gestionnaire de Fichiers")."</td>";
      echo "</tr>\n<tr class=\"TEXTBOX_STANDARD\">";
      if ($chng_radminhead == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminhead\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminhead\" value=\"1\"></td>";
      }
      if ($chng_radminephem == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminephem\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminephem\" value=\"1\"></td>";
      }
      if ($chng_radminreviews == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminreviews\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminreviews\" value=\"1\"></td>";
      }
      if ($chng_radminforum == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminforum\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminforum\" value=\"1\"></td>";
      }
      if ($chng_radminsdv == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsdv\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsdv\" value=\"1\"></td>";
      }
      if ($chng_radminlnl == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminlnl\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminlnl\" value=\"1\"></td>";
      }
      echo "</tr>\n<tr class=\"HEADER\">";
      echo "<td align=\"center\">".adm_translate("Grands Titres de sites de News")."</td>";
      echo "<td align=\"center\">".adm_translate("Ephémérides")."</td>";
      echo "<td align=\"center\">".adm_translate("Critiques")."</td>";
      echo "<td align=\"center\">".adm_translate("Edition des Forums")."</td>";
      echo "<td align=\"center\">".adm_translate("Gestion des groupes")."</td>";
      echo "<td align=\"center\">".adm_translate("La Lettre")."</td>";
      echo "</tr>\n<tr class=\"TEXTBOX_STANDARD\">";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      if ($chng_radminsuper == 1) {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsuper\" value=\"1\" checked></td>";
      } else {
         echo "<td align=\"center\"><input type=\"checkbox\" name=\"chng_radminsuper\" value=\"1\"></td>";
      }
      echo "</tr>\n<tr class=\"HEADER\">";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\">&nbsp;</td>";
      echo "<td align=\"center\" class=\"ROUGE\">".adm_translate("Super Utilisateur")."</td>";
      echo "</tr>";
      echo "</table>\n";
      echo "</td></tr>\n";
      echo "<tr><td>&nbsp;</td><td colspan=\"2\">".adm_translate("Si <b>Super Utilisateur</b> est coché, l'Utilisateur aura TOUS les Droits.")."</td></tr>";
      echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
      echo "<tr><td>".adm_translate("Mot de Passe")."</td>";
      echo "<td><input class=\"TEXTBOX_STANDARD\" type=\"password\" name=\"chng_pwd\" size=\"12\" maxlength=\"12\">";
      echo "</td></tr>\n";
      echo "<tr><td width=\"15%\">".adm_translate("Entrez à nouveau votre Mot de Passe")."</td>";
      echo "<td><input class=\"TEXTBOX_STANDARD\" type=\"password\" name=\"chng_pwd2\" size=\"12\" maxlength=\"12\"> ".adm_translate("(seulement pour modifications)")."</td></tr>";
      echo "<input type=\"hidden\" name=\"op\" value=\"UpdateAuthor\">";
      echo "<tr><td colspan=\"2\"><input class=\"BOUTON_STANDARD\" type=\"submit\" value=\"".adm_translate(" Actualiser l'Auteur")."\"></td></tr>\n";
      echo "</table></form>";
    }
    echo "<p align=\"center\" class=\"ROUGE\">".adm_translate("* indique les champs requis")."</p>\n";
    closetable();
    include("footer.php");
}

function updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_radminarticle, $chng_radmintopic, $chng_radminleft, $chng_radminright, $chng_radminuser, $chng_radminmain, $chng_radminsurvey, $chng_radminsection, $chng_radminlink, $chng_radminephem, $chng_radminfilem, $chng_radminhead, $chng_radminfaq, $chng_radmindownload, $chng_radminforum, $chng_radminreviews, $chng_radminsdv, $chng_radminlnl, $chng_radminsuper, $chng_pwd, $chng_pwd2, $temp_system_md5) {
    if (!($chng_aid && $chng_name && $chng_email))
       Header("Location: admin.php?op=mod_authors");

    if ($chng_pwd2 != "") {
       if($chng_pwd != $chng_pwd2) {
          $titlebar = "<b>".adm_translate("Mauvais Mot de Passe")."</b>";
          global $hlpfile;
          include("header.php");
          GraphicAdmin($hlpfile);
          echo error_handler(adm_translate("Désolé, les nouveaux Mots de Passe ne correspondent pas. Cliquez sur retour et recommencez")."<br />");
          include("footer.php");
          exit;
       }
       global $system_md5;
       if (($system_md5) or ($temp_system_md5)) {
          $chng_pwd=crypt($chng_pwd2,$chng_pwd);
       }
       if ($chng_radminsuper==1) {
          $result = mysql_query("update authors set name='$chng_name', email='$chng_email', url='$chng_url', radminarticle='0', radmintopic='0', radminleft='0', radminright='0', radminuser='0', radminmain='0', radminsurvey='0', radminsection='0', radminlink='0', radminephem='0', radminfilem='0', radminhead='0', radminfaq='0', radmindownload='0', radminforum='0', radminreviews='0', radminsdv='0', radminlnl='0', radminsuper='$chng_radminsuper', pwd='$chng_pwd' where aid='$chng_aid'");
          Header("Location: admin.php?op=mod_authors");
       } else {
          $result = mysql_query("update authors set name='$chng_name', email='$chng_email', url='$chng_url', radminarticle='$chng_radminarticle', radmintopic='$chng_radmintopic', radminleft='$chng_radminleft', radminright='$chng_radminright', radminuser='$chng_radminuser', radminmain='$chng_radminmain', radminsurvey='$chng_radminsurvey', radminsection='$chng_radminsection', radminlink='$chng_radminlink', radminephem='$chng_radminephem', radminfilem='$chng_radminfilem', radminhead='$chng_radminhead', radminfaq='$chng_radminfaq', radmindownload='$chng_radmindownload', radminforum='$chng_radminforum', radminreviews='$chng_radminreviews', radminsdv='$chng_radminsdv', radminlnl='$chng_radminlnl', radminsuper='0', pwd='$chng_pwd' where aid='$chng_aid'");
          Header("Location: admin.php?op=mod_authors");
       }
    } else {
       if ($chng_radminsuper==1) {
          $result = mysql_query("update authors set name='$chng_name', email='$chng_email', url='$chng_url', radminarticle='0', radmintopic='0', radminleft='0', radminright='0', radminuser='0', radminmain='0', radminsurvey='0', radminsection='0', radminlink='0', radminephem='0', radminfilem='0', radminhead='0', radminfaq='0', radmindownload='0', radminforum='0', radminreviews='0', radminsdv='0', radminlnl='0', radminsuper='$chng_radminsuper' where aid='$chng_aid'");
          Header("Location: admin.php?op=mod_authors");
       } else {
          $result = mysql_query("update authors set name='$chng_name', email='$chng_email', url='$chng_url', radminarticle='$chng_radminarticle', radmintopic='$chng_radmintopic', radminleft='$chng_radminleft', radminright='$chng_radminright', radminuser='$chng_radminuser', radminmain='$chng_radminmain', radminsurvey='$chng_radminsurvey', radminsection='$chng_radminsection', radminlink='$chng_radminlink', radminephem='$chng_radminephem', radminfilem='$chng_radminfilem', radminhead='$chng_radminhead', radminfaq='$chng_radminfaq', radmindownload='$chng_radmindownload', radminforum='$chng_radminforum', radminreviews='$chng_radminreviews', radminsdv='$chng_radminsdv', radminlnl='$chng_radminlnl', radminsuper='0' where aid='$chng_aid'");
          Header("Location: admin.php?op=mod_authors");
       }
    }
}

function error_handler($ibid) {
   opentable();
   echo "<p align=\"center\">".adm_translate("Merci d'entrer l'information en fonction des spécifications")."<br /><br />";
   echo "$ibid<br /><a href=\"admin.php?op=mod_authors\" class=\"NOIR\">".adm_translate("Retour en arrière")."</a></p>";
   closetable();
}

switch ($op) {
   case "mod_authors":
        displayadmins();
        break;

   case "modifyadmin":
        modifyadmin($chng_aid);
        break;

   case "UpdateAuthor":
        updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_radminarticle, $chng_radmintopic, $chng_radminleft, $chng_radminright, $chng_radminuser, $chng_radminmain, $chng_radminsurvey, $chng_radminsection, $chng_radminlink, $chng_radminephem, $chng_radminfilem, $chng_radminhead, $chng_radminfaq, $chng_radmindownload, $chng_radminforum, $chng_radminreviews, $chng_radminsdv, $chng_radminlnl, $chng_radminsuper, $chng_pwd, $chng_pwd2, $temp_system_md5);
        break;

   case "AddAuthor":
        if (!($add_aid && $add_name && $add_email && $add_pwd)) {
           global $hlpfile;
           include("header.php");
           GraphicAdmin($hlpfile);
           echo error_handler(adm_translate("Vous devez remplir tous les Champs")."<br />");
           include("footer.php");
           return;
        }
        if ($system_md5) {
           $add_pwdX=crypt($add_pwd,$add_pwdX);
        }
        $result = mysql_query("insert into authors values ('$add_aid', '$add_name', '$add_url', '$add_email', '$add_pwdX', '0', '$add_radminarticle','$add_radmintopic','$add_radminleft','$add_radminright','$add_radminuser','$add_radminmain','$add_radminsurvey','$add_radminsection','$add_radminlink','$add_radminephem','$add_radminfilem','$add_radminhead', '$add_radminfaq', '$add_radmindownload', '$add_radminforum', '$add_radminreviews', '$add_radminsdv','$add_radminlnl', '$add_radminsuper')");
        Header("Location: admin.php?op=mod_authors");
        break;

   case "deladmin":
        global $hlpfile;
        include("header.php");
        GraphicAdmin($hlpfile);
        OpenTable();
        echo "<p align=\"center\"><b>".adm_translate("Effacer l'Auteur")."</b> : ";
        echo "<span class=\"ROUGE\">".adm_translate("Etes-vous sûr de vouloir effacer")." $del_aid ? </span><br /><br />";
        echo "[ <a href=\"admin.php?op=deladminconf&amp;del_aid=$del_aid\" class=\"ROUGE\">".adm_translate("Oui")."</a>&nbsp;|&nbsp;<a href=\"admin.php?op=mod_authors\" class=\"NOIR\">".adm_translate("Non")."</a> ]</p>";
        closetable();
        include("footer.php");
        break;

   case "deladminconf":
        mysql_query("delete from authors where aid='$del_aid'");
        Header("Location: admin.php?op=mod_authors");
        break;
}
?>
