DATEIVERGLEICH
Erstellt: 22.05.2005 00:30:53
   
Modus: Alle Zeilen  
   
Linke Datei: D:\Localhost_2\nuke5.5\html\admin.php     Rechte Datei: D:\Localhost\pragmaMx\stable\admin.php  
1 <?php <> 1 <?php // $Id: admin.php,v 1.2 2005/03/31 11:14:21 tora60 Exp $
2     2 /************************************
3 /************************************************************************/   3 pragmaMx  Content Management System
4 /* PHP-NUKE: Advanced Content Management System                         */   4 Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
5 /* ============================================                         */   5 ***********************************
6 /*                                                                      */      
7 /* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)         */      
8 /* http://phpnuke.org                                                   */      
9 /*                                                                      */      
10 /* This program is free software. You can redistribute it and/or modify */   6 This program is free software; you can redistribute it and/or modify
11 /* it under the terms of the GNU General Public License as published by */   7 it under the terms of the GNU General Public License as published by
12 /* the Free Software Foundation; either version 2 of the License.       */   8 the Free Software Foundation; either version 2 of the License, or
13 /************************************************************************/   9 (at your option) any later version.
14     10 ***********************************
15 require_once("mainfile.php");   11 $Source: /cvsroot/pragmamx/stable/admin.php,v $
16 get_lang(admin);   12 $Revision: 1.2 $
17     13 $Author: tora60 $
18 function create_first($name, $url, $email, $pwd, $user) {   14 $Date: 2005/03/31 11:14:21 $
19     global $prefix, $dbi, $user_prefix;   15 ************************************/
20     $first = sql_num_rows(sql_query("select * from ".$prefix."_authors", $dbi),$dbi);      
21     if ($first == 0) {      
22         $pwd = md5($pwd);   16  
23         $the_adm = "God";   17 define("mxAdminFileLoaded","1");
24         $result = sql_query("insert into ".$prefix."_authors values ('$name', '$the_adm', '$url', '$email', '$pwd', 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, '')", $dbi);      
25         if ($user == 1) {   18  
26             $user_regdate = date("M d, Y");   19 if(!defined("MX_TIME")) {
27             $user_avatar = "blank.gif";   20         $vstarttime = explode(" ",microtime());
28             $commentlimit = 4096;   21         define("MX_TIME",(float)$vstarttime[1] + (float)$vstarttime[0]);
29             $result = sql_query("insert into ".$user_prefix."_users values (NULL,'','$name','$email','','$url','$user_avatar','$user_regdate','','','','','','0','','','','','$pwd',10,'','0','0','0','','0','','$Default_Theme','$commentlimit','0','0','0','0','0','1')", $dbi);   22         unset($vstarttime);
30         } = 23         }
31         login(); <> 24 // nur zum initialisieren der Variablen, wird durch das Modul überschrieben
32     }   25 $GLOBALS['index'] = 0;
33 }      
34   = 26  
35 $the_first = sql_num_rows(sql_query("select * from ".$prefix."_authors", $dbi), $dbi); <>    
36 if ($the_first == 0) {      
37     if (!$name) {      
38     include("header.php");   27 require_once("mainfile.php");
39     title("$sitename: "._ADMINISTRATION."");   28 if (basename(__file__) != basename($_SERVER['PHP_SELF'])) {
40     OpenTable();   29         echo "<b>Error:</b><br><br>Bad Server/PHP-Settings the \"\$_SERVER['PHP_SELF']\" variable is not correct.<br>Please contact your provider to fix it.<br><br>Current setting is: ".$_SERVER['PHP_SELF']."<br>Must be: ".MX_BASE_URI."/".basename(__file__)."";
41     echo "<center><b>"._NOADMINYET."</b></center><br><br>"      
42         ."<form action=\"admin.php\" method=\"post\">"      
43         ."<table border=\"0\">"      
44         ."<tr><td><b>"._NICKNAME.":</b></td><td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"25\"></td></tr>"      
45         ."<tr><td><b>"._HOMEPAGE.":</b></td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"255\" value=\"http://\"></td></tr>"      
46         ."<tr><td><b>"._EMAIL.":</b></td><td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"255\"></td></tr>"      
47         ."<tr><td><b>"._PASSWORD.":</b></td><td><input type=\"password\" name=\"pwd\" size=\"11\" maxlength=\"10\"></td></tr>"      
48         ."<tr><td colspan=\"2\">"._CREATEUSERDATA."  <input type=\"radio\" name=\"user\" value=\"1\" checked>"._YES."&nbsp;&nbsp;<input type=\"radio\" name=\"user\" value=\"0\">"._NO."</td></tr>"      
49         ."<tr><td><input type=\"hidden\" name=\"fop\" value=\"create_first\">"      
50         ."<input type=\"submit\" value=\""._SUBMIT."\">"      
51         ."</td></tr></table></form>";      
52     CloseTable();      
53     include("footer.php");      
54     }      
55     switch($fop) {      
56         case "create_first":      
57         create_first($name, $url, $email, $pwd, $user);      
58         break;      
59     }      
60     die();      
61 }   30         }
62     31 mxGetLangfile("admin");
63 require("auth.php");      
64   = 32  
65 if(!isset($op)) { $op = "adminMain"; } +-    
66 $pagetitle = "- "._ADMINMENU.""; = 33 $pagetitle = "- "._ADMINMENU."";
67     34  
68 /*********************************************************/ <> 35 ################################################################################
69 /* Login Function                                        */      
70 /*********************************************************/      
71   =    
72 function login() {   36 function login() {
    <> 37         if (defined("MX_CO_ERROR")) {
      38                 mxErrorScreen(_ADMIN_BADLOGIN3);
      39                 }
      40         mt_srand((double)microtime()*1000000);
      41         $xcv = mt_rand();
      42         mxSessionSetVar("reqcheck", $xcv);
      43         $formmessage = mxSessionGetVar("formmessage");
      44         mxSessionDelVar("formmessage");
73     include ("header.php");   45         include ("header.php");
74     OpenTable();   46         OpenTable();
75     echo "<center><font class=\"title\"><b>"._ADMINLOGIN."</b></font></center>";   47         echo "<center><font class=\"title\"><b>"._ADMINLOGIN."</b></font></center>";
76     CloseTable();   48         CloseTable();
77     echo "<br>";   49         echo "<br>";
78     OpenTable();   50         OpenTable();
      51         if ($formmessage) {
      52                 echo "<br>".$formmessage."<br><br>";
      53                 }
79     echo "<form action=\"admin.php\" method=\"post\">"   54         echo "<form action=\"admin.php\" method=\"post\" name=\"adminlogin\">"
80         ."<table border=\"0\">"   55         ."<table border=\"0\">"
81         ."<tr><td>"._ADMINID."</td>" = 56         ."<tr><td>"._ADMINID."</td>"
82         ."<td><input type=\"text\" NAME=\"aid\" SIZE=\"20\" MAXLENGTH=\"20\"></td></tr>" <> 57         ."<td><input type=\"text\" NAME=\"aid\" size=\"30\" maxlength=\"25\"></td></tr>"
83         ."<tr><td>"._PASSWORD."</td>" = 58         ."<tr><td>"._PASSWORD."</td>"
84         ."<td><input type=\"password\" NAME=\"pwd\" SIZE=\"20\" MAXLENGTH=\"18\"></td></tr>" <> 59         ."<td><input type=\"password\" NAME=\"pwd\" size=\"30\" maxlength=\"20\"></td></tr>"
85         ."<tr><td>" = 60         ."<tr><td>"
86         ."<input type=\"hidden\" NAME=\"op\" value=\"login\">"   61         ."<input type=\"hidden\" NAME=\"op\" value=\"login\">"
    -+ 62         ."<input type=\"hidden\" NAME=\"check\" value=\"".MD5($xcv)."\">"
      63         ."<input type=\"hidden\" NAME=\"sess\" value=\"".MD5(session_id())."\">"
87         ."<input type=\"submit\" VALUE=\""._LOGIN."\">" = 64         ."<input type=\"submit\" VALUE=\""._LOGIN."\">"
88         ."</td></tr></table>"   65         ."</td></tr></table>"
89         ."</form>";   66         ."</form>";
    <> 67         echo "<script language='JavaScript' type='text/javascript'>\n<!--\ndocument.adminlogin.aid.focus();\n//-->\n</script>";
90     CloseTable();   68         CloseTable();
91     include ("footer.php");   69         include ("footer.php");
92 }   70         }
93   = 71  
94 function deleteNotice($id, $table, $op_back) { <> 72 ##################################################################################
95     global $dbi;      
96     sql_query("delete from $table WHERE id = $id", $dbi);      
97     Header("Location: admin.php?op=$op_back");      
98 }      
99   =    
100 /*********************************************************/ +-    
101 /* Administration Menu Function                          */      
102 /*********************************************************/      
103   =    
104 function adminmenu($url, $title, $image) { <> 73 function adminmenu($url, $title, $image, $target="_self") {
105     global $counter, $admingraphic;   74         global $myxlink, $admingraphic;
106     if ($admingraphic == 1) {   75         if ($admingraphic) {
107         $img = "<img src=\"images/admin/$image\" border=\"0\" alt=\"\"></a><br>";   76                 $img = mxCreateImage("images/admin/$image", strip_tags($title))."<br>";
      77                 $align=" align=\"center\"";
108         $close = "";   78                 }
109     } else {   79         else {
110         $image = "";   80                 $img = "";
111         $close = "</a>";   81                 $align="";
112     }   82                 }
113     echo "<td align=\"center\"><font class=\"content\"><a href=\"$url\">$img<b>$title</b>$close</font></td>";   83         $output="<td $align><font class=\"content\"><a href=\"$url\" target=\"$target\">$img $title </a></font></td>"; # neu!!
114     if ($counter == 5) {   84                         # aus dem Titel und dem generierten Link/Grafik einen gemeinsamen String generieren
115         echo "</tr><tr>";   85                         # Teil 1 wird zum Sortieren benoetigt, Teil 2 ist die eigentliche Ausgabe
116         $counter = 0;   86         $myxlink=$title."@".$output; # neu!!
117     } else {      
118         $counter++;      
119     }      
120 }   87         }
121   = 88  
    -+ 89 ##################################################################################
122 function GraphicAdmin() { = 90 function GraphicAdmin() {
123     global $aid, $admingraphic, $language, $admin, $banners, $prefix, $dbi; <> 91         global $aid, $admingraphic, $language, $admin, $banners, $bannersfsz, $prefix, $op;
124     $result = sql_query("SELECT qid FROM ".$prefix."_queue", $dbi);   92         global $myxlink; # temporaere Variable erstellen, wird in adminmenu() veraendert
125     $newsubs = sql_num_rows($result, $dbi);   93         if(empty($op)) $op="adminMain";
126     $result = sql_query("select radminarticle,radmintopic,radminuser,radminsurvey,radminsection,radminlink,radminephem,radminfaq,radmindownload,radminreviews,radminnewsletter,radminforum,radmincontent,radminency,radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);   94         $result = sql_query("select * from ${prefix}_authors where aid='$aid'");
127     list($radminarticle,$radmintopic,$radminuser,$radminsurvey,$radminsection,$radminlink,$radminephem,$radminfaq,$radmindownload,$radminreviews,$radminnewsletter,$radminforum,$radmincontent,$radminency,$radminsuper) = sql_fetch_array($result, $dbi);   95         $admindata = sql_fetch_array($result);
      96         extract($admindata);
128     OpenTable();   97         OpenTable();
129     echo "<center><b><a class=\"storycat\" href=\"admin.php\">"._ADMINMENU."</a></b>";   98         echo "<center>";
130     if ($radminsuper==1) {   99         echo"<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr valign=\"top\">";
131         echo"&nbsp;&nbsp;&nbsp;<b><a class=\"storycat\" href=\"admin.php?op=BannersAdmin\">"._BANNERSADMIN."</a></b>";      
132     }   100         $menulist="";
133     echo "<br><br>";      
134     echo"<table border=\"0\" width=\"100%\" cellspacing=\"1\"><tr>";      
135     $linksdir = dir("admin/links");   101         $linksdir = dir("admin/links");
      102         $handle=opendir("admin/links"); # Ordner oeffnen
136     while($func=$linksdir->read()) {   103         $thelinks = array();
137         if(substr($func, 0, 6) == "links.") {   104         while ($linkfile = readdir($handle)) { # alle Dateien des Ordners durchlaufen
138             $menulist .= "$func ";   105                 if(substr($linkfile, 0, 6) == "links.") {       # nur bestimmte Dateien ansprechen
      106                         include_once("admin/links/".$linkfile); # Datei einlesen, hier wird jeweils die funktion adminmenu() ausgefuehrt
      107                         $thelinks[]=$myxlink; # array mit der veraenderten Variablen fuellen
139         }   108                         }
      109                 $myxlink="";     # temporaere Variable zuruecksetzen
140     }   110                 }
141     closedir($linksdir->handle);   111         $counter = 0;                   # counter initialisieren
142     $menulist = explode(" ", $menulist);   112         natsort($thelinks);     # array alphabetisch nach Titel sortieren
      113         $myxlink="";                    # temporaere Variable nochmals zuruecksetzen
      114         adminmenu("admin.php?op=logout", ""._ADMINLOGOUT."", "exit.gif"); # zusaetzlichen Logout Button erzeugen
      115         $thelinks[]=$myxlink;   # und an array anfuegen (am Ende)
143     sort($menulist);   116                
144     for ($i=0; $i < sizeof($menulist); $i++) {   117         while (list ($key, $xlinkfile) = each ($thelinks)) {    # sortiertes array durchlaufen
      118                 $xlinkfile2=explode("@",$xlinkfile);    # den in adminmenu() erzeugten String trennen
      119                 if(!empty($xlinkfile2[1])){             # nur wenn Link auch angezeigt werden soll (Adminberechtigung)
      120                         $linkfile=$xlinkfile2[1];               # daraus nur den Link/die Grafik verwenden
      121                         if ($counter == 5) {            # wenn 5x durchlaufen
      122                                 $linkfile="".$linkfile."</tr><tr valign=\"top\">"; # neue Tabellenzeile beginnen
      123                                 $counter = 0;   # und counter wieder auf 0
      124                                 }
145         if($menulist[$i]!="") {   125                         else {
      126                                 $counter++;     # ansonsten counter erhoehen
146             $counter = 0;   127                                 }
147             include($linksdir->path."/$menulist[$i]");   128                         echo $linkfile; # das war's, Link/Grafik in Tabellenzelle anzeigen
148         }   129                         }
149     }   130                 }
150     adminmenu("admin.php?op=logout", ""._ADMINLOGOUT."", "exit.gif");   131         if ($counter>0 && $counter<6) {
      132                 echo "<td colspan='".(6-$counter)."'>&nbsp;</td>";
      133                 }
151     echo"</tr></table></center>";   134         echo"</tr></table></center>";
152     CloseTable();   135         CloseTable();
153     echo "<br>";   136         echo "<br>";
154 }   137         }
155   = 138  
156 /*********************************************************/ <> 139 ##################################################################################
157 /* Administration Main Function                          */      
158 /*********************************************************/      
159   =    
160 function adminMain() {   140 function adminMain() {
161     global $language, $admin, $aid, $prefix, $file, $dbi, $sitename; <> 141         global $language, $admin, $aid, $prefix, $user_prefix, $file, $sitename, $bgcolor1,$bgcolor2, $bgcolor5;
162     include ("header.php");   142         include ("header.php");
      143         $queryalang = (empty($queryalang)) ? "" : $queryalang;
163     $dummy = 0;   144         $dummy = 0;
164     GraphicAdmin();   145         GraphicAdmin();
165     $result2 = sql_query("select radminarticle, radminsuper, admlanguage from ".$prefix."_authors where aid='$aid'", $dbi);   146         $content1 = "";
166     list($radminarticle, $radminsuper, $admlanguage) = sql_fetch_row($result2, $dbi);   147         if($GLOBALS['vkpUserregoption']==2){
167    if ($admlanguage != "" ) {   148                 list($num) = sql_fetch_row(sql_query("select count(uid) from ${user_prefix}_users WHERE user_stat=0"));
168         $queryalang = "WHERE alanguage='$admlanguage' ";   149                 if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=mod_users\">"._AB_NEWUSERS."</a></td></tr>";
      150                 $num=0;
169     } else {   151         }
      152         list($num) = sql_fetch_row(sql_query("select count(qid) from ${prefix}_queue"));
      153         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=submissions\">"._AB_SUBMISSIONS."</a></td></tr>";
170         $queryalang = "";   154         $num=0;
      155         list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_reviews WHERE active='0';"));
      156         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=reviews\">"._WREVIEWS."</a></td></tr>";
171     }   157         $num=0;
172    $main_m = sql_query("select main_module from ".$prefix."_main", $dbi);   158         list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_links_newlink;"));
173     list($main_module) = sql_fetch_row($main_m, $dbi);   159         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=Links\">"._AB_WLINKS."</a></td></tr>";
174     OpenTable();   160         $num=0;
175     echo "<center><b>$sitename: "._DEFHOMEMODULE."</b><br><br>"   161         list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=0;"));
176         .""._MODULEINHOME." <b>$main_module</b><br>[ <a href=\"admin.php?op=modules\">"._CHANGE."</a> ]</center>";   162         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListModRequests\">"._AB_MODREQLINKS."</a></td></tr>";
177     CloseTable();   163         $num=0;
178     echo "<br>";   164         list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=1;"));
      165         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListBrokenLinks\">"._AB_BROKENLINKS."</a></td></tr>";
179     OpenTable();   166         $num=0;
180     $result = sql_query("SELECT username FROM ".$prefix."_session where guest=1", $dbi);   167         list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_downloads_newdownload"));
181     $guest_online_num = sql_num_rows($result, $dbi);   168         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=downloads\">"._AB_UDOWNLOADS."</a></td></tr>";
182     $result = sql_query("SELECT username FROM ".$prefix."_session where guest=0", $dbi);   169         $num=0;
183     $member_online_num = sql_num_rows($result, $dbi);   170         list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=0;"));
184     $who_online_num = $guest_online_num + $member_online_num;   171         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListModRequests\">"._AB_MODREQDOWN."</a></td></tr>";
185     $who_online = "<center><font class=\"option\">"._WHOSONLINE."</font><br><br><font class=\"content\">"._CURRENTLY." $guest_online_num "._GUESTS." $member_online_num "._MEMBERS."<br>";   172         $num=0;
186     echo "<center>$who_online</center>";   173         list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=1;"));
187    CloseTable();   174         if(!empty($num)) $content1 .= "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListBrokenDownloads\">"._AB_BROKENDOWN."</a></td></tr>";
188     echo "<br>";   175         $num=0;
189     OpenTable();   176         list($num) = sql_fetch_row(sql_query("select count(pid) from ${prefix}_gallery_pictures_newpicture;"));
190     echo "<center><b>"._AUTOMATEDARTICLES."</b></center><br>";   177         if(!empty($num)) $content1 . "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=GallAdmin\">"._AB_PICTURES."</a></td></tr>";
191     $count = 0;   178         $num=0;
192     $result = sql_query("select anid, aid, title, time, alanguage from ".$prefix."_autonews $queryalang order by time ASC", $dbi);   179         list($num) = sql_fetch_row(sql_query("SELECT Count(eid) FROM ${prefix}_events WHERE activ=0;"));
193     while(list($anid, $said, $title, $time, $alanguage) = sql_fetch_row($result, $dbi)) {   180         if(!empty($num)) $content1 .=  "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=CalendarAdmin\">"._AB_EVENTS."</a></td></tr>";
194         if ($alanguage == "") {   181         $num=0;
195             $alanguage = ""._ALL."";   182         list($num) = sql_fetch_row(sql_query("select count(faq_id) from ${prefix}_faqnew;"));
      183         if(!empty($num)) $content1 .=  "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=FaqAnswerNew\">"._NEWADD2."</a></td></tr>";
196         }   184         $num=0;
      185         list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_nukebook_queue;"));
      186         if(!empty($num)) $content1 .=  "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=NukebookAdmin\">"._GUESTBOOK."</a></td></tr>";
197         if ($anid != "") {   187         $num=0;
      188         if (mxModuleAllowed("Webring")) {
198             if ($count == 0) {   189                 $num=0;
199                 echo "<table border=\"1\" width=\"100%\">";   190                 list($num) = sql_fetch_row(sql_query("select count(ringid) from ${prefix}_webring where activ=0;"));
      191                 if(!empty($num)) $content1 .=  "<tr><td><img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"modules.php?name=Webring&ring=1&file=index&mode=adminNewentry\">"._AB_WEBRING."</a></td></tr>";
200                 $count = 1;   192                 }
201             }   193  
202             $time = ereg_replace(" ", "@", $time);   194         OpenTable2();
203             if (($radminarticle==1) OR ($radminsuper==1)) {   195         echo "<center>";
204                 if (($radminarticle==1) AND ($aid == $said) OR ($radminsuper==1)) {   196         if ($content1) {
205                     echo "<tr><td nowrap>&nbsp;(<a href=\"admin.php?op=autoEdit&amp;anid=$anid\">"._EDIT."</a>-<a href=\"admin.php?op=autoDelete&amp;anid=$anid\">"._DELETE."</a>)&nbsp;</td><td width=\"100%\">&nbsp;$title&nbsp;</td><td align=\"center\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>"; /* Multilingual Code : added column to display language */   197                 echo "<font class=\"title\">"._NEWSUBMISSIONS."</font><br><table border='0' cellpadding='5'>";
206                 } else {   198                 echo $content1;
207                     echo "<tr><td>&nbsp;("._NOFUNCTIONS.")&nbsp;</td><td width=\"100%\">&nbsp;$title&nbsp;</td><td align=\"center\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>"; /* Multilingual Code : added column to display language */   199                 echo "</table>";
208                 } = 200                 }
209             } else { <> 201         else {
210                 echo "<tr><td width=\"100%\">&nbsp;$title&nbsp;</td><td align=\"center\">&nbsp;$alanguage&nbsp;</td><td nowrap>&nbsp;$time&nbsp;</td></tr>"; /* Multilingual Code : added column to display language */   202                 echo "<font class=\"title\">"._NOSUBMISSIONS."</font>";
211             }   203                 }
      204         echo "</center>";
      205         CloseTable2();
    = 206  
    -+ 207         echo "<br>";
      208         OpenTable();
      209         echo "<table width='100%' border='0' cellspacing='1' cellpadding='2' bgcolor='$bgcolor2'>";
      210         echo "<tr valign='top' bgcolor=\"$bgcolor1\">\n";
      211         echo "<td><b>CMS-Version:</b></td>\n";
      212         echo "<td><b>PHP-Version:</b></td>\n";
      213         echo "<td><b>MySQL-Version:</b></td>";
      214         echo "<td><b>Server-Version:</b></td>\n";
      215         echo "</tr>\n";
      216         echo "<tr valign='top' bgcolor=\"$bgcolor1\">\n";
      217         echo "<td>".MX_VERSION.", ".MX_VERSION_SUB."</td>\n";
      218         echo "<td>".phpversion()."</td>\n";
      219         echo "<td>".MX_SQL_VERSION."</td>";
      220         echo "<td>".getenv('SERVER_SOFTWARE')."</td>\n";
      221         echo "</tr>\n";
      222         echo "</table>";
      223         CloseTable();
      224         echo "<br>";
      225         include ("footer.php");
212         } = 226         }
213     } <> 227  
214     if (($anid == "") AND ($count == 0)) {   228 ##################################################################################
215         echo "<center><i>"._NOAUTOARTICLES."</i></center>";   229 function mxAdminLanguageSelect($name, $curlang="", $hideall=0) {
      230         $handle = opendir('language');
      231         while ($file = readdir($handle)) {
      232                 if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
      233                         $languageslist[] = $matches[1];
216    }   234                         }
217     if ($count == 1) {      
218         echo "</table>";      
219     }   235                 }
220     CloseTable();   236         closedir($handle);
      237         sort($languageslist);
221    echo "<br>";   238         $options = "";
      239         foreach($languageslist as $lang) {
222     OpenTable();   240                 if(!empty($lang)) {
223     echo "<center><b>"._LAST." 20 "._ARTICLES."</b></center><br>";   241                         $sel = ($lang == $curlang) ? "selected" : "";
224    $result = sql_query("select sid, aid, title, time, topic, informant, alanguage from ".$prefix."_stories $queryalang order by time desc limit 0,20", $dbi);   242                         $options .= "<option value=\"$lang\" $sel>".ucfirst($lang)."</option>\n";
225     echo "<center><table border=\"1\" width=\"100%\" bgcolor=\"$bgcolor1\">";   243                         }
226     while(list($sid, $said, $title, $time, $topic, $informant, $alanguage) = sql_fetch_row($result, $dbi)) {   244                 }
227         $ta = sql_query("select topicname from ".$prefix."_topics where topicid=$topic", $dbi);   245         if (empty($hideall)) {
228         list($topicname) = sql_fetch_row($ta, $dbi);   246                 $sel = ($lang == $curlang) ? "selected" : "";
      247                 $options = "<option value=\"\"> "._ALL."</option>\n".$options."";
229         if ($alanguage == "") {   248                 }
230             $alanguage = ""._ALL."";   249         $out = "<select name=\"".$name."\">\n".$options."</select>\n";
      250         return $out;
231         } = 251         }
232         formatTimestamp($time); <> 252  
233         echo "<tr><td align=\"right\"><b>$sid</b>"   253 ##################################################################################
234             ."</td><td align=\"left\" width=\"100%\"><a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a>"   254 # zeigt nach erfolgreichem einloggen eine Auswahlseite
235             ."</td><td align=\"center\">$alanguage"   255 function welcomepage($aid) {
236             ."</td><td align=\"right\">$topicname";   256         global $sitename, $index, $prefix, $user_prefix;
237         if (($radminarticle==1) OR ($radminsuper==1)) {   257         $qry = "SELECT a.aid AS aid, a.pwd AS pwd, a.admlanguage AS admlanguage, u.*
238             if (($radminarticle==1) AND ($aid == $said) OR ($radminsuper==1)) {   258                 FROM ${prefix}_authors AS a
239                 echo "</td><td align=\"right\" nowrap>(<a href=\"admin.php?op=EditStory&sid=$sid\">"._EDIT."</a>-<a href=\"admin.php?op=RemoveStory&sid=$sid\">"._DELETE."</a>)"   259                                         LEFT JOIN ${user_prefix}_users AS u
240                     ."</td></tr>";   260                                         ON a.user_uid = u.uid
241             } else {   261                 WHERE (a.aid='".mxAddSlashesForSQL($aid)."');";
242                 echo "</td><td align=\"right\" nowrap><font class=\"content\"><i>("._NOFUNCTIONS.")</i></font>"   262         $result=sql_query($qry);
243                     ."</td></tr>";   263         $adminrow = sql_fetch_array($result);
      264         if(mxIsAvatarUploaded($adminrow["uname"])){
      265         $ava = "".mxIsAvatarUploaded($adminrow["uname"],true)."";
244             }   266         }
245         } else {   267         else{
246             echo "</td></tr>";   268         $ava = (empty($adminrow["user_avatar"])) ? "" : "<img src=\"".MX_PATH_AVATAR."/".$adminrow["user_avatar"]."\" border=\"0\" alt=\"".$adminrow["user_avatar"]."\">";
247         } = 269         }
    <> 270         $GLOBALS['index']=0;
      271         mxSessionSetVar("lasttime", 0); // online() ausführen
      272         include ("header.php");
248     }   273         OpenTable();
      274         echo "<center><font class=\"title\"><b>"._uaHello." ".$adminrow["uname"]."</b></font><br><br>"._uaWelcometo." $sitename</center>";
      275         CloseTable();
249     echo "</table>";   276         echo "<br>";
250     if (($radminarticle==1) OR ($radminsuper==1)) {   277         GraphicAdmin();
      278         OpenTable();
251         echo "<center>"   279         echo"
252             ."<form action=\"admin.php\" method=\"post\">"   280         <table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">
253             .""._STORYID.": <input type=\"text\" NAME=\"sid\" SIZE=\"10\">"   281         <tr>
254             ."<select name=\"op\">"   282             <td align=\"center\">".$ava."&nbsp</td>
255             ."<option value=\"EditStory\" SELECTED>"._EDIT."</option>"   283             <td><p><font class=\"title\"><b>"._uaLoggedin."</b></font></p><p>"._uaAsadmin." <b>$aid</b><br>"._uaAsuser." <b>".$adminrow["uname"]."</b></p><br></td>
256             ."<option value=\"RemoveStory\">"._DELETE."</option>"   284         </tr>
257             ."</select>"   285         <tr>
258             ."<input type=\"submit\" value=\""._GO."\">"   286             <td rowspan=\"7\">&nbsp;</td>
259             ."</form></center>";   287             <td><font class=\"title\"><b>"._uaSelectoption."</b></font><br><br></td>
260     }   288         </tr>
261     CloseTable();   289         <tr>
262     $result = sql_query("SELECT pollID, pollTitle FROM ".$prefix."_poll_desc WHERE artid='0' ORDER BY pollID DESC limit 1", $dbi);   290             <td><b>&middot;</b>&nbsp;<a href=\"index.php\">"._uaHome."</a><br><br></td>
263     $object = sql_fetch_object($result, $dbi);   291         </tr>
264     $pollID = $object->pollID;   292         <!-- <tr>
265     $pollTitle = $object->pollTitle;   293             <td><b>&middot;</b>&nbsp;<a href=\"admin.php\">"._uaAdminmenue."</a></td>
266     echo "<br>";   294         </tr>
267     OpenTable();   295         <tr>
268     echo "<center><b>"._CURRENTPOLL.":</b> $pollTitle [ <a href=\"admin.php?op=polledit&pollID=$pollID\">"._EDIT."</a> | <a href=\"admin.php?op=create\">"._ADD."</a> ]</center>";   296             <td><b>&middot;</b>&nbsp;<a href=\"admin.php?op=modselfadmin\">"._uaYouradminaccount."</a></td>
269     CloseTable();   297         </tr>
270     include ("footer.php");   298         <tr> -->
      299             <td><b>&middot;</b>&nbsp;<a href=\"modules.php?name=Userinfo&uname=".$adminrow["uname"]."\">"._uaYouraccount."</a><br><br></td>
271 }   300         </tr>
272     301         <tr>
      302             <td><b>&middot;</b>&nbsp;<a href=\"admin.php?op=logout\">"._uaAdminlogout."</a> <br>&nbsp;&nbsp;&nbsp;"._uaAdminlogout2."</td>
273 if($admintest) {   303         </tr>
274     304         <tr>
275     switch($op) {   305             <td><b>&middot;</b>&nbsp;<a href=\"modules.php?name=Your_Account&op=logout\">"._uaUserlogout."</a> <br>&nbsp;&nbsp;&nbsp;"._uaUserlogout2."</td>
276     306         </tr>
277         case "deleteNotice":   307         </table>
278         deleteNotice($id, $table, $op_back);   308         <p align=\"right\"><span class=\"tiny\">AutoLogin &copy; by <a href=\"http://www.shiba-design.de/\" target=\"_blank\" style=\"font-weight: normal;\">&AElig;</a> 2003</span></p>
279         break;   309         ";
280     310         CloseTable();
281         case "GraphicAdmin":   311         include ("footer.php");
282         GraphicAdmin();   312         die();
283         break;   313         }
284   = 314  
    <> 315 ##################################################################################
      316 function admindologout() {
      317         mxSessionSafeCookie(MX_SAFECOOKIE_NAME_ADMIN, 0);
      318         mxSetNukeCookie("admin");
285         case "adminMain":   319         mxSessionDelVar("admin");
      320         if(!MX_IS_USER) {
      321                 mxSessionDestroy();
286         adminMain();   322                 }
      323         else {
      324                 session_write_close();
287         break;   325                 }
      326         Header("Location: admin.php?op=logoutfin");
288     327         }
289         case "logout":   328  
      329 ##################################################################################
      330 function admindologoutfin() {
290         setcookie("admin");   331         mxSessionDelVar("admin");
      332         mxSessionSetVar("lasttime",0); // Zurücksetzen, damit Online ausgeführt wird
291         include("header.php"); = 333         include("header.php");
292         OpenTable();   334         OpenTable();
293         echo "<center><font class=\"title\"><b>"._YOUARELOGGEDOUT."</b></font></center>";   335         echo "<center><font class=\"title\"><b>"._YOUARELOGGEDOUT."</b></font></center>";
294         CloseTable();   336         CloseTable();
    -+ 337         echo "<META http-equiv=\"Refresh\" content=\"5;URL=index.php\">";
295         include("footer.php"); = 338         include("footer.php");
296         break; <> 339         }
297   = 340  
    <> 341 ##################################################################################
      342 function getCheckUsersSelectOptions($user_stat = 0) {
      343         global $user_prefix, $prefix;
      344         $user_stat = (int)$user_stat;
      345         $errmsg = (empty($user_stat)) ? "No New Users available" : "No deactivated Users available";
298         case "login";   346         $useroptions = "";
      347         $qry = "SELECT uname, uid
      348                                         FROM ${user_prefix}_users
      349                                         WHERE ${user_prefix}_users.user_stat = ".$user_stat."
      350                                         ORDER BY ${user_prefix}_users.uname";
      351         $result = sql_query($qry);
299         unset($op);   352         if($result){
      353                 while(list($uname, $uid) = sql_fetch_row($result)){
      354                         $useroptions .= "<option value=\"".$uid."\">".$uname."</option>\n";
      355                         }
      356                 }
      357         $useroptions = (empty($useroptions)) ? "<option value=0>".$errmsg."</option>" : $useroptions;
      358         return $useroptions;
300     359         }
301         default:   360  
      361 ##################################################################################
      362 function getAllUsersSelectOptions2($currentgroup) {
      363         global $user_prefix, $prefix;
302         $casedir = dir("admin/case");   364         $useroptions = "";
      365         $qry = "SELECT uname
      366                 FROM ${user_prefix}_users
      367                                         WHERE user_ingroup=".$currentgroup." AND user_stat=1
      368                                         ORDER BY uname";
      369         $result = sql_query($qry);
303         while($func=$casedir->read()) {   370         if($result){
304             if(substr($func, 0, 5) == "case.") {   371                 while(list($uname) = sql_fetch_row($result)){
      372                         $useroptions .= "<option value=\"".$uname."\">".$uname."</option>";
      373                         }
      374                 }
      375         $useroptions = (empty($useroptions)) ? "<option value=0>ERROR!!! No Users available</option>" : $useroptions;
      376         return $useroptions;
      377         }
    = 378  
    <> 379 ##################################################################################
      380 function getAllAccessLevelSelectOptions($selectedgroup) {
      381         global $user_prefix, $prefix;
      382         $selectedgroup = (empty($selectedgroup)) ? 1 : $selectedgroup;
      383         $groupoptions = "";
      384         $result = sql_query("select access_id, access_title from ".$prefix."_groups_access where access_title != 'Deleted' order by access_title");
305                 include($casedir->path."/$func");   385         if($result){
      386                 while(list($access_id, $access_title) = sql_fetch_row($result)){
      387                         if (is_array($selectedgroup)) {
      388                                 $sel = (in_array($access_id, $selectedgroup)) ? " SELECTED" : "";
      389                                 }
      390                         else {
      391                                 $sel = ($selectedgroup == $access_id) ? " SELECTED" : "";
      392                                 }
      393                         $access_title = ($GLOBALS['default_group'] == $access_id) ? "".$access_title."&nbsp;&nbsp;*" : $access_title;
      394                         $groupoptions .= "<option value=\"".$access_id."\" ".$sel.">".$access_title."</option>\n";
      395                         }
      396                 }
      397         $groupoptions = (empty($groupoptions)) ? "<option value=0>ERROR!!! No Groups available</option>" : $groupoptions;
      398         return $groupoptions;
306             }   399         }
    = 400  
    -+ 401 ##################################################################################
      402 function getUserStatOptions($user_stat) {
      403         $out = "";
      404         if (empty($user_stat)) { /// nur Anzeigen bei neuen Usern
      405                 $out .= "<option value=0".(($user_stat==0) ? " selected" : "").">"._YA_USERSTAT_0."</option>\n";        # neu, noch nicht aktiviert
      406                 }
      407         $out .= "<option value=1".(($user_stat==1) ? " selected" : "").">"._YA_USERSTAT_1."</option>\n";        # aktiviert
      408         if (!empty($user_stat)) { /// nicht Anzeigen bei neuen Usern
      409                 $out .= "<option value=2".(($user_stat==2) ? " selected" : "").">"._YA_USERSTAT_2."</option>\n";        # deaktiviert
      410                 }
      411         return $out;
307         } = 412         }
      413  
    <> 414 ##################################################################################
      415 function create_first($pvs) {
      416         global $prefix, $user_prefix;
      417         extract($pvs);
      418         $first_name = substr($first_name,0,25);
      419         if (!isset($_COOKIE[MX_SESSION_NAME])) {
      420                 /// wenn kein Session-Cookie gesetzt wurde
      421                 mxErrorScreen(_ADMIN_BADLOGIN4);
      422                 }
      423         if (!mxSessionGetVar("create_first") || empty($first_check)) {
      424                 /// wenn session bereits geloescht (z.B. bei refresh der page)
      425                 /// oder Check-Variable des Formulars fehlt, umleiten
      426                 Header("Location: admin.php");
      427                 }
      428         /// wenn die Funktion nicht ueber das richtige Formular aufgerufen:
      429         /// Intruder und Session blockieren (funktion: vkpIpBanning() in header.php)
      430         $checkID = md5(mxSessionGetVar("create_first"));
      431         mxSessionDelVar("create_first");
      432         if ($first_check != $checkID) {
      433                 $doblock = 1;
      434                 mxYoubad("create_first failed (no session-check-id) - $first_name");
      435                 die();
      436                 }
      437         /// pruefen ob vielleicht doch schon ein God-Account besteht
      438         $result = sql_query("SELECT count(aid) FROM ${prefix}_authors where name ='God'");
      439         list($first) = sql_fetch_row($result);
      440         if ($first == 1) {
      441                 /// wenn doch schon einer da ist...
      442                 mxSecureLog("SecLog", "create_first failed (is available) - $first_name");
      443                 mxErrorScreen(_ADMIN_GODEXIST);
      444                 }
      445         /// pruefen ob der Adminname bereits vergeben ist
      446         $result = sql_query("SELECT count(aid) FROM ${prefix}_authors where aid ='".mxAddSlashesForSQL($first_name)."'");
      447         list($aexist) = sql_fetch_row($result);
      448         if (!empty($aexist)) {
      449                 $pvs['msg'] = ""._uaNICKTAKEN." (".$first_name.")";
      450                 unset($pvs['first_name']);
      451                 }
      452         /// nicht alle Felder ausgefuellt?
      453         else if (empty($first_name) || empty($first_email) || empty($first_pwd) || ereg("[^ a-zA-Z0-9_-]",$first_name)) {
      454                 $pvs['msg'] = _COMPLETEFIELDS;
      455                 }
      456         /// Datenbankpasswort zur Sicherheit ueberpruefen
      457         /// wer das nicht kennt, kann auch kein God sein
      458         else if ($first_dbpass != $GLOBALS['dbpass']) {
      459                 mxSecureLog("SecLog", "create_first failed (bad dbPass) - $first_name");
      460                 $pvs['msg'] = _ADMIN_ERRDBPASS;
      461                 unset($pvs['first_dbpass']);
      462                 }
      463         /// wenn Fehler-Message, Seite neu aufrufen
      464         if (isset($pvs['msg'])) {
      465                 /// uebergebene Parameter und Fehler-Message in Session schreiben
      466                 mxSessionSetVar("first_data", $pvs);
      467                 session_write_close();
      468                 Header("Location: admin.php");
      469                 exit;
      470                 }
      471         /// Daten in Admintabelle schreiben
      472         $first_pwd = md5(trim($first_pwd));
      473         $qry = "INSERT INTO ${prefix}_authors ( aid, name, url, email, pwd, counter, radminsuper )
      474                                         VALUES ( '".mxAddSlashesForSQL($first_name)."', 'God', '".mxAddSlashesForSQL($first_url)."', '".mxAddSlashesForSQL($first_email)."', '$first_pwd', 0, 1);";
      475         $result = sql_query($qry);
      476         /// wenn beim schreiben Fehler aufgetreten
      477         if (!$result) {
      478                 mxErrorScreen(""._ADMIN_ERRSQL."<br><br>$qry");
      479                 }
      480         /// Soll ein normaler User miterstellt werden?
      481         if ($first_createuser) {
      482                 /// pruefen ob Benutzername bereits vorhanden
      483                 $result = sql_query("select uid from ${user_prefix}_users where uname='".mxAddSlashesForSQL($first_name)."'");
      484                 list($uid) = sql_fetch_row($result);
      485                 if (empty($uid)) {
      486                         /// wenn nein, neuen Benutzer anlegen
      487                        
      488                         $user_regdate = mxGetNukeUserregdate();
      489                        
      490                         $user_regtime = time();
      491                         $qry="INSERT INTO ${user_prefix}_users
      492                         ( uname       , name         , email         , url         , pass        , user_regdate   , user_regtime , user_stat) values
      493                         ('$first_name', '".mxAddSlashesForSQL($first_name)."', '".mxAddSlashesForSQL($first_email)."', '".mxAddSlashesForSQL($first_url)."', '$first_pwd', '$user_regdate', $user_regtime, 1);";
      494                         $result = sql_query($qry);
      495                         if ($result) {
      496                                 /// wenn erfolgreich, eingefuegte uid  ermitteln
      497                                 $uid = sql_insert_id();
      498                                 }
      499                         }
      500                 /// wenn eine gueltige uid vorhanden ist,
      501                 if (!empty($uid)) {
      502                         /// diese in die Admintabelle zur Verknuepfung eintragen (selfadmin)
      503                         sql_query("UPDATE ${prefix}_authors SET user_uid=".intval($uid)." WHERE aid='".mxAddSlashesForSQL($first_name)."';");
      504                         }
      505                 }
      506         mxSecureLog("SecLog", "create_first: ok - $first_name");
      507         /// Erfolgsnachricht in Session schreiben
      508         $msg = "<b>"._ADMIN_GODCREATEOK."</b><br><br><b>"._uaAsadmin."</b>: $first_name<br><b>"._uaAsuser."</b>: $first_name";
      509         mxSessionSetVar("formmessage", $msg);
      510         mxSessionDelVar("first_data");
308         closedir($casedir->handle);   511         session_write_close();
      512         /// und ab zum login :-))
      513         Header("Location: admin.php"); // zum Login
309         break;   514         }
310   = 515  
    -+ 516 ##################################################################################
      517 function checkforgodadmin() {
      518         global $prefix;
      519         $result = sql_query("SELECT aid FROM ${prefix}_authors where name ='God'");
      520         list($the_first) = sql_fetch_row($result);
      521         if (empty($the_first)) {
      522                 $first_data = mxSessionGetVar("first_data");
      523                 mxSessionDelVar("first_data");
      524                 #mxDebugFuncvars($first_data);
      525                 mt_srand((double)microtime()*1000000);
      526                 $xcv = mt_rand();
      527                 mxSessionSetVar("create_first", $xcv);
      528                 include("header.php");
      529                 title($GLOBALS['sitename'].": "._ADMINISTRATION."");
      530                 OpenTable();
      531                 echo "<center><b>"._NOADMINYET."</b></center><br><br>"
      532                 ."".((isset($first_data['msg']))?"<center><b>".$first_data['msg']."</b></center><br><br>":"").""
      533                 ."<form action=\"admin.php\" method=\"post\" name=\"dofirst\">"
      534                 ."<input type=\"hidden\" name=\"op\" value=\"create_first\">"
      535                 ."<input type=\"hidden\" NAME=\"first_check\" value=\"".MD5($xcv)."\">"
      536                 ."<table border=\"0\">"
      537                 ."<tr><td><b>"._NICKNAME.":</b></td><td><input type=\"text\" name=\"first_name\" size=\"40\" maxlength=\"25\" value=\"".((isset($first_data['first_name']))?$first_data['first_name']:"")."\">  <font class=\"tiny\">"._REQUIRED."</font></td></tr>"
      538                 ."<tr><td><b>"._HOMEPAGE.":</b></td><td><input type=\"text\" name=\"first_url\" size=\"40\" maxlength=\"255\" value=\"".((isset($first_data['first_url']))?$first_data['first_url']:MX_HOME_URL)."\"></td></tr>"
      539                 ."<tr><td><b>"._EMAIL.":</b></td><td><input type=\"text\" name=\"first_email\" size=\"40\" maxlength=\"255\" value=\"".((isset($first_data['first_email']))?$first_data['first_email']:$GLOBALS['adminmail'])."\">  <font class=\"tiny\">"._REQUIRED."</font></td></tr>"
      540                 ."<tr><td><b>"._PASSWORD.":</b></td><td><input type=\"password\" name=\"first_pwd\" size=\"40\" maxlength=\"20\" value=\"".((isset($first_data['first_pwd']))?$first_data['first_pwd']:"")."\">  <font class=\"tiny\">"._REQUIRED."</font></td></tr>"
      541                 ."<tr><td colspan=\"2\">"._CREATEUSERDATA."  <input type=\"radio\" name=\"first_createuser\" value=\"1\" checked>"._YES."&nbsp;&nbsp;<input type=\"radio\" name=\"first_createuser\" value=\"0\">"._NO."</td></tr>"
      542                 ."<tr><td><b>"._DBPASS."</b></td><td><input type=\"password\" name=\"first_dbpass\" size=\"40\" maxlength=\"20\" value=\"".((isset($first_data['first_dbpass']))?$first_data['first_dbpass']:"")."\">  <font class=\"tiny\">"._REQUIRED."</font></td></tr>"
      543                 ."<tr><td colspan=\"2\"><input type=\"submit\" value=\""._SUBMIT."\"></td></tr>"
      544                 ."</table></form>";
      545                 echo "<script language='JavaScript' type='text/javascript'>\n<!--\ndocument.dofirst.first_name.focus();\n//-->\n</script>";
      546                 CloseTable();
      547                 include("footer.php");
      548                 exit;
      549                 }
311         } = 550         }
312     551  
    <> 552 ##################################################################################
      553 function php_info() {
      554         extract(mxGetAdminSession());
      555         if (empty($GLOBALS["mxDemoMode"])){
      556                 mxSystemInfo();
      557                 exit;
      558                 }
313 } else {   559         else{
      560                 mxErrorScreen("<h1>not in demoMode -> phpinfo()</h1>");
      561                 }
      562         }
314   = 563  
    <> 564 ##################################################################################
      565 #mxDebugFuncVars($_REQUEST);
315     login();   566  
      567 $op = (empty($_REQUEST['op'])) ? "adminMain" : $_REQUEST['op'];
      568 $admintest = MX_IS_ADMIN;
      569 if($admintest) {
      570         mxSessionDelVar("abad");
      571         extract(mxGetAdminSession());
316   = 572  
    <> 573         switch($op) {
      574                 case "deleteNotice":
      575             if (file_exists("admin/modules/reviews.php")) {
      576                                 include("admin/modules/reviews.php");
      577                                 if (!function_exists("deleteNotice")) {
      578                                         mxErrorScreen('Please update your reviews module!<br><br>Read <a href="http://www.pragmamx.org/modules.php?name=News&file=article&sid=517&mode=flat&order=1&thold=0">here</a>');
      579                                         die();
      580                                         }
      581                                 }
      582                         else {
      583                                 mxErrorScreen('Reviews module not installed!');
      584                                 }
      585                         break;
      586                 case "adminMain":
      587                         adminMain();
      588                         break;
      589                 case "welcome":
      590                         welcomepage($aid);
      591                         break;
      592                 case "logout":
      593                         admindologout();
      594                         break;
      595                 case "logoutfin":
      596                         mxErrorScreen("<b>Admin-Logout failed</b><br>Please delete your Session-Cookie (".MX_SESSION_NAME.") manualy.");
      597                         break;
      598                 case "info":
      599                         php_info();
      600                         break;
      601                 case "login";
      602                         $op = "adminMain";
      603                         adminMain();
      604                         break;
      605                 default:
      606                          //// Ausgabepuffer aktivieren um zu prüfen ob die $op-Option vorhanden ist
      607                          //// bei Problemen, die Zeilen mit *** dahinter, einfach auskommentieren ;)
      608                         ob_start();                                                  // ***
      609                         $casedir = dir("admin/case");
      610                         while($func = $casedir -> read()) {
      611                                 if(substr($func, 0, 5) == "case.") {
      612                                         include($casedir -> path."/".$func);
      613                                         }
      614                                 }
      615                         closedir($casedir->handle);
      616                         //// Ausgabepuffer zwischenspeichern um zu prüfen  // ***
      617                         //// ob die $op-Option vorhanden ist und evtl.     // ***
      618                         //// eine Fehlermeldung zu generieren              // ***
      619                         $fileoutput = trim(ob_get_clean());                // ***
      620                         if (empty($fileoutput)) {                          // ***
      621                                 mxErrorScreen("Diese Funktion (".$op.") ist nicht vorhanden.<br>This function (".$op.") is not available.");  // ***
      622                                 exit;                                                    // ***
      623                                 }                                                            // ***
      624                         echo $fileoutput;                                              // ***
      625                         //// ende Ausgabepuffer zwischenspeichern          // ***
      626                         break;
      627                         } # end switch
      628                 }
      629 else {
      630         if ($op != "create_first" && empty($_POST['first_check'])) {
      631                 checkforgodadmin();
      632                 }
      633         switch($op) {
      634                 case "logoutfin":
      635                         admindologoutfin();
      636                         break;
      637                 case "login":
      638                         mx_sys_adminlogin($_POST);
      639                         break;
      640                 case "create_first":
      641                         create_first($_POST);
      642                         break;
      643                 default:
      644                         login();
      645                 } # end switch
317 }   646         }
318   = 647  
319 ?>   648 ?>