Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

admin.php

Go to the documentation of this file.
00001 <?php
00011 /***************************************************************************
00012  This program is free software; you can redistribute it and/or
00013  modify it under the terms of the GNU General Public License
00014  as published by the Free Software Foundation; either version 2
00015  of the License, or (at your option) any later version.
00016 
00017  This program is distributed in the hope that it will be useful,
00018  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  GNU General Public License for more details.
00021 
00022  You should have received a copy of the GNU General Public License
00023  along with this program; if not, write to the Free Software
00024  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00025  ***************************************************************************/
00026 
00027 require_once( './general.php' );
00028 require_once( './lib/admin.php' );
00029 require_once( './lib/pager.php' );
00030 
00031 // initialize global variables
00032 $strTmpl_inhalt = '';
00033 $strMessage     = '';
00034 $strError       = '';
00035 
00036 // get styles
00037 $oStyle->setTemplate( 'admin.html' );
00038 
00039 $oAdmin = new Admin( $oMysql, $oLog );
00040 
00041 // get variables
00042 if(isset($_POST['action']))     $action = $_POST['action'];
00043 elseif(isset($_GET['action']))  $action = $_GET['action'];
00044 else $action = '';
00045 
00046 
00047 // adding a new user or modifying an existing user
00048 if( in_array( $action, array( 'user_add', 'user_edit' ) ) )
00049 {
00050     if( !$oUser->isAdmin( $action ) )
00051     {
00052         $strError = 'Du hast keine Berechtigung für diese Aktion !';
00053         if( $action == 'user_edit' )
00054         {
00055             if(isset($_POST['uid']))    $strAdd = $_POST['uid'];
00056             elseif(isset($_GET['uid'])) $strAdd = $_GET['uid'];
00057             $strAdd = "(ID=$strAdd)";
00058         }
00059         else
00060         {
00061             $strAdd = '';
00062         }
00063         $oLog->write( "keine Berechtigung f&uuml;r: $action $strAdd", 10 );
00064     }
00065     else
00066     {
00067         if( $action == 'user_edit' )
00068         {
00069             _UserEdit();
00070         }
00071         else
00072         {
00073             _UserAdd();
00074         }
00075     }
00076 
00077 }
00078 //-----------------------------------------------------------------------------
00079 elseif( $action == 'user_list' )
00080 {
00081     if( !$oUser->isAdmin( $action ) )
00082     {
00083         $strError = 'Du hast keine Berechtigung für diese Aktion !';
00084         $oLog->write( "keine Berechtigung f&uuml;r: $action", 10 );
00085     }
00086     else
00087     {
00088         _UserList();
00089     }
00090 }
00091 //-----------------------------------------------------------------------------
00092 elseif( $action == 'log_stat' )
00093 {
00094     if( !$oUser->isAdmin( 'log_list' ) )
00095     {
00096         $strError = 'Du hast keine Berechtigung für diese Aktion !';
00097         $oLog->write( "keine Berechtigung f&uuml;r: $action", 10 );
00098     }
00099     else
00100     {
00101         _LogStat();
00102     }
00103 }
00104 //-----------------------------------------------------------------------------
00105 elseif( $action == 'log_list' && $oUser->isAdmin( 'log_list' ) )
00106 {
00107     $strMessage = '';
00108 
00109     if( isset( $_POST['deletelist'] ) && is_array( $_POST['deletelist'] ) && $oUser->isAdmin( 'log_del' ) )
00110     {
00111         $strMessage = $oAdmin->deleteLogs( $_POST['deletelist'] ) . ' Logeintr&auml;ge gel&ouml;scht.';
00112     }
00113 
00114     // get order
00115     $strSort = 'actionlog_id DESC';
00116     if( isset( $_GET['sortby'] ) )
00117     {
00118         switch( $_GET['sortby'] )
00119         {
00120             case 'username':
00121                 $strSort = 'name';
00122                 break;
00123             case 'time':
00124                 $strSort = 'time DESC';
00125                 break;
00126             case 'ip':
00127                 $strSort = 'ip';
00128                 break;
00129             default:
00130                 $strSort = 'actionlog_id';
00131         }
00132     }
00133 
00134     $strRows = '';
00135     // get all log entries
00136     $aData = $oAdmin->getLogList( $strSort, $intPagerStart, $intPagerCount );
00137 
00138     $intEntries = $aData['max'];
00139     unset($aData['max']);
00140     $oPager = new Pager( $intEntries, $intPagerCount, 25, 'admin.php?action=log_list&amp;' );
00141     $oPager->setcurrent( $intPagerStart );
00142 
00143     $i = 0;
00144     foreach( $aData AS $aRow )
00145     {
00146         $oStyle->addReplacements( array( 'LL_NAME' => $aRow['name'],
00147                                          'LL_FLAG' => $aRow['flag'],
00148                                          'LL_MODUL' => $aRow['modul'],
00149                                          'LL_TEXT' => $aRow['message'],
00150                                          'LL_CODE' => $aRow['code'],
00151                                          'LL_TIME' => date ( 'd.m.Y H:i', $aRow['time']),
00152                                          'LL_IP' => $aRow['ip'],
00153                                          'LL_IP_TITLE' => empty( $aRow['ip'] ) ? '' : gethostbyaddr( $aRow['ip'] ),
00154                                          'LL_DELETE' => '<input class="checkbox" type="checkbox" name="deletelist[]" value="'.$aRow['actionlog_id'].'" />',
00155                                          'LL_ROW' => $aRow['flag'] < 10 ? intval(($i++ % 2) == 0) : "Error" ) );
00156         $strRows .= $oStyle->get_area( 'LogListRow' );
00157     }
00158     $strHeader = "Seite {$oPager->intPage} von {$oPager->intMaxPage} / ".$oPager->link();
00159     $oStyle->addReplacements( array( 'ROWS'      => $strRows,
00160                                      'LL_HEADER' => $strHeader,
00161                                      'LL_FOOTER' => $strHeader ) );
00162     $strTmpl_inhalt = $oStyle->get_area( 'LogList' );
00163 }
00164 //-----------------------------------------------------------------------------
00165 elseif( $action == 'deadlist' && $oUser->isAdmin( 'dead_list' ) )
00166 {
00167     if( isset( $_POST['deleteplayers'] ) && is_array( $_POST['deleteplayers'] ) && $oUser->isAdmin( 'dead_del' ) )
00168     {
00169         $strMessage .= $oAdmin->deletePlayers( $_POST['deleteplayers'] ) . ' Spieler gel&ouml;scht.';
00170     }
00171 
00172     if( isset( $_POST['deleteguilds'] ) && is_array( $_POST['deleteguilds'] ) && $oUser->isAdmin( 'guild_del' ) )
00173     {
00174         require_once( './lib/guild.php' );
00175         $oGuild = new Guild( $oMysql, $oLog, $oUser );
00176         $intDel = 0;
00177         foreach( $_POST['deleteguilds'] AS $intGuild )
00178         {
00179             if( $oGuild->delete( intval( $intGuild ) ) )
00180             {
00181                 $intDel++;
00182             }
00183         }
00184         if( $intDel != 1 )
00185             $strMessage .= $intDel. ' Gilden gel&ouml;scht.';
00186         else
00187             $strMessage = 'Eine Gilde gel&ouml;scht.';
00188     }
00189 
00190     // get all log entries
00191     $aData = $oAdmin->getDeadList();
00192 
00193     $i = 0;
00194     $strPlayerRows = '';
00195     foreach( $aData['players'] AS $aRow )
00196     {
00197         $oStyle->addReplacements( array( 'DL_PLAYERNAME' => $aRow['name'],
00198                                          'DL_DELETE_PLAYER' => '<input class="checkbox" type="checkbox" name="deleteplayers[]" value="'.$aRow['player_id'].'" />',
00199                                          'DL_ROW' => intval(($i++ % 2) == 0) ) );
00200         $strPlayerRows .= $oStyle->get_area( 'DeadPlayer' );
00201     }
00202     if( $strPlayerRows == '' )
00203     {
00204         $strPlayerRows = '<tr><td class="warning" colspan="2">kein Datensatz gefunden</td></tr>';
00205     }
00206 
00207     $i = 0;
00208     $strGuildRows = '';
00209     foreach( $aData['guilds'] AS $aRow )
00210     {
00211         $oStyle->addReplacements( array( 'DL_GUILDTAG' => $aRow['tag'],
00212                                          'DL_GUILDNAME' => $aRow['name'],
00213                                          'DL_DELETE_GUILD' => '<input class="checkbox" type="checkbox" name="deleteguilds[]" value="'.$aRow['guild_id'].'" />',
00214                                          'DL_ROW' => intval(($i++ % 2) == 0) ) );
00215         $strGuildRows .= $oStyle->get_area( 'DeadGuild' );
00216     }
00217     if( $strGuildRows == '' )
00218     {
00219         $strGuildRows = '<tr><td class="warning" colspan="2">kein Datensatz gefunden</td></tr>';
00220     }
00221 
00222     if( $strMessage != '' )
00223     {
00224         $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00225         // format this message
00226         $strMessage = $oStyle->get_area( 'Message' );
00227         // add this message to replacements for main
00228         $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00229     }
00230     $oStyle->addReplacements( array( 'DL_PLAYER_ROWS' => $strPlayerRows,
00231                                      'DL_GUILD_ROWS' => $strGuildRows ) );
00232     $strTmpl_inhalt = $oStyle->get_area( 'DeadList' );
00233 }
00234 //-----------------------------------------------------------------------------
00235 elseif( $action == 'optimize' && $oUser->isAdmin( 'db_optimize' ) )
00236 {
00237     // maybe check result of optimize later
00238     $oAdmin->optimizeDb();
00239     $strTmpl_inhalt = $oStyle->get_area( 'Optimize' );
00240 }
00241 //-----------------------------------------------------------------------------
00242 elseif( $action == 'map_merge' && $oUser->isAdmin( 'db_clean' ) )
00243 {
00244     if( !isset( $_GET['mergeok'] ) || !(bool)$_GET['mergeok'] )
00245     {
00246         $oStyle->addReplacements(
00247           array( 'MERGE_COUNT' => $oAdmin->countMapMerge() )
00248         );
00249         $strTmpl_inhalt = $oStyle->get_area( 'MergeSure' );
00250     }
00251     else
00252     {
00253         $intReturn = $oAdmin->mergeMap();
00254         $oStyle->addReplacements( array( 'REFRESH_MSG' => $intReturn.' Eintr&auml;ge aktualisiert. (Der Rest wurden wegen alten Daten gel&ouml;scht)',
00255                                          'REFRESH_URL' => 'admin.php' ) );
00256         echo $oStyle->get_area( 'Refresh' );
00257         die();
00258     }
00259 }
00260 //-----------------------------------------------------------------------------
00261 else
00262 {
00263     if( strlen( $action ) > 0 )
00264     {
00265         $strMmessge = "nicht implementiere Aktion: " . $action;
00266         if( $strMessage != '' )
00267         {
00268             $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00269             // format this message
00270             $strMessage = $oStyle->get_area( 'Message' );
00271             // add this message to replacements for main
00272             $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00273         }
00274     }
00275     $strAdminMenu = '';
00276     foreach( $aAdminMenu AS $strSubTitle => $aSubMenu )
00277     {
00278         $strSubMenu = '';
00279         foreach( $aSubMenu AS $aSubRow )
00280         {
00281             // check users right for this subrow
00282             if( !$oUser->isAdmin( $aSubRow[0] ) ) continue;
00283             $oStyle->addReplacements( array( 'AR_LINK' => $aSubRow[1],
00284                                              'AR_NAME' => $aSubRow[2],
00285                                              'AR_DESC' => $aSubRow[3] ) );
00286             $strSubMenu .= $oStyle->get_area( 'AdminRow' );
00287         }
00288 
00289         if( $strSubMenu != '' )
00290         {
00291             $oStyle->addReplacements( array( 'AS_TITLE' => $strSubTitle,
00292                                              'AS_ROWS' => $strSubMenu ) );
00293             $strAdminMenu .= $oStyle->get_area( 'AdminSub' );
00294         }
00295     }
00296     $oStyle->addReplacements( array( 'ADMIN_MENU' => $strAdminMenu ) );
00297     $strTmpl_inhalt = $oStyle->get_area( 'Admin' );
00298 }
00299 
00300 
00301 
00302 // if error or message is set, it will be shown. An error will get higher preference.
00303 if( $strError != '' )
00304 {
00305     $oStyle->addReplacements( array( 'MESSAGE' => $strError ) );
00306     $strError = $oStyle->get_area( 'Errortext' );
00307     $oStyle->addReplacements( array( 'MESSAGE' => $strError ) );
00308 }
00309 elseif( $strMessage != '' )
00310 {
00311     $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00312     $strMessage = $oStyle->get_area( 'Message' );
00313     $oStyle->addReplacements( array( 'MESSAGE' => $strMessage ) );
00314 }
00315 
00316 
00317 // call main page
00318 output();
00319 
00320 
00321 /* ======================================================================================
00322  * ======================================================================================
00323  * ======================================================================================
00324  *
00325  * subfunctions for the modules
00326  *
00327  * ======================================================================================
00328  * ======================================================================================
00329  * ======================================================================================
00330  */
00331 
00332 
00338 function _UserAdd()
00339 {
00340     // global declaration
00341     global $oStyle, $strMessage, $strError, $strTmpl_inhalt, $oAdmin, $oLog;
00342 
00343     $strName = (isset($_POST['newuser'])) ? $_POST['newuser'] : '';
00344     $strPass = (isset($_POST['newpass'])) ? $_POST['newpass'] : '';
00345     $intHomeX = (isset($_POST['newpos_x'])) ? intval( $_POST['newpos_x'] ) : 0;
00346     $intHomeY = (isset($_POST['newpos_y'])) ? intval( $_POST['newpos_y'] ) : 0;
00347     $intGroup = (isset($_POST['usergroup'])) ? intval( $_POST['usergroup'] ) : 0;
00348 
00349     if( $strName != '' && $strPass != '' )
00350     {
00351         if( $oAdmin->addUser( $strName, $strPass, $intHomeX, $intHomeY, $intGroup ) > 0 )
00352         {
00353             $strMessage = "Der User $strName wurde angelegt.";
00354             $oLog->write( 'User angelegt: '.$strName, 3 );
00355             $strName = '';
00356             $strPass = '';
00357             $intHomeX = 0;
00358             $intHomeY = 0;
00359         }
00360         else
00361         {
00362             $strError = 'Fehler beim erstellen des Users.';
00363             $oLog->write( 'User konnte nicht angelegt werden: '.$strName, 10 );
00364         }
00365     }
00366 
00367     $aGroups = $oAdmin->getGroups();
00368     // build group select box
00369     $strOptions = '';
00370     foreach( $aGroups AS $aGroupInfo )
00371     {
00372         $oStyle->addReplacements( array( 'OPT_ID' => $aGroupInfo['usergroup_id'],
00373                                          'OPT_SEL' =>$aGroupInfo['usergroup_id']==2 ? ' selected="selected"' : '',
00374                                          'OPT_NAME' => $aGroupInfo['name'] ) );
00375         $strOptions .= $oStyle->get_area( 'Option' );
00376     }
00377 
00378     $oStyle->addReplacements( array( 'SEL_NAME' => 'usergroup',
00379                                      'SEL_OPTIONS' => $strOptions ) );
00380     $strGroups = $oStyle->get_area( 'Select' );
00381 
00382     $oStyle->addReplacements( array( 'NEWNAME' => $strName,
00383                                      'NEWPASS' => $strPass,
00384                                      'NEWX' => $intHomeX,
00385                                      'NEWY' => $intHomeY,
00386                                      'GROUP' => $strGroups ) );
00387     $strTmpl_inhalt = $oStyle->get_area( 'NewUser' );
00388 }
00389 
00393 function _UserEdit()
00394 {
00395     // global declaration
00396     global $oStyle, $strMessage, $strError, $strTmpl_inhalt, $oAdmin, $oUser, $oLog;
00397 
00398     $intUser = isset( $_REQUEST['uid'] ) ? intval( $_REQUEST['uid'] ) : 0;
00399     $booSubmit = isset( $_REQUEST['submit'] );
00400 
00401     if( $booSubmit )
00402     {
00403         $intHomeX = isset( $_POST['newpos_x'] )  ? intval( $_POST['newpos_x'] )  : 0;
00404         $intHomeY = isset( $_POST['newpos_y'] )  ? intval( $_POST['newpos_y'] )  : 0;
00405         $intGroup = isset( $_POST['usergroup'] ) ? intval( $_POST['usergroup'] ) : 0;
00406         $strPlayer = isset( $_POST['player'] )   ? trim( $_POST['player'] ) : '';
00407 
00408         if( $oAdmin->editUser( $intUser, $strPlayer, $intHomeX, $intHomeY, $intGroup ) )
00409         {
00410             $strMessage = "Der User wurde ge&auml;ndert.";
00411             $oLog->write( "User geaendert: uid=$intUser", 3 );
00412             if( $intUser == $oUser->intUserID )
00413             {
00414                 $oUser->intHomeX = $intHomeX;
00415                 $oUser->intHomeY = $intHomeY;
00416             }
00417         }
00418         else
00419         {
00420             $strError = 'Fehler beim &Auml;ndern des Users.';
00421             $oLog->write( "Fehler beim User aendern: uid=$intUser", 10 );
00422         }
00423     }
00424 
00425     $aUser = $oAdmin->getUser( $intUser );
00426     if( $aUser === false || empty( $aUser ) )
00427     {
00428         $strError = 'Der User existiert nicht.';
00429         return;
00430     }
00431 
00432     $aGroups = $oAdmin->getGroups();
00433     // build group select box
00434     $strOptions = '';
00435     foreach( $aGroups AS $aGroupInfo )
00436     {
00437         $oStyle->addReplacements( array( 'OPT_ID' => $aGroupInfo['usergroup_id'],
00438                                          'OPT_SEL' => $aUser['usergroup_id']==$aGroupInfo['usergroup_id'] ? ' selected="selected"' : '',
00439                                          'OPT_NAME' => $aGroupInfo['name'] ) );
00440         $strOptions .= $oStyle->get_area( 'Option' );
00441     }
00442 
00443     $oStyle->addReplacements( array( 'SEL_NAME' => 'usergroup',
00444                                      'SEL_OPTIONS' => $strOptions ) );
00445     $strGroups = $oStyle->get_area( 'Select' );
00446 
00447     $oStyle->addReplacements( array( 'NEWNAME' => $aUser['name'],
00448                                      'PLAYER' => $aUser['pname'],
00449                                      'NEWX' => $aUser['home_x'],
00450                                      'NEWY' => $aUser['home_y'],
00451                                      'USER_ID' => $intUser,
00452                                      'GROUP' => $strGroups ) );
00453     $strTmpl_inhalt = $oStyle->get_area( 'EditUser' );
00454 }
00455 
00456 
00465 function _UserList()
00466 {
00467     // global declaration
00468     global $oStyle, $strMessage, $strError, $strTmpl_inhalt, $oUser, $oAdmin, $oLog;
00469 
00470     // check if admin wants to delete a user
00471     if( isset( $_GET['delete'] ) && $oUser->isAdmin( 'user_del' ) )
00472     {
00473         if( $oAdmin->delUser( intval( $_GET['delete'] ) ) )
00474         {
00475             $strMessage =  'User gel&ouml;scht';
00476             $oLog->write( 'User geloescht: uid='.$_GET['delete'], 3 );
00477         }
00478         else
00479         {
00480             $strError = 'Fehler beim l&ouml;schen';
00481             $oLog->write( 'Fehler beim loeschen des Users: uid='.$_GET['delete'], 10 );
00482         }
00483     }
00484 
00485     // get order
00486     $strSort = 'user_id';
00487     $strOrder = '';
00488     if( isset( $_GET['sortby'] ) )
00489     {
00490         switch( $_GET['sortby'] )
00491         {
00492             case 'username':
00493                 $strSort = 'name';
00494                 break;
00495             case 'group':
00496                 $strSort = 'usergroup_id';
00497                 break;
00498             case 'lastlogin':
00499                 $strSort = 'lastlogin';
00500                 break;
00501             default:
00502                 $strSort = 'user_id';
00503         }
00504     }
00505     if( isset( $_GET['order'] ) )
00506     {
00507         $strOrder = $_GET['order'] == 'd' ? ' DESC' : ' ASC';
00508     }
00509 
00510     $strRows = '';
00511     // get all users
00512     $aData = $oAdmin->getUsers( $strSort.$strOrder );
00513     $aGroups = $oAdmin->getGroups( 'usergroup_id' );
00514     $i = 0;
00515     foreach( $aData AS $aRow )
00516     {
00517         $strLogin = ( $aRow['lastlogin'] == 0 ? 'never' : date( 'd.m.Y H:i',$aRow['lastlogin']) );
00518 
00519         // build delete link
00520         $oStyle->addReplacements( array( 'UL_ID' => $aRow['user_id'],
00521                                          'UL_NAME' => $aRow['name'] ) );
00522         $strDelete = $oUser->isAdmin( 'user_del' ) ? $oStyle->get_area( 'UserDelete' ) : '';
00523         $strName  = $oUser->isAdmin( 'user_edit' ) ? $oStyle->get_area( 'UserEdit' ) : $aRow['name'];
00524 
00525         $oStyle->addReplacements( array( 'UL_NAME'      => $strName,
00526                                          'UL_DELETE'    => $strDelete,
00527                                          'UL_HOMEX'     => $aRow['home_x'],
00528                                          'UL_HOMEY'     => $aRow['home_y'],
00529                                          'UL_LASTX'     => $aRow['last_x'],
00530                                          'UL_LASTY'     => $aRow['last_y'],
00531                                          'UL_LASTLOGIN' => $strLogin,
00532                                          'UL_GROUP'     => $aGroups[$aRow['usergroup_id']]['name'],
00533                                          'UL_ROW'       => intval(($i++ % 2) == 0) ) );
00534         $strRows .= $oStyle->get_area( 'UserListRow' );
00535     }
00536 
00537     $oStyle->addReplacements( array( 'ROWS' => $strRows,
00538                                      'ORDER_ID' => ( $strSort=='user_id' && $strOrder==' ASC' ) ? 'd' : 'a',
00539                                      'ORDER_NAME' => ( $strSort=='name' && $strOrder==' ASC' ) ? 'd' : 'a',
00540                                      'ORDER_GROUP' => ( $strSort=='usergroup_id' && $strOrder==' ASC' ) ? 'd' : 'a',
00541                                      'ORDER_LOGIN' => ( $strSort=='lastlogin' && $strOrder==' DESC' ) ? 'a' : 'd',
00542                                      'UL_ADD' => ( $oUser->isAdmin( 'user_add' ) ? $oStyle->get_area( 'UserListAdd' ) : '' ) ) );
00543     $strTmpl_inhalt = $oStyle->get_area( 'UserList' );
00544 }
00545 
00546 
00555 function _LogStat()
00556 {
00557     // global declaration
00558     global $oStyle, $strMessage, $strError, $strTmpl_inhalt, $oUser, $oAdmin, $intPagerStart, $intPagerCount;
00559 
00560     // local variables
00561     $strSort   = 'aktionen DESC';
00562     $strSeen   = '';
00563     $strRows   = '';
00564     $strHeader = '';
00565 
00566     // sort order
00567     if( isset( $_GET['sortby'] ) )
00568     {
00569         switch( $_GET['sortby'] )
00570         {
00571             case 'name':
00572                 $strSort = $_GET['sortby'];
00573                 break;
00574             case 'lastseen':
00575                 $strSort = $_GET['sortby']. " DESC";
00576                 break;
00577             case 'aktionen':
00578                 $strSort = $_GET['sortby']. " DESC";
00579                 break;
00580         }
00581     }
00582 
00583     // get entries
00584     $aData = $oAdmin->getLogStat( $strSort, $intPagerStart, $intPagerCount );
00585 
00586     $intEntries = $aData['max'];
00587     unset($aData['max']);
00588     $oPager = new Pager( $intEntries, $intPagerCount, 25, 'admin.php?action=log_stat&amp;' );
00589     $oPager->setcurrent( $intPagerStart );
00590 
00591     // format entries
00592     $i = 0;
00593     foreach( $aData AS $aRow )
00594     {
00595         $strSeen = ($aRow['lastseen'] == 0 ? "" : round((( time() - $aRow['lastseen'] ) / 86400 ),0) );
00596 
00597         $oStyle->addReplacements( array( 'LS_SEEN' => $strSeen,
00598                                          'LS_LASTLOGIN' => ( $aRow['lastseen'] == 0 ? 'never' : date ( 'd.m.Y H:i',$aRow['lastseen']) ),
00599                                          'LS_ACTION' => $aRow['aktionen'],
00600                                          'LS_NAME' => $aRow['name'],
00601                                          'LS_ROW' => intval(($i++ % 2) == 0) ) );
00602         $strRows .= $oStyle->get_area( 'LogStatRow' );
00603     }
00604     if( $oPager->intMaxPage > 1 )
00605     {
00606         $strHeader = "Seite {$oPager->intPage} von {$oPager->intMaxPage} / ".$oPager->link();
00607     }
00608     $oStyle->addReplacements( array( 'ROWS'      => $strRows,
00609                                      'LL_HEADER' => $strHeader,
00610                                      'LL_FOOTER' => $strHeader ) );
00611     // generate template
00612     $strTmpl_inhalt = $oStyle->get_area( 'LogStat' );
00613 }

Generated on Sun May 8 19:29:44 2005 for PhpMap by  doxygen 1.4.2