<?PHP
/************************************************************************/
/* DUNE by NPDS                                                         */
/* ===========================                                          */
/*                                                                      */
/* Based on PhpNuke 4.x source code                                     */
/*                                                                      */
/* NPDS Copyright (c) 2002-2008 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.       */
/************************************************************************/
if (!function_exists("Mysql_Connexion")) {
   include ("mainfile.php");
}
include("language/lang-adm-$language.php");

$filemanager=false;
if (file_exists("filemanager.conf")) {
   include_once("filemanager.conf");
}

function login() {
    include ("header.php");
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
    echo adm_translate("Menu Administration");
    echo "</td></tr></table>\n";
    opentable();
    echo "<br /><form action=\"admin.php\" method=\"post\" name=\"adminlogin\"><table width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">";
    echo "<tr><td nowrap=\"nowrap\">".adm_translate("Administrateur ID")." : </td><td><input class=\"textbox_standard\" type=\"text\" name=\"aid\" size=\"20\" maxlength=\"20\"></td><td width=\"40%\" align=\"left\">&nbsp;</td></tr>";
    echo "<tr><td nowrap=\"nowrap\">".adm_translate("Mot de Passe")." : </td><td><input class=\"textbox_standard\" type=\"password\" name=\"pwd\" size=\"20\" maxlength=\"18\"></td>";
    echo "<td width=\"30%\" align=\"left\"><input type=\"hidden\" name=\"op\" value=\"login\"><input class=\"bouton_standard\" type=\"submit\" value=\"".adm_translate("Valider")."\"></td></tr>";
    echo "</table></form>\n";
    echo "<script type=\"text/javascript\" language=\"JavaScript\">document.adminlogin.aid.focus();</script>";
    closetable();
    include ("footer.php");
}

function adminmenu($url, $title="", $image="") {
    global $counter, $nb_option, $max_option, $admingraphic, $adminimg;
    global $NPDS_Prefix;
    
   if (($admingraphic==1) and ($url!="null")) {
       $img="<img src=\"$adminimg$image\" border=\"0\" alt=\"\" /></a><br />";
    } else {
       $img="";
    }
    if ($title==adm_translate("Articles")) {
       $newsubs=sql_num_rows(sql_query("select qid from ".$NPDS_Prefix."queue"));
       if ($admingraphic==1) {
          $close = " ($newsubs)";
       } else {
          $close = "</a> ($newsubs)";
       }
    } else if ($title==adm_translate("Auto-Articles")) {
       $newsubs=sql_num_rows(sql_query("select anid from ".$NPDS_Prefix."autonews"));
       if ($admingraphic==1) {
          $close = " ($newsubs)";
       } else {
          $close = "</a> ($newsubs)";
       }

    } else {
       if ($admingraphic == 1) {
          $close = "";
       } else {
          $close = "</a>";
       }
    }
    $count=true;
    switch($url) {
        case "space" :
           if ($nb_option>$max_option) {
               $max_option=$nb_option;
               $nb_option=0;
           }
           if ($counter>0) { while($counter < 4) $counter++; } else $count=false;
           break;
        case "no_url" :
           echo "<td align=\"center\" width=\"20%\">$img<i>$title</i>$close</td>";
           if ($nb_option<5) $nb_option++;
           break;
        case "center" :
           $tmp=($max_option-($max_option%2))/2;
           for($i = 1; $i <= $tmp; $i++) echo "<td>&nbsp;</td>";
           break;

        case "null" :
           if ($nb_option<5) $nb_option++;
           echo "<td align=\"center\" width=\"20%\">&nbsp;</td>";
           break;
        case "FileManager" :
           $url="<a href=\"javascript:void(0);\" onClick=\"window.open('admin.php?op=FileManager', 'wfma', 'width=800, height=600, menubar=no, location=no, directories=no, status=yes, copyhistory=yes, toolbar=no, scrollbars=yes, resizable=yes');\" class=\"noir\">";
           echo "<td align=\"center\" width=\"20%\">$url$img<b>$title</b>$close</td>";
           break;

        default :
           if ($nb_option<5) $nb_option++;
           echo "<td align=\"center\" width=\"20%\"><a href=\"admin.php?op=$url\" class=\"noir\">$img<b>$title</b>$close</td>";
           break;
    }
    if ($counter == 4) {
        echo "</tr><tr><td height=\"5\" colspan=\"5\"><hr width=\"100%\" class=\"ongl\" noshade></td></tr><tr>";
        $counter = 0;
    } elseif ($count) {
        $counter++;
    }
}

function GraphicAdmin($hlpfile) {
    global $aid, $admingraphic, $adminimg, $language, $admin, $banners, $filemanager, $Version_Sub, $Version_Num;
    global $short_menu_admin, $admf_ext;
    global $NPDS_Prefix;    
   
    $Q = sql_query("SELECT * FROM ".$NPDS_Prefix."authors WHERE aid='$aid' LIMIT 1");
    $Q = sql_fetch_assoc($Q);

    echo "<script type=\"text/javascript\" language=\"JavaScript\">\n";
    echo "<!--\n";
    echo "function openwindow(){\n";
    echo " window.open (\"$hlpfile\",\"Help\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=400\");\n";
    echo "}\n";
    echo "//-->\n";
    echo "</script>\n";

    opentable();
     echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\" border=\"0\"><tr><td class=\"titboxc\" align=\"center\">";
     echo "<a href=\"admin.php\" class=\"heada\">".adm_translate("Menu Administration")."</a>";
     if ($Q[radminsuper]==1) {
        echo"&nbsp|&nbsp<a href=\"admin.php?op=BannersAdmin\" class=\"heada\">".adm_translate("Administration des Bannières")."</a>";
     }

     if (($Q[radminsuper]==1) OR ($Q[radmintopic]==1)) {
        echo "&nbsp|&nbsp<a href=\"admin.php?op=Meta-LangAdmin\" class=\"heada\">".adm_translate("Administration de META-LANG")."</a>";
     } else {
        echo "&nbsp|&nbsp<a href=\"javascript:void(0);\" onClick=\"window.open('modules.php?ModPath=meta-lang&ModStart=adv-meta_lang-doc','MetaLang','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=500')\"; class=\"heada\">META-LANG</a>\n";
     }

     if ($hlpfile) {
        echo "&nbsp|&nbsp<a href=\"javascript: openwindow()\" class=\"heada\">".adm_translate("Manuel en ligne")."</a>";
     }
     echo "</td></tr></table>";

     if ($short_menu_admin!=false) {
        closetable();
        return;
     }
     echo"<div class=\"separ\"></div><table border=\"0\" width=\"100%\" cellspacing=\"0\"><tr>";
     global $counter;
     $counter = 0;

     // Ligne 1
     if (($Q[radminsuper]==1) OR ($Q[radminarticle]==1)) {
        adminmenu("submissions", adm_translate("Articles"), "submissions.".$admf_ext);
        adminmenu("adminStory", adm_translate("Nouvel Article"), "postnew.".$admf_ext);
        adminmenu("autoStory", adm_translate("Auto-Articles"), "autonews.".$admf_ext);
     }
     if (($Q[radminsuper]==1) OR ($Q[radmintopic]==1)) adminmenu("topicsmanager", adm_translate("Gestion des Sujets"), "topicsman.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminsection]==1)) adminmenu("sections", adm_translate("Rubriques"), "sections.".$admf_ext);
     adminmenu("space","","");

     // Ligne 2
     if (($Q[radminsuper]==1) OR ($Q[radminleft]==1) OR ($Q[radminright]==1)) adminmenu("blocks", adm_translate("Blocs"), "block.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminmain]==1)) adminmenu("mblock", adm_translate("Bloc Principal"), "mainblock.".$admf_ext);
     adminmenu("null","","");
     if (($Q[radminsuper]==1) OR ($Q[radminuser]==1)) {
        adminmenu("mod_users", adm_translate("Edition des Utilisateurs"), "users.".$admf_ext);
        adminmenu("email_user", adm_translate("Diffusion d'un Message Interne"), "email_user.".$admf_ext);
     }
     adminmenu("space","","");

     // Ligne 3
     if (($Q[radminsuper]==1) OR ($Q[radminsurvey]==1)) adminmenu("create", adm_translate("Sondages"), "newpoll.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminlink]==1)) adminmenu("links", adm_translate("Liens Web"), "links.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminfaq]==1)) adminmenu("FaqAdmin", adm_translate("Faq"), "faq.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminsdv]==1)) adminmenu("groupes", adm_translate("Gestion des groupes"), "groupes.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radmindownload]==1)) adminmenu("DownloadAdmin", adm_translate("Téléchargement"), "download.".$admf_ext);
     adminmenu("space","","");

     // Ligne 4
     if ($Q[radminsuper]==1) adminmenu("hreferer", adm_translate("Sites Référants"), "referer.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminhead]==1)) adminmenu("HeadlinesAdmin", adm_translate("Grands Titres de sites de News"), "headlines.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminephem]==1)) adminmenu("Ephemerids", adm_translate("Ephémérides"), "ephem.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminreviews]==1)) adminmenu("reviews", adm_translate("Critiques"), "reviews.".$admf_ext);
     if (($Q[radminsuper]==1) OR ($Q[radminarticle]==1)) adminmenu("Edito", adm_translate("Edito"), "filemanager.".$admf_ext);
     adminmenu("space","","");

     // Ligne 5
     if (($Q[radminsuper]==1) OR ($Q[radminforum]==1)) {
        adminmenu("ForumAdmin", adm_translate("Edition des Forums"), "forum.".$admf_ext);
        adminmenu("MaintForumAdmin", adm_translate("Maintenance des Forums"), "forum.".$admf_ext);
        adminmenu("ForumConfigAdmin", adm_translate("Configuration des Forums"), "forum.".$admf_ext);
     }
     if ($Q[radminsuper]==1) {
        adminmenu("MetaTagAdmin", adm_translate("MétaTAGs"), "metatags.".$admf_ext);
     }
     if (($Q[radminsuper]==1) OR ($Q[radminlnl]==1)) adminmenu("lnl", adm_translate("Petite Lettre D'information"), "lnl.".$admf_ext);
     if ($Q[radminsuper]==1) {
        adminmenu("space","","");
     }
     // Ligne 6
     if ($Q[radminsuper]==1) {
        adminmenu("Configure", adm_translate("Préférences"), "preferences.".$admf_ext);
        adminmenu("ConfigFiles", adm_translate("Editer les fichiers de configuration"), "preferences.".$admf_ext);
        adminmenu("mod_authors", adm_translate("Editer les Administrateurs"), "authors.".$admf_ext);
        adminmenu("ablock", adm_translate("Bloc Administration"), "adminblock.".$admf_ext);
        adminmenu("Modules", adm_translate("Gestion, Installation Modules"), "optimysql.".$admf_ext);
        adminmenu("space","","");
     }

     // Ligne 7
     if ($Q[radminsuper]==1) {
        adminmenu("OptimySQL", adm_translate("OptimySQL"), "optimysql.".$admf_ext);
        adminmenu("SavemySQL", adm_translate("SavemySQL"), "savemysql.".$admf_ext);
     }
     if (($Q[radminsuper]==1) OR ($Q[radminfilem]==1)) {
        if ($filemanager==1) {
           adminmenu("FileManager", adm_translate("Gestionnaire de Fichiers"), "filemanager.".$admf_ext);
        } else {
           adminmenu("no_url", adm_translate("Gestionnaire de Fichiers"), "filemanager.".$admf_ext);
        }
     }
     adminmenu("supercache", adm_translate("SuperCache"), "overload.".$admf_ext);
     adminmenu("Extend-Admin-Module", adm_translate("Admin-Plugins"), "plugin.".$admf_ext);
     adminmenu("space","","");

     // Ligne 8
     adminmenu("center","","");
     adminmenu("logout", adm_translate("Déconnexion"), "exit.".$admf_ext);

     // Pied de menu admin
     echo "</tr><tr><td colspan=\"5\" class=\"titboxc\" align=\"right\">$Version_Sub $Version_Num</td>";

     echo"</tr></table>";
    closetable();
    return ($Q[radminsuper]);
}

function adminMain($deja_affiches) {
   global $language, $admart, $hlpfile, $aid;
   global $NPDS_Prefix;   
   $hlpfile = "manuels/$language/admin.html";
   include("header.php");
   global $short_menu_admin;
   $short_menu_admin=false;
   $radminsuper=GraphicAdmin($hlpfile);
   opentable();

   echo "<br /><table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
   echo adm_translate("Derniers")." $admart ".adm_translate("Articles");
   echo "</td></tr></table>\n";

   $resul=sql_query("select sid from ".$NPDS_Prefix."stories");
   $nbre_articles=sql_num_rows($resul);
   settype($deja_affiches,"integer");
   settype($admart,"integer");
   $result = sql_query("select sid, title, hometext, topic, informant, time, archive from ".$NPDS_Prefix."stories order by time desc LIMIT $deja_affiches,$admart");

   if ($nbre_articles) {
      echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
      $i=0;
      while( (list($sid, $title, $hometext, $topic, $informant, $time, $archive) = sql_fetch_row($result)) and ($i<$admart) ) {
         $affiche=false;
         $result2=sql_query("select topicadmin, topictext from ".$NPDS_Prefix."topics where topicid='$topic'");
         list ($topicadmin, $topictext)=sql_fetch_row($result2);
         if ($radminsuper) {
            $affiche=true;
         } else {
            $topicadminX=explode(",",$topicadmin);
            for ($iX = 0; $iX < count($topicadminX); $iX++) {
               if (trim($topicadminX[$iX])==$aid) $affiche=true;
            }
         }
         $rowcolor = tablos();
         echo "<tr $rowcolor><td align=\"left\">$sid</td><td align=\"left\" width=\"80%\">";

         $title=aff_langue($title);
         if ($archive) {
            echo "$title <i>(archive)</i>";
         } else {
            if ($affiche) {
               echo "<a href=\"article.php?sid=$sid\" class=\"heada\">$title</a>";
            } else {
               echo "<i>$title</i>";
            }
         }
         if ($topictext=="") {
            echo "</td><td align=\"left\">&nbsp;";
         } else {
            echo "</td><td align=\"left\" nowrap=\"nowrap\">".aff_langue($topictext);
         }
         if ($affiche) {
            echo "</td><td align=\"left\" nowrap=\"nowrap\"><a href=\"admin.php?op=EditStory&amp;sid=$sid\" class=\"noir\">".adm_translate("Editer")."</a> | <a href=\"admin.php?op=RemoveStory&amp;sid=$sid\" class=\"rouge\">".adm_translate("Effacer")."</a>";
         } else {
            echo "</td><td width=\"15%\" align=\"left\" nowrap=\"nowrap\">&nbsp;";
         }
         echo "</td></tr>";
         $i++;
      }
      echo "</table><p align=\"center\"><br />";
      echo $nbre_articles." Articles | <a href=\"admin.php?op=suite_articles&amp;deja_affiches=0\" class=\"noir\">".adm_translate("Les plus récents")."</a>";
      if ($deja_affiches>=$admart) echo " | <a href=\"admin.php?op=suite_articles&amp;deja_affiches=".($deja_affiches-$admart)."\" class=\"noir\">".adm_translate("Précédent")."</a>";
      if (($deja_affiches + $i) < $nbre_articles) {
         $deja_affiches+=$admart;
         echo " | <a href=\"admin.php?op=suite_articles&amp;deja_affiches=".$deja_affiches."\" class=\"noir\">".adm_translate("Suivant")."</a>";
      }
      echo "<form action=\"admin.php\" method=\"post\">
      ".adm_translate("ID Article:")." <input class=\"textbox_standard\" type=\"text\" name=\"sid\" size=\"10\">
      <select class=\"textbox_standard\" name=\"op\">
      <option value=\"EditStory\" selected>".adm_translate(" Editer un Article ")."</option>
      <option value=\"RemoveStory\">".adm_translate(" Effacer l'Article")."</option>
      </select>
      <input class=\"bouton_standard\" type=\"submit\" value=\"".adm_translate("Ok")."\">
      </form></p>";
   }
   closetable();
   include("footer.php");
}

if ($admintest) {
   switch($op) {
        case "GraphicAdmin":
             GraphicAdmin($hlpfile);
             break;

        case "logout":
             setcookie("admin");
             unset($admin);
             Header("Location: index.php");
             break;

        // FILES MANAGER
        case "FileManager":
            if ($admintest and $filemanager) {
               header("location: modules.php?ModPath=f-manager&ModStart=f-manager&FmaRep=$aid");
            }
            break;
        case "FileManagerDisplay":
            if ($admintest and $filemanager) {
               header("location: modules.php?ModPath=f-manager&ModStart=f-manager&FmaRep=download");
            }
            break;
        // FILES MANAGER

        // CRITIQUES
        case "reviews":
        case "mod_main":
        case "add_review":
             include("admin/reviews.php");
             break;
        case "deleteNotice":
             sql_query("delete from ".$NPDS_Prefix."reviews_add WHERE id='$id'");
             Header("Location: admin.php?op=$op_back");
             break;
        // CRITIQUES

        // FORUMS
        case "ForumConfigAdmin":
             include ("admin/phpbbconfig.php");
             ForumConfigAdmin();
             break;
        case "ForumConfigChange":
             include ("admin/phpbbconfig.php");
             ForumConfigChange($allow_html,$allow_bbcode,$allow_sig,$posts_per_page,$hot_threshold,$topics_per_page,$allow_upload_forum,$allow_forum_hide,$rank1,$rank2,$rank3,$rank4,$rank5,$anti_flood,$solved);
             break;

        case "MaintForumAdmin":
             include ("admin/phpbbmaint.php");
             ForumMaintAdmin();
             break;
        case "MaintForumMarkTopics":
             include ("admin/phpbbmaint.php");
             ForumMaintMarkTopics();
             break;
        case "MaintForumTopics":
             include ("admin/phpbbmaint.php");
             ForumMaintTopics($before, $forum_name);
             break;
        case "MaintForumTopicDetail":
             include ("admin/phpbbmaint.php");
             ForumMaintTopicDetail($topic, $topic_title);
             break;
        case "SynchroForum":
             include ("admin/phpbbmaint.php");
             SynchroForum();
             break;
        case "ForumMaintTopicSup":
             include ("admin/phpbbmaint.php");
             ForumMaintTopicSup($topic);
             break;
        case "ForumMaintTopicMassiveSup":
             include ("admin/phpbbmaint.php");
             ForumMaintTopicMassiveSup($topics);
             break;
        case "MergeForum":
             include ("admin/phpbbmaint.php");
             MergeForum();
             break;
        case "MergeForumAction":
             include ("admin/phpbbmaint.php");
             MergeForumAction($oriforum,$destforum);
             break;

        case "ForumGoAdd":
             include ("admin/phpbbforum.php");
             ForumGoAdd($forum_name, $forum_desc, $forum_access, $forum_mod, $cat_id, $forum_type, $forum_pass, $arbre, $attachement, $forum_index, $ctg);
             break;
        case "ForumGoSave":
             include ("admin/phpbbforum.php");
             ForumGoSave($forum_id, $forum_name, $forum_desc, $forum_access, $forum_mod, $cat_id, $forum_type, $forum_pass, $arbre, $attachement, $forum_index, $ctg);
             break;
        case "ForumCatDel":
             include ("admin/phpbbforum.php");
             ForumCatDel($cat_id, $ok);
             break;
        case "ForumGoDel":
             include ("admin/phpbbforum.php");
             ForumGoDel($forum_id, $ok);
             break;
        case "ForumCatSave":
             include ("admin/phpbbforum.php");
             ForumCatSave($old_cat_id, $cat_id, $cat_title);
             break;
        case "ForumCatEdit":
             include ("admin/phpbbforum.php");
             ForumCatEdit($cat_id);
             break;
        case "ForumGoEdit":
             include ("admin/phpbbforum.php");
             ForumGoEdit($forum_id,$ctg);
             break;
        case "ForumGo":
             include ("admin/phpbbforum.php");
             ForumGo($cat_id);
             break;
        case "ForumCatAdd":
             include ("admin/phpbbforum.php");
             ForumCatAdd($catagories);
             break;
        case "ForumAdmin":
             include ("admin/phpbbforum.php");
             ForumAdmin();
             break;
        // FORUMS

        // DOWNLOADS
        case "DownloadDel":
             include ("admin/download.php");
             DownloadDel($did, $ok);
             break;
        case "DownloadAdd":
             include ("admin/download.php");
             DownloadAdd($dcounter, $durl, $dfilename, $dfilesize, $dweb, $duser, $dver, $dcategory, $sdcategory, $xtext, $privs, $Mprivs);
             break;
        case "DownloadSave":
             include ("admin/download.php");
             DownloadSave($did, $dcounter, $durl, $dfilename, $dfilesize, $dweb, $duser, $ddate, $dver, $dcategory, $sdcategory, $xtext, $privs, $Mprivs);
             break;
        case "DownloadAdmin":
             include ("admin/download.php");
             DownloadAdmin();
             break;
        case "DownloadEdit":
             include ("admin/download.php");
             DownloadEdit($did);
             break;
        // DOWNLOADS

        // FAQ
        case "FaqCatSave":
             include ("admin/adminfaq.php");
             FaqCatSave($old_id_cat, $id_cat, $categories);
             break;
        case "FaqCatGoSave":
             include ("admin/adminfaq.php");
             FaqCatGoSave($id, $question, $answer);
             break;
        case "FaqCatAdd":
             include ("admin/adminfaq.php");
             FaqCatAdd($categories);
             break;
        case "FaqCatGoAdd":
             include ("admin/adminfaq.php");
             FaqCatGoAdd($id_cat, $question, $answer);
             break;
        case "FaqCatEdit":
             include ("admin/adminfaq.php");
             FaqCatEdit($id_cat);
             break;
        case "FaqCatGoEdit":
             include ("admin/adminfaq.php");
             FaqCatGoEdit($id);
             break;
        case "FaqCatDel":
             include ("admin/adminfaq.php");
             FaqCatDel($id_cat, $ok);
             break;
        case "FaqCatGoDel":
             include ("admin/adminfaq.php");
             FaqCatGoDel($id, $ok);
             break;
        case "FaqAdmin":
             include ("admin/adminfaq.php");
             FaqAdmin();
             break;
        case "FaqCatGo":
             include ("admin/adminfaq.php");
             FaqCatGo($id_cat);
             break;
        // FAQ

        // AUTOMATED
        case "autoStory":
        case "autoEdit":
        case "autoDelete":
        case "autoSaveEdit":
             include("admin/automated.php");
             break;
        // AUTOMATED

        // NEWS
        case "submissions":
             include("admin/submissions.php");
             break;
        // NEWS

        // REFERANTS
        case "HeadlinesDel":
        case "HeadlinesAdd":
        case "HeadlinesSave":
        case "HeadlinesAdmin":
        case "HeadlinesEdit":
             include("admin/headlines.php");
             break;
        // REFERANTS

        // PREFERENCES
        case "Configure":
        case "ConfigSave":
            include("admin/settings.php");
            break;
        // PREFERENCES

        // EPHEMERIDS
        case "Ephemeridsedit":
        case "Ephemeridschange":
        case "Ephemeridsdel":
        case "Ephemeridsmaintenance":
        case "Ephemeridsadd":
        case "Ephemerids":
            include("admin/ephemerids.php");
            break;
        // EPHEMERIDS

        // LINKS
        case "links":
        case "LinksDelNew":
        case "LinksAddCat":
        case "LinksAddSubCat":
        case "LinksAddLink":
        case "LinksAddEditorial":
        case "LinksModEditorial":
        case "LinksDelEditorial":
        case "LinksCleanVotes":
        case "LinksListBrokenLinks":
        case "LinksDelBrokenLinks":
        case "LinksIgnoreBrokenLinks":
        case "LinksListModRequests":
        case "LinksChangeModRequests":
        case "LinksChangeIgnoreRequests":
        case "LinksDelCat":
        case "LinksModCat":
        case "LinksModCatS":
        case "LinksModLink":
        case "LinksModLinkS":
        case "LinksDelLink":
        case "LinksDelVote":
        case "LinksDelComment":
        case "suite_links":
            include("admin/links.php");
            break;
        // LINKS

        // BANNERS
        case "BannersAdmin":
        case "BannersAdd":
        case "BannerAddClient":
        case "BannerFinishDelete":
        case "BannerDelete":
        case "BannerEdit":
        case "BannerChange":
        case "BannerClientDelete":
        case "BannerClientEdit":
        case "BannerClientChange":
             include("admin/banners.php");
             break;
        // BANNERS

        // HTTP Referer
        case "hreferer":
        case "delreferer":
        case "archreferer":
             include("admin/referers.php");
             break;
        // HTTP Referer

        // TOPIC Manager
        case "topicsmanager":
        case "topicedit":
        case "topicmake":
        case "topicdelete":
        case "topicchange":
        case "relatedsave":
        case "relatededit":
        case "relateddelete":
             include("admin/topics.php");
             break;
        // TOPIC Manager

        // SECTIONS - RUBRIQUES
        case "new_rub_section":
        case "sections":
        case "sectionedit":
        case "sectionmake":
        case "sectiondelete":
        case "sectionchange":
        case "rubriquedit":
        case "rubriquemake":
        case "rubriquedelete":
        case "rubriquechange":
        case "secarticleadd":
        case "secartedit":
        case "secartchange":
        case "secartchangeup":
        case "secartdelete":
        case "secartpublish":
        case "secartupdate":
        case "secartdelete2":
        case "ordremodule":
        case "ordrechapitre":
        case "ordrecours":
        case "majmodule":
        case "majchapitre":
        case "majcours":
        case "publishcompat":
        case "updatecompat":
        case "droitauteurs":
        case "updatedroitauteurs":
        case "menu_dyn":
             include("admin/sections.php");
             break;
        // SECTIONS - RUBRIQUES

        // BLOCKS
        case "blocks":
              include("admin/blocks.php");
              break;

             case "makerblock":
             case "deleterblock":
             case "changerblock":
             case "gaucherblock":
                  include("admin/rightblocks.php");
                  break;

             case "makelblock":
             case "deletelblock":
             case "changelblock":
             case "droitelblock":
                  include("admin/leftblocks.php");
                  break;

        case "ablock":
        case "changeablock":
             include("admin/adminblock.php");
             break;

        case "mblock":
        case "changemblock":
              include("admin/mainblock.php");
              break;
        // BLOCKS

        // STORIES
        case "DisplayStory":
        case "PreviewAgain":
        case "PostStory":
        case "DeleteStory":
        case "EditStory":
        case "ChangeStory":
        case "RemoveStory":
        case "adminStory":
        case "PreviewAdminStory":
        // CATEGORIES des NEWS
        case "EditCategory":
        case "DelCategory":
        case "YesDelCategory":
        case "NoMoveCategory":
        case "SaveEditCategory":
        case "AddCategory":
        case "SaveCategory":
             include("admin/stories.php");
             break;
        // CATEGORIES des NEWS
        // STORIES

        // AUTHORS
        case "mod_authors":
        case "modifyadmin":
        case "UpdateAuthor":
        case "AddAuthor":
        case "deladmin":
        case "deladminconf":
             include("admin/authors.php");
             break;
        // AUTHORS

        // USERS
        case "mod_users":
        case "modifyUser":
        case "updateUser":
        case "delUser":
        case "delUserConf":
        case "addUser":
        case "extractUserCSV":
        case "unsubUser":
             include("admin/users.php");
             break;
        // USERS

        // SONDAGES
        case "create":
        case "createPosted":
        case "remove":
        case "removePosted":
        case "editpoll":
        case "editpollPosted":
        case "SendEditPoll":
             include("admin/polls.php");
             break;
        // SONDAGES

        // DIFFUSION MI ADMIN
        case "email_user":
        case "send_email_to_user":
             include("admin/email_user.php");
             break;
        // DIFFUSION MI ADMIN

        // LNL
        case "lnl":
            include("admin/lnl.php");
            break;
            case "lnl_Sup_Header":
               $op="Sup_Header";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_Body":
               $op="Sup_Body";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_Footer":
               $op="Sup_Footer";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_HeaderOK":
               $op="Sup_HeaderOK";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_BodyOK":
               $op="Sup_BodyOK";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_FooterOK":
               $op="Sup_FooterOK";
               include("admin/lnl.php");
               break;
            case "lnl_Shw_Header":
               $op="Shw_Header";
               include("admin/lnl.php");
               break;
            case "lnl_Shw_Body":
               $op="Shw_Body";
               include("admin/lnl.php");
               break;
            case "lnl_Shw_Footer":
               $op="Shw_Footer";
               include("admin/lnl.php");
               break;
            case "lnl_Add_Header":
               $op="Add_Header";
               include("admin/lnl.php");
               break;
               case "lnl_Add_Header_Submit":
                  $op="Add_Header_Submit";
                  include("admin/lnl.php");
                  break;
               case "lnl_Add_Header_Mod":
                  $op="Add_Header_Mod";
                  include("admin/lnl.php");
                  break;
            case "lnl_Add_Body":
               $op="Add_Body";
               include("admin/lnl.php");
               break;
               case "lnl_Add_Body_Submit":
                  $op="Add_Body_Submit";
                  include("admin/lnl.php");
                  break;
               case "lnl_Add_Body_Mod":
                  $op="Add_Body_Mod";
                  include("admin/lnl.php");
                  break;
            case "lnl_Add_Footer":
               $op="Add_Footer";
               include("admin/lnl.php");
               break;
               case "lnl_Add_Footer_Submit":
                  $op="Add_Footer_Submit";
                  include("admin/lnl.php");
                  break;
               case "lnl_Add_Footer_Mod":
                  $op="Add_Footer_Mod";
                  include("admin/lnl.php");
                  break;
            case "lnl_Test":
               $op="Test";
               include("admin/lnl.php");
               break;
            case "lnl_Send":
               $op="Send";
               include("admin/lnl.php");
               break;
            case "lnl_List":
               $op="List";
               include("admin/lnl.php");
               break;
            case "lnl_User_List":
               $op="User_List";
               include("admin/lnl.php");
               break;
            case "lnl_Sup_User":
               $op="Sup_User";
               include("admin/lnl.php");
               break;
        // LNL

        // SUPERCACHE
        case "supercache":
        case "supercache_save":
        case "supercache_empty":
             include("admin/overload.php");
             break;
        // SUPERCACHE

        // OPTIMYSQL
        case "OptimySQL":
             include("admin/optimysql.php");
             break;
        // OPTIMYSQL

        // SAVEMYSQL
        case "SavemySQL":
             include("admin/savemysql.php");
             break;
        // SAVEMYSQL

        // EDITO
        case "Edito":
        case "Edito_save":
        case "Edito_load":
             include("admin/adminedito.php");
             break;
        // EDITO

        // METATAGS
        case "MetaTagAdmin":
        case "MetaTagSave":
             include("admin/metatags.php");
             break;
        // METATAGS
        
// <!-- META-LANG  -->
      case "Meta-LangAdmin":
      case "List_Meta_Lang":
      case "Creat_Meta_Lang":
      case "Edit_Meta_Lang":
      case "Kill_Meta_Lang":
      case "Valid_Meta_Lang":
      include("admin/meta_lang.php");
      break;
// <!-- / META-LANG  -->

        // ConfigFiles
        case "ConfigFiles":
        case "ConfigFiles_load":
        case "ConfigFiles_save":
        case "ConfigFiles_create":
        case "delete_configfile":
        case "ConfigFiles_delete":
             include("admin/configfiles.php");
             break;
        // ConfigFiles

        // NPDS-Admin-Plugins
        case "Extend-Admin-Module":
        case "Extend-Admin-SubModule":
             include("admin/plugins.php");
             break;
        // NPDS-Admin-Plugins

        // NPDS-Admin-Groupe
        case "groupes";
        case "groupe_edit":
        case "groupe_maj":
        case "groupe_add":
        case "groupe_add_finish":
        case "retiredugroupe":
        case "membre_add":
        case "membre_add_finish":
             include("admin/groupes.php");
             break;
        // NPDS-Admin-Groupe

        // NPDS-Instal-Modules
        case "Modules":
          include("admin/modules.php");
             break;
        case "Module-Install":
          include("admin/module-install.php");
             break;
        // NPDS-Instal-Modules

        // NPDS-Admin-Main
        case "suite_articles":
             adminMain($deja_affiches);
             break;

        case "adminMain":
        default:
             adminMain(0);
             break;
        // NPDS-Admin-Main
   }
} else {
   login();
}
?>