mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Fixed Windows linefeeds in new code files. Added admin lang file into de and pt_BR translation.
This commit is contained in:
parent
6d4465f4a2
commit
7d87598c41
@ -1,494 +1,494 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Group Admin File
|
||||
*
|
||||
* -> Helps administrating groups
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Only if the user is an admin!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] );
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWGROUP'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "addnewgroup";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['groupname'] = "";
|
||||
$content['groupdescription'] = "";
|
||||
}
|
||||
else if ($_GET['op'] == "adduser" && isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) );
|
||||
|
||||
// Set Mode to add
|
||||
$content['ISADDUSER'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "adduser";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_ADDUSER'];
|
||||
|
||||
// --- Get Groupname
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPS . ".groupname " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE " . DB_GROUPS . ".id = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetSingleRow($result, true);
|
||||
|
||||
if ( isset($tmparray) )
|
||||
{
|
||||
// Copy Groupname
|
||||
$content['GROUPNAME'] = $tmparray['groupname'];
|
||||
|
||||
// --- Get Group Members
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPMEMBERS. ".userid " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetAllRows($result, true);
|
||||
if ( count($tmparray) > 0 )
|
||||
{
|
||||
// Add UserID's to where clause!
|
||||
foreach ($tmparray as $datarow)
|
||||
{
|
||||
if ( isset($whereclause) )
|
||||
$whereclause .= ", " . $datarow['userid'];
|
||||
else
|
||||
$whereclause = " WHERE " . DB_USERS . ".id NOT IN (" . $datarow['userid'];
|
||||
}
|
||||
// Finish whereclause
|
||||
$whereclause .= ") ";
|
||||
}
|
||||
else
|
||||
$whereclause = "";
|
||||
// ---
|
||||
|
||||
// --- Create LIST of Users which are available for selection
|
||||
$sqlquery = "SELECT " .
|
||||
DB_USERS. ".ID as userid, " .
|
||||
DB_USERS. ".username " .
|
||||
" FROM " . DB_USERS .
|
||||
" LEFT OUTER JOIN (" . DB_GROUPMEMBERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
$whereclause .
|
||||
" ORDER BY " . DB_USERS . ".username";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['SUBUSERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['SUBUSERS']) <= 0 )
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISADDUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOMOREUSERS'], $content['GROUPNAME'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISADDUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else if ($_GET['op'] == "removeuser" && isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) );
|
||||
|
||||
// Set Mode to add
|
||||
$content['ISREMOVEUSER'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "removeuser";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_USERDELETE'];
|
||||
|
||||
// --- Get Groupname
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPS . ".groupname " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE " . DB_GROUPS . ".id = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetSingleRow($result, true);
|
||||
|
||||
if ( isset($tmparray) )
|
||||
{
|
||||
// Copy Groupname
|
||||
$content['GROUPNAME'] = $tmparray['groupname'];
|
||||
|
||||
// --- Get Group Members
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPMEMBERS. ".userid, " .
|
||||
DB_USERS. ".username " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" INNER JOIN (" . DB_USERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['SUBRMUSERS'] = DB_GetAllRows($result, true);
|
||||
if ( count($content['SUBRMUSERS']) <= 0 )
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISREMOVEUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOUSERSINGROUP'], $content['GROUPNAME'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISREMOVEUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWGROUP'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "editgroup";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE ID = " . $content['GROUPID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['groupname']) )
|
||||
{
|
||||
$content['GROUPID'] = $myuser['ID'];
|
||||
$content['groupname'] = $myuser['groupname'];
|
||||
$content['groupdescription'] = $myuser['groupdescription'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_INVALIDGROUP'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
// Get GroupInfo
|
||||
$result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['groupname']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_GROUP_WARNDELETEGROUP'], $myrow['groupname'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_DELGROUP'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// TODO: DELETE GROUP SETTINGS, GROUP MEMBERSHIP ...
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENDEL'], $myrow['groupname'] ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_INVALIDGROUP'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['GROUPID'] = intval( DB_RemoveBadChars($_POST['id']) ); } else {$content['GROUPID'] = ""; }
|
||||
if ( isset ($_POST['groupname']) ) { $content['groupname'] = DB_RemoveBadChars($_POST['groupname']); } else {$content['groupname'] = ""; }
|
||||
if ( isset ($_POST['groupdescription']) ) { $content['groupdescription'] = DB_RemoveBadChars($_POST['groupdescription']); } else {$content['groupdescription'] = ""; }
|
||||
|
||||
// Check mandotary values
|
||||
if ( $content['groupname'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPEMPTY'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewgroup" )
|
||||
{
|
||||
$result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE groupname = '" . $content['groupname'] . "'");
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['groupname']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPNAMETAKEN'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add new Group now!
|
||||
$result = DB_Query("INSERT INTO " . DB_GROUPS . " (groupname, groupdescription)
|
||||
VALUES ( '" . $content['groupname'] . "',
|
||||
'" . $content['groupdescription'] . "' )");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "editgroup" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_GROUPS . " SET
|
||||
groupname = '" . $content['groupname'] . "',
|
||||
groupdescription = '" . $content['groupdescription'] . "'
|
||||
WHERE ID = " . $content['GROUPID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "adduser" )
|
||||
{
|
||||
if ( isset($_POST['userid']) )
|
||||
{
|
||||
// Copy UserID
|
||||
$content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) );
|
||||
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
// Add Groupmembership now!
|
||||
$result = DB_Query("INSERT INTO " . DB_GROUPMEMBERS . " (groupid, userid, is_member)
|
||||
VALUES ( " . $content['GROUPID'] . ",
|
||||
" . $content['USERID'] . ",
|
||||
1 )");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENADDEDGROUP'], $myrow['username'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING'];
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "removeuser" )
|
||||
{
|
||||
if ( isset($_POST['userid']) )
|
||||
{
|
||||
// Copy UserID
|
||||
$content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) );
|
||||
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
// remove user from group
|
||||
$result = DB_Query( "DELETE FROM " . DB_GROUPMEMBERS . " WHERE userid = " . $content['USERID'] . " AND groupid = " . $content['GROUPID']);
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_REMUSERFROMGROUP'], $myrow['username'], $content['groupname'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENREMOVED'], $myrow['username'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Groups
|
||||
$content['LISTGROUPS'] = "true";
|
||||
|
||||
// Read all Groupentries
|
||||
$sqlquery = "SELECT ID, " .
|
||||
" groupname, " .
|
||||
" groupdescription " .
|
||||
" FROM " . DB_GROUPS.
|
||||
" ORDER BY ID ";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['GROUPS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['GROUPS']) > 0 )
|
||||
{
|
||||
// --- Process Groups
|
||||
for($i = 0; $i < count($content['GROUPS']); $i++)
|
||||
{
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$content['GROUPS'][$i]['cssclass'] = "line1";
|
||||
else
|
||||
$content['GROUPS'][$i]['cssclass'] = "line2";
|
||||
// ---
|
||||
|
||||
// --- Read all Memberentries for this group
|
||||
$sqlquery = "SELECT " .
|
||||
DB_USERS. ".username, " .
|
||||
DB_GROUPMEMBERS . ".userid, " .
|
||||
DB_GROUPMEMBERS . ".groupid, " .
|
||||
DB_GROUPMEMBERS . ".is_member " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" INNER JOIN (" . DB_USERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPS'][$i]['ID'] .
|
||||
" ORDER BY " . DB_USERS . ".username";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['GROUPS'][$i]['USERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['GROUPS'][$i]['USERS']) > 0 )
|
||||
{
|
||||
// Enable Groupmembers
|
||||
$content['GROUPS'][$i]['GROUPMEMBERS'] = true;
|
||||
|
||||
// Process Groups
|
||||
$subUserCount = count($content['GROUPS'][$i]['USERS']);
|
||||
for($j = 0; $j < $subUserCount; $j++)
|
||||
$content['GROUPS'][$i]['USERS'][$j]['seperator'] = ", ";
|
||||
$content['GROUPS'][$i]['USERS'][$subUserCount-1]['seperator'] = ""; // last one is empty
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else
|
||||
$content['EMPTYGROUPS'] = "true";
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_GROUPOPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_groups.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Group Admin File
|
||||
*
|
||||
* -> Helps administrating groups
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Only if the user is an admin!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] );
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWGROUP'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "addnewgroup";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['groupname'] = "";
|
||||
$content['groupdescription'] = "";
|
||||
}
|
||||
else if ($_GET['op'] == "adduser" && isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) );
|
||||
|
||||
// Set Mode to add
|
||||
$content['ISADDUSER'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "adduser";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_ADDUSER'];
|
||||
|
||||
// --- Get Groupname
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPS . ".groupname " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE " . DB_GROUPS . ".id = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetSingleRow($result, true);
|
||||
|
||||
if ( isset($tmparray) )
|
||||
{
|
||||
// Copy Groupname
|
||||
$content['GROUPNAME'] = $tmparray['groupname'];
|
||||
|
||||
// --- Get Group Members
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPMEMBERS. ".userid " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetAllRows($result, true);
|
||||
if ( count($tmparray) > 0 )
|
||||
{
|
||||
// Add UserID's to where clause!
|
||||
foreach ($tmparray as $datarow)
|
||||
{
|
||||
if ( isset($whereclause) )
|
||||
$whereclause .= ", " . $datarow['userid'];
|
||||
else
|
||||
$whereclause = " WHERE " . DB_USERS . ".id NOT IN (" . $datarow['userid'];
|
||||
}
|
||||
// Finish whereclause
|
||||
$whereclause .= ") ";
|
||||
}
|
||||
else
|
||||
$whereclause = "";
|
||||
// ---
|
||||
|
||||
// --- Create LIST of Users which are available for selection
|
||||
$sqlquery = "SELECT " .
|
||||
DB_USERS. ".ID as userid, " .
|
||||
DB_USERS. ".username " .
|
||||
" FROM " . DB_USERS .
|
||||
" LEFT OUTER JOIN (" . DB_GROUPMEMBERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
$whereclause .
|
||||
" ORDER BY " . DB_USERS . ".username";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['SUBUSERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['SUBUSERS']) <= 0 )
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISADDUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOMOREUSERS'], $content['GROUPNAME'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISADDUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else if ($_GET['op'] == "removeuser" && isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) );
|
||||
|
||||
// Set Mode to add
|
||||
$content['ISREMOVEUSER'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "removeuser";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_USERDELETE'];
|
||||
|
||||
// --- Get Groupname
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPS . ".groupname " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE " . DB_GROUPS . ".id = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$tmparray = DB_GetSingleRow($result, true);
|
||||
|
||||
if ( isset($tmparray) )
|
||||
{
|
||||
// Copy Groupname
|
||||
$content['GROUPNAME'] = $tmparray['groupname'];
|
||||
|
||||
// --- Get Group Members
|
||||
$sqlquery = "SELECT " .
|
||||
DB_GROUPMEMBERS. ".userid, " .
|
||||
DB_USERS. ".username " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" INNER JOIN (" . DB_USERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['SUBRMUSERS'] = DB_GetAllRows($result, true);
|
||||
if ( count($content['SUBRMUSERS']) <= 0 )
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISREMOVEUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOUSERSINGROUP'], $content['GROUPNAME'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable FORM:
|
||||
$content['ISREMOVEUSER'] = false;
|
||||
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWGROUP'] = "true";
|
||||
$content['GROUP_FORMACTION'] = "editgroup";
|
||||
$content['GROUP_SENDBUTTON'] = $content['LN_GROUP_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_GROUPS .
|
||||
" WHERE ID = " . $content['GROUPID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['groupname']) )
|
||||
{
|
||||
$content['GROUPID'] = $myuser['ID'];
|
||||
$content['groupname'] = $myuser['groupname'];
|
||||
$content['groupdescription'] = $myuser['groupdescription'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_INVALIDGROUP'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['GROUPID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
// Get GroupInfo
|
||||
$result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['groupname']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_GROUP_WARNDELETEGROUP'], $myrow['groupname'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_DELGROUP'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// TODO: DELETE GROUP SETTINGS, GROUP MEMBERSHIP ...
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENDEL'], $myrow['groupname'] ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_INVALIDGROUP'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['GROUPID'] = intval( DB_RemoveBadChars($_POST['id']) ); } else {$content['GROUPID'] = ""; }
|
||||
if ( isset ($_POST['groupname']) ) { $content['groupname'] = DB_RemoveBadChars($_POST['groupname']); } else {$content['groupname'] = ""; }
|
||||
if ( isset ($_POST['groupdescription']) ) { $content['groupdescription'] = DB_RemoveBadChars($_POST['groupdescription']); } else {$content['groupdescription'] = ""; }
|
||||
|
||||
// Check mandotary values
|
||||
if ( $content['groupname'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPEMPTY'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewgroup" )
|
||||
{
|
||||
$result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE groupname = '" . $content['groupname'] . "'");
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['groupname']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPNAMETAKEN'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add new Group now!
|
||||
$result = DB_Query("INSERT INTO " . DB_GROUPS . " (groupname, groupdescription)
|
||||
VALUES ( '" . $content['groupname'] . "',
|
||||
'" . $content['groupdescription'] . "' )");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "editgroup" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_GROUPS . " SET
|
||||
groupname = '" . $content['groupname'] . "',
|
||||
groupdescription = '" . $content['groupdescription'] . "'
|
||||
WHERE ID = " . $content['GROUPID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "adduser" )
|
||||
{
|
||||
if ( isset($_POST['userid']) )
|
||||
{
|
||||
// Copy UserID
|
||||
$content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) );
|
||||
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
// Add Groupmembership now!
|
||||
$result = DB_Query("INSERT INTO " . DB_GROUPMEMBERS . " (groupid, userid, is_member)
|
||||
VALUES ( " . $content['GROUPID'] . ",
|
||||
" . $content['USERID'] . ",
|
||||
1 )");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENADDEDGROUP'], $myrow['username'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING'];
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "removeuser" )
|
||||
{
|
||||
if ( isset($_POST['userid']) )
|
||||
{
|
||||
// Copy UserID
|
||||
$content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) );
|
||||
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
// remove user from group
|
||||
$result = DB_Query( "DELETE FROM " . DB_GROUPMEMBERS . " WHERE userid = " . $content['USERID'] . " AND groupid = " . $content['GROUPID']);
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_REMUSERFROMGROUP'], $myrow['username'], $content['groupname'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENREMOVED'], $myrow['username'], $content['groupname'] ) , "groups.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Groups
|
||||
$content['LISTGROUPS'] = "true";
|
||||
|
||||
// Read all Groupentries
|
||||
$sqlquery = "SELECT ID, " .
|
||||
" groupname, " .
|
||||
" groupdescription " .
|
||||
" FROM " . DB_GROUPS.
|
||||
" ORDER BY ID ";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['GROUPS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['GROUPS']) > 0 )
|
||||
{
|
||||
// --- Process Groups
|
||||
for($i = 0; $i < count($content['GROUPS']); $i++)
|
||||
{
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$content['GROUPS'][$i]['cssclass'] = "line1";
|
||||
else
|
||||
$content['GROUPS'][$i]['cssclass'] = "line2";
|
||||
// ---
|
||||
|
||||
// --- Read all Memberentries for this group
|
||||
$sqlquery = "SELECT " .
|
||||
DB_USERS. ".username, " .
|
||||
DB_GROUPMEMBERS . ".userid, " .
|
||||
DB_GROUPMEMBERS . ".groupid, " .
|
||||
DB_GROUPMEMBERS . ".is_member " .
|
||||
" FROM " . DB_GROUPMEMBERS .
|
||||
" INNER JOIN (" . DB_USERS .
|
||||
") ON (" .
|
||||
DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " .
|
||||
" WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPS'][$i]['ID'] .
|
||||
" ORDER BY " . DB_USERS . ".username";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['GROUPS'][$i]['USERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
if ( count($content['GROUPS'][$i]['USERS']) > 0 )
|
||||
{
|
||||
// Enable Groupmembers
|
||||
$content['GROUPS'][$i]['GROUPMEMBERS'] = true;
|
||||
|
||||
// Process Groups
|
||||
$subUserCount = count($content['GROUPS'][$i]['USERS']);
|
||||
for($j = 0; $j < $subUserCount; $j++)
|
||||
$content['GROUPS'][$i]['USERS'][$j]['seperator'] = ", ";
|
||||
$content['GROUPS'][$i]['USERS'][$subUserCount-1]['seperator'] = ""; // last one is empty
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else
|
||||
$content['EMPTYGROUPS'] = "true";
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_GROUPOPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_groups.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
?>
|
@ -1,87 +1,87 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Admin Index File
|
||||
*
|
||||
* -> Shows ...
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Include LogStream facility
|
||||
// include($gl_root_path . 'classes/logstream.class.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
|
||||
// Hardcoded atm
|
||||
$content['REDIRSECONDS'] = 2;
|
||||
// *** *** //
|
||||
|
||||
// --- CONTENT Vars
|
||||
if ( isset($_GET['redir']) )
|
||||
{
|
||||
$content['EXTRA_METATAGS'] = '<meta HTTP-EQUIV="REFRESH" CONTENT="' . $content['REDIRSECONDS'] . '; URL=' . urldecode($_GET['redir']) . '">';
|
||||
$content['SZREDIR'] = urldecode($_GET['redir']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$_GET['redir'] = "index.php";
|
||||
}
|
||||
|
||||
if ( isset($_GET['msg']) )
|
||||
$content['SZMSG'] = urldecode($_GET['msg']);
|
||||
else
|
||||
$content['SZMSG'] = $content["LN_ADMIN_UNKNOWNSTATE"];
|
||||
|
||||
$content['TITLE'] = "phpLogCon - Redirecting to '" . $content['SZREDIR'] . "' in 5 seconds"; // Title of the Page
|
||||
// ---
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/result.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Admin Index File
|
||||
*
|
||||
* -> Shows ...
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Include LogStream facility
|
||||
// include($gl_root_path . 'classes/logstream.class.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
|
||||
// Hardcoded atm
|
||||
$content['REDIRSECONDS'] = 2;
|
||||
// *** *** //
|
||||
|
||||
// --- CONTENT Vars
|
||||
if ( isset($_GET['redir']) )
|
||||
{
|
||||
$content['EXTRA_METATAGS'] = '<meta HTTP-EQUIV="REFRESH" CONTENT="' . $content['REDIRSECONDS'] . '; URL=' . urldecode($_GET['redir']) . '">';
|
||||
$content['SZREDIR'] = urldecode($_GET['redir']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$_GET['redir'] = "index.php";
|
||||
}
|
||||
|
||||
if ( isset($_GET['msg']) )
|
||||
$content['SZMSG'] = urldecode($_GET['msg']);
|
||||
else
|
||||
$content['SZMSG'] = $content["LN_ADMIN_UNKNOWNSTATE"];
|
||||
|
||||
$content['TITLE'] = "phpLogCon - Redirecting to '" . $content['SZREDIR'] . "' in 5 seconds"; // Title of the Page
|
||||
// ---
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/result.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
?>
|
@ -1,330 +1,330 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Search Admin File
|
||||
*
|
||||
* -> Helps administrating custom searches
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "addnewsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['DisplayName'] = "";
|
||||
$content['SearchQuery'] = "";
|
||||
$content['userid'] = null;
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
$content['SEARCHID'] = "";
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "editsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_SEARCHES .
|
||||
" WHERE ID = " . $content['SEARCHID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$mysearch = DB_GetSingleRow($result, true);
|
||||
if ( isset($mysearch['DisplayName']) )
|
||||
{
|
||||
$content['SEARCHID'] = $mysearch['ID'];
|
||||
$content['DisplayName'] = $mysearch['DisplayName'];
|
||||
$content['SearchQuery'] = $mysearch['SearchQuery'];
|
||||
if ( $mysearch['userid'] != null )
|
||||
$content['CHECKED_ISUSERONLY'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
{
|
||||
// Process All Groups
|
||||
for($i = 0; $i < count($content['SUBGROUPS']); $i++)
|
||||
{
|
||||
if ( $mysearch['groupid'] != null && $content['SUBGROUPS'][$i]['mygroupid'] == $mysearch['groupid'] )
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "selected";
|
||||
else
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "";
|
||||
}
|
||||
|
||||
// Enable Group Selection
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
}
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
// ---
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
// Get UserInfo
|
||||
$result = DB_Query("SELECT DisplayName FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['DisplayName']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_SEARCH_WARNDELETESEARCH'], $myrow['DisplayName'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_DELSEARCH'], $content['SEARCHID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_HASBEENDEL'], $myrow['DisplayName'] ) , "searches.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['SEARCHID'] = intval(DB_RemoveBadChars($_POST['id'])); } else {$content['SEARCHID'] = -1; }
|
||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
||||
if ( isset ($_POST['SearchQuery']) ) { $content['SearchQuery'] = DB_RemoveBadChars($_POST['SearchQuery']); } else {$content['SearchQuery'] = ""; }
|
||||
|
||||
// User & Group handeled specially
|
||||
if ( isset ($_POST['isuseronly']) )
|
||||
{
|
||||
$content['userid'] = $content['SESSION_USERID'];
|
||||
$content['groupid'] = "null"; // Either user or group not both!
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['userid'] = "null";
|
||||
if ( isset ($_POST['groupid']) && $_POST['groupid'] != -1 )
|
||||
$content['groupid'] = intval($_POST['groupid']);
|
||||
else
|
||||
$content['groupid'] = "null";
|
||||
}
|
||||
|
||||
// --- Check mandotary values
|
||||
if ( $content['DisplayName'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'];
|
||||
}
|
||||
else if ( $content['SearchQuery'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'];
|
||||
}
|
||||
// ---
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewsearch" )
|
||||
{
|
||||
// Add custom search now!
|
||||
$sqlquery = "INSERT INTO " . DB_SEARCHES . " (DisplayName, SearchQuery, userid, groupid)
|
||||
VALUES ('" . $content['DisplayName'] . "',
|
||||
'" . $content['SearchQuery'] . "',
|
||||
" . $content['userid'] . ",
|
||||
" . $content['groupid'] . "
|
||||
)";
|
||||
$result = DB_Query($sqlquery);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editsearch" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the Search Entry now!
|
||||
$result = DB_Query("UPDATE " . DB_SEARCHES . " SET
|
||||
DisplayName = '" . $content['DisplayName'] . "',
|
||||
SearchQuery = '" . $content['SearchQuery'] . "',
|
||||
userid = " . $content['userid'] . ",
|
||||
groupid = " . $content['groupid'] . "
|
||||
WHERE ID = " . $content['SEARCHID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], $content['DisplayName']) , "searches.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Searches
|
||||
$content['LISTSEARCHES'] = "true";
|
||||
|
||||
// Copy Search array for further modifications
|
||||
$content['SEARCHES'] = $content['Search'];
|
||||
|
||||
$i = 0; // Help counter!
|
||||
foreach ($content['SEARCHES'] as &$mySearch )
|
||||
{
|
||||
$mySearch['SearchQuery_Display'] = strlen($mySearch['SearchQuery']) > 25 ? substr($mySearch['SearchQuery'], 0, 25) . " ..." : $mySearch['SearchQuery'];
|
||||
|
||||
// Allow EDIT
|
||||
$mySearch['ActionsAllowed'] = true;
|
||||
|
||||
// --- Set Image for Type
|
||||
if ( $mySearch['userid'] != null )
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_ADMINUSERS"];
|
||||
$mySearch['SearchTypeText'] = $content["LN_GEN_USERONLY"];
|
||||
}
|
||||
else if ( $mySearch['groupid'] != null )
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_ADMINGROUPS"];
|
||||
$mySearch['SearchTypeText'] = GetAndReplaceLangStr( $content["LN_GEN_GROUPONLYNAME"], $mySearch['groupname'] );
|
||||
|
||||
// Check if is ADMIN User, deny if normal user!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
$mySearch['ActionsAllowed'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_GLOBAL"];
|
||||
$mySearch['SearchTypeText'] = $content["LN_GEN_GLOBAL"];
|
||||
|
||||
// Check if is ADMIN User, deny if normal user!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
$mySearch['ActionsAllowed'] = false;
|
||||
}
|
||||
// ---
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$mySearch['cssclass'] = "line1";
|
||||
else
|
||||
$mySearch['cssclass'] = "line2";
|
||||
$i++;
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_SEARCHOPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_searches.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Search Admin File
|
||||
*
|
||||
* -> Helps administrating custom searches
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "addnewsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['DisplayName'] = "";
|
||||
$content['SearchQuery'] = "";
|
||||
$content['userid'] = null;
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
$content['SEARCHID'] = "";
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "editsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_SEARCHES .
|
||||
" WHERE ID = " . $content['SEARCHID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$mysearch = DB_GetSingleRow($result, true);
|
||||
if ( isset($mysearch['DisplayName']) )
|
||||
{
|
||||
$content['SEARCHID'] = $mysearch['ID'];
|
||||
$content['DisplayName'] = $mysearch['DisplayName'];
|
||||
$content['SearchQuery'] = $mysearch['SearchQuery'];
|
||||
if ( $mysearch['userid'] != null )
|
||||
$content['CHECKED_ISUSERONLY'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
{
|
||||
// Process All Groups
|
||||
for($i = 0; $i < count($content['SUBGROUPS']); $i++)
|
||||
{
|
||||
if ( $mysearch['groupid'] != null && $content['SUBGROUPS'][$i]['mygroupid'] == $mysearch['groupid'] )
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "selected";
|
||||
else
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "";
|
||||
}
|
||||
|
||||
// Enable Group Selection
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
}
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
// ---
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
// Get UserInfo
|
||||
$result = DB_Query("SELECT DisplayName FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['DisplayName']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_SEARCH_WARNDELETESEARCH'], $myrow['DisplayName'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_DELSEARCH'], $content['SEARCHID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_HASBEENDEL'], $myrow['DisplayName'] ) , "searches.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['SEARCHID'] = intval(DB_RemoveBadChars($_POST['id'])); } else {$content['SEARCHID'] = -1; }
|
||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
||||
if ( isset ($_POST['SearchQuery']) ) { $content['SearchQuery'] = DB_RemoveBadChars($_POST['SearchQuery']); } else {$content['SearchQuery'] = ""; }
|
||||
|
||||
// User & Group handeled specially
|
||||
if ( isset ($_POST['isuseronly']) )
|
||||
{
|
||||
$content['userid'] = $content['SESSION_USERID'];
|
||||
$content['groupid'] = "null"; // Either user or group not both!
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['userid'] = "null";
|
||||
if ( isset ($_POST['groupid']) && $_POST['groupid'] != -1 )
|
||||
$content['groupid'] = intval($_POST['groupid']);
|
||||
else
|
||||
$content['groupid'] = "null";
|
||||
}
|
||||
|
||||
// --- Check mandotary values
|
||||
if ( $content['DisplayName'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'];
|
||||
}
|
||||
else if ( $content['SearchQuery'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'];
|
||||
}
|
||||
// ---
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewsearch" )
|
||||
{
|
||||
// Add custom search now!
|
||||
$sqlquery = "INSERT INTO " . DB_SEARCHES . " (DisplayName, SearchQuery, userid, groupid)
|
||||
VALUES ('" . $content['DisplayName'] . "',
|
||||
'" . $content['SearchQuery'] . "',
|
||||
" . $content['userid'] . ",
|
||||
" . $content['groupid'] . "
|
||||
)";
|
||||
$result = DB_Query($sqlquery);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editsearch" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the Search Entry now!
|
||||
$result = DB_Query("UPDATE " . DB_SEARCHES . " SET
|
||||
DisplayName = '" . $content['DisplayName'] . "',
|
||||
SearchQuery = '" . $content['SearchQuery'] . "',
|
||||
userid = " . $content['userid'] . ",
|
||||
groupid = " . $content['groupid'] . "
|
||||
WHERE ID = " . $content['SEARCHID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], $content['DisplayName']) , "searches.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Searches
|
||||
$content['LISTSEARCHES'] = "true";
|
||||
|
||||
// Copy Search array for further modifications
|
||||
$content['SEARCHES'] = $content['Search'];
|
||||
|
||||
$i = 0; // Help counter!
|
||||
foreach ($content['SEARCHES'] as &$mySearch )
|
||||
{
|
||||
$mySearch['SearchQuery_Display'] = strlen($mySearch['SearchQuery']) > 25 ? substr($mySearch['SearchQuery'], 0, 25) . " ..." : $mySearch['SearchQuery'];
|
||||
|
||||
// Allow EDIT
|
||||
$mySearch['ActionsAllowed'] = true;
|
||||
|
||||
// --- Set Image for Type
|
||||
if ( $mySearch['userid'] != null )
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_ADMINUSERS"];
|
||||
$mySearch['SearchTypeText'] = $content["LN_GEN_USERONLY"];
|
||||
}
|
||||
else if ( $mySearch['groupid'] != null )
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_ADMINGROUPS"];
|
||||
$mySearch['SearchTypeText'] = GetAndReplaceLangStr( $content["LN_GEN_GROUPONLYNAME"], $mySearch['groupname'] );
|
||||
|
||||
// Check if is ADMIN User, deny if normal user!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
$mySearch['ActionsAllowed'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mySearch['SearchTypeImage'] = $content["MENU_GLOBAL"];
|
||||
$mySearch['SearchTypeText'] = $content["LN_GEN_GLOBAL"];
|
||||
|
||||
// Check if is ADMIN User, deny if normal user!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
$mySearch['ActionsAllowed'] = false;
|
||||
}
|
||||
// ---
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$mySearch['cssclass'] = "line1";
|
||||
else
|
||||
$mySearch['cssclass'] = "line2";
|
||||
$i++;
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_SEARCHOPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_searches.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -1,383 +1,383 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* User Admin File
|
||||
*
|
||||
* -> Helps administrating users
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Only if the user is an admin!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] );
|
||||
|
||||
if ( isset($_GET['miniop']) && $_GET['miniop'] == "setisadmin" )
|
||||
{
|
||||
if ( isset($_GET['id']) && isset($_GET['newval']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = intval(DB_RemoveBadChars($_GET['id']));
|
||||
$iNewVal = intval(DB_RemoveBadChars($_GET['newval']));
|
||||
|
||||
// --- handle special case
|
||||
if ( $content['USERID'] == $content['SESSION_USERID'] && (!isset($_GET['verify']) || $_GET['verify'] != "yes") && $iNewVal == 0)
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( $content['LN_USER_WARNREMOVEADMIN'], $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// Perform SQL Query!
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_USERS .
|
||||
" WHERE ID = " . $content['USERID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['username']) )
|
||||
{
|
||||
// Update is_admin setting!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
is_admin = $iNewVal
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = "Error setting is_admin flat, invalid ID, User not found";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWUSER'] = "true";
|
||||
$content['USER_FORMACTION'] = "addnewuser";
|
||||
$content['USER_SENDBUTTON'] = $content['LN_USER_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['USERNAME'] = "";
|
||||
$content['PASSWORD1'] = "";
|
||||
$content['PASSWORD2'] = "";
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWUSER'] = "true";
|
||||
$content['USER_FORMACTION'] = "edituser";
|
||||
$content['USER_SENDBUTTON'] = $content['LN_USER_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_USERS .
|
||||
" WHERE ID = " . $content['USERID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['username']) )
|
||||
{
|
||||
$content['USERID'] = $myuser['ID'];
|
||||
$content['USERNAME'] = $myuser['username'];
|
||||
|
||||
// Set is_admin flag
|
||||
if ( $myuser['is_admin'] == 1 )
|
||||
$content['CHECKED_ISADMIN'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISADMIN'] = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
if ( !isset($_SESSION['SESSION_USERNAME']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDSESSIONS'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get UserInfo
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE ID = " . $content['USERID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['username']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
|
||||
if ( $_SESSION['SESSION_USERNAME'] == $myrow['username'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_DONOTDELURSLF'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_USER_WARNDELETEUSER'], $myrow['username'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_USERS . " WHERE ID = " . $content['USERID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_DELUSER'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// TODO: DELETE PERSONAL SETTINGS, GROUP MEMBERSHIP ...
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENDEL'], $myrow['username'] ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['USERID'] = DB_RemoveBadChars($_POST['id']); } else {$content['USERID'] = ""; }
|
||||
if ( isset ($_POST['username']) ) { $content['USERNAME'] = DB_RemoveBadChars($_POST['username']); } else {$content['USERNAME'] = ""; }
|
||||
if ( isset ($_POST['password1']) ) { $content['PASSWORD1'] = DB_RemoveBadChars($_POST['password1']); } else {$content['PASSWORD1'] = ""; }
|
||||
if ( isset ($_POST['password2']) ) { $content['PASSWORD2'] = DB_RemoveBadChars($_POST['password2']); } else {$content['PASSWORD2'] = ""; }
|
||||
if ( isset ($_POST['isadmin']) ) { $content['ISADMIN'] = 1; } else {$content['ISADMIN'] = 0; }
|
||||
|
||||
|
||||
// Check mandotary values
|
||||
if ( $content['USERNAME'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_USEREMPTY'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewuser" )
|
||||
{
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE username = '" . $content['USERNAME'] . "'");
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_USERNAMETAKEN'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if Password is set!
|
||||
if ( strlen($content['PASSWORD1']) <= 0 ||
|
||||
$content['PASSWORD1'] != $content['PASSWORD2'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Create passwordhash now :)!
|
||||
$content['PASSWORDHASH'] = md5( $content['PASSWORD1'] );
|
||||
|
||||
// Add new User now!
|
||||
$result = DB_Query("INSERT INTO " . DB_USERS . " (username, password, is_admin)
|
||||
VALUES ('" . $content['USERNAME'] . "',
|
||||
'" . $content['PASSWORDHASH'] . "',
|
||||
" . $content['ISADMIN'] . ")");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "edituser" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_USERS . " WHERE ID = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Check if Password is enabled
|
||||
if ( isset($content['PASSWORD1']) && strlen($content['PASSWORD1']) > 0 )
|
||||
{
|
||||
if ( $content['PASSWORD1'] != $content['PASSWORD2'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Create passwordhash now :)!
|
||||
$content['PASSWORDHASH'] = md5( $content['PASSWORD1'] );
|
||||
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
username = '" . $content['USERNAME'] . "',
|
||||
password = '" . $content['PASSWORDHASH'] . "',
|
||||
is_admin = " . $content['ISADMIN'] . "
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
username = '" . $content['USERNAME'] . "',
|
||||
is_admin = " . $content['ISADMIN'] . "
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Users
|
||||
$content['LISTUSERS'] = "true";
|
||||
|
||||
// Read all Serverentries
|
||||
$sqlquery = "SELECT ID, " .
|
||||
" username, " .
|
||||
" is_admin " .
|
||||
" FROM " . DB_USERS .
|
||||
" ORDER BY ID ";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['USERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
// --- Process Users
|
||||
for($i = 0; $i < count($content['USERS']); $i++)
|
||||
{
|
||||
// --- Set Image for IsClanMember
|
||||
if ( $content['USERS'][$i]['is_admin'] == 1 )
|
||||
{
|
||||
$content['USERS'][$i]['is_isadmin_string'] = $content['MENU_SELECTION_ENABLED'];
|
||||
$content['USERS'][$i]['set_isadmin'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['USERS'][$i]['is_isadmin_string'] = $content['MENU_SELECTION_DISABLED'];
|
||||
$content['USERS'][$i]['set_isadmin'] = 1;
|
||||
}
|
||||
// ---
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$content['USERS'][$i]['cssclass'] = "line1";
|
||||
else
|
||||
$content['USERS'][$i]['cssclass'] = "line2";
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_USEROPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_users.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* User Admin File
|
||||
*
|
||||
* -> Helps administrating users
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './../';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// Set PAGE to be ADMINPAGE!
|
||||
define('IS_ADMINPAGE', true);
|
||||
$content['IS_ADMINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
InitSourceConfigs();
|
||||
InitFrontEndDefaults(); // Only in WebFrontEnd
|
||||
InitFilterHelpers(); // Helpers for frontend filtering!
|
||||
|
||||
// Init admin langauge file now!
|
||||
IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Only if the user is an admin!
|
||||
if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
||||
DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] );
|
||||
|
||||
if ( isset($_GET['miniop']) && $_GET['miniop'] == "setisadmin" )
|
||||
{
|
||||
if ( isset($_GET['id']) && isset($_GET['newval']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = intval(DB_RemoveBadChars($_GET['id']));
|
||||
$iNewVal = intval(DB_RemoveBadChars($_GET['newval']));
|
||||
|
||||
// --- handle special case
|
||||
if ( $content['USERID'] == $content['SESSION_USERID'] && (!isset($_GET['verify']) || $_GET['verify'] != "yes") && $iNewVal == 0)
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( $content['LN_USER_WARNREMOVEADMIN'], $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// Perform SQL Query!
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_USERS .
|
||||
" WHERE ID = " . $content['USERID'];
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['username']) )
|
||||
{
|
||||
// Update is_admin setting!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
is_admin = $iNewVal
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = "Error setting is_admin flat, invalid ID, User not found";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWUSER'] = "true";
|
||||
$content['USER_FORMACTION'] = "addnewuser";
|
||||
$content['USER_SENDBUTTON'] = $content['LN_USER_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['USERNAME'] = "";
|
||||
$content['PASSWORD1'] = "";
|
||||
$content['PASSWORD2'] = "";
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWUSER'] = "true";
|
||||
$content['USER_FORMACTION'] = "edituser";
|
||||
$content['USER_SENDBUTTON'] = $content['LN_USER_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_USERS .
|
||||
" WHERE ID = " . $content['USERID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$myuser = DB_GetSingleRow($result, true);
|
||||
if ( isset($myuser['username']) )
|
||||
{
|
||||
$content['USERID'] = $myuser['ID'];
|
||||
$content['USERNAME'] = $myuser['username'];
|
||||
|
||||
// Set is_admin flag
|
||||
if ( $myuser['is_admin'] == 1 )
|
||||
$content['CHECKED_ISADMIN'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISADMIN'] = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['USERID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
if ( !isset($_SESSION['SESSION_USERNAME']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDSESSIONS'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get UserInfo
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE ID = " . $content['USERID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['username']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
|
||||
if ( $_SESSION['SESSION_USERNAME'] == $myrow['username'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_DONOTDELURSLF'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_USER_WARNDELETEUSER'], $myrow['username'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_USERS . " WHERE ID = " . $content['USERID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_DELUSER'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// TODO: DELETE PERSONAL SETTINGS, GROUP MEMBERSHIP ...
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENDEL'], $myrow['username'] ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['USERID'] = DB_RemoveBadChars($_POST['id']); } else {$content['USERID'] = ""; }
|
||||
if ( isset ($_POST['username']) ) { $content['USERNAME'] = DB_RemoveBadChars($_POST['username']); } else {$content['USERNAME'] = ""; }
|
||||
if ( isset ($_POST['password1']) ) { $content['PASSWORD1'] = DB_RemoveBadChars($_POST['password1']); } else {$content['PASSWORD1'] = ""; }
|
||||
if ( isset ($_POST['password2']) ) { $content['PASSWORD2'] = DB_RemoveBadChars($_POST['password2']); } else {$content['PASSWORD2'] = ""; }
|
||||
if ( isset ($_POST['isadmin']) ) { $content['ISADMIN'] = 1; } else {$content['ISADMIN'] = 0; }
|
||||
|
||||
|
||||
// Check mandotary values
|
||||
if ( $content['USERNAME'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_USEREMPTY'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewuser" )
|
||||
{
|
||||
$result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE username = '" . $content['USERNAME'] . "'");
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( isset($myrow['username']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_USERNAMETAKEN'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if Password is set!
|
||||
if ( strlen($content['PASSWORD1']) <= 0 ||
|
||||
$content['PASSWORD1'] != $content['PASSWORD2'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Create passwordhash now :)!
|
||||
$content['PASSWORDHASH'] = md5( $content['PASSWORD1'] );
|
||||
|
||||
// Add new User now!
|
||||
$result = DB_Query("INSERT INTO " . DB_USERS . " (username, password, is_admin)
|
||||
VALUES ('" . $content['USERNAME'] . "',
|
||||
'" . $content['PASSWORDHASH'] . "',
|
||||
" . $content['ISADMIN'] . ")");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "edituser" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_USERS . " WHERE ID = " . $content['USERID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Check if Password is enabled
|
||||
if ( isset($content['PASSWORD1']) && strlen($content['PASSWORD1']) > 0 )
|
||||
{
|
||||
if ( $content['PASSWORD1'] != $content['PASSWORD2'] )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT'];
|
||||
}
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Create passwordhash now :)!
|
||||
$content['PASSWORDHASH'] = md5( $content['PASSWORD1'] );
|
||||
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
username = '" . $content['USERNAME'] . "',
|
||||
password = '" . $content['PASSWORDHASH'] . "',
|
||||
is_admin = " . $content['ISADMIN'] . "
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the User now!
|
||||
$result = DB_Query("UPDATE " . DB_USERS . " SET
|
||||
username = '" . $content['USERNAME'] . "',
|
||||
is_admin = " . $content['ISADMIN'] . "
|
||||
WHERE ID = " . $content['USERID']);
|
||||
DB_FreeQuery($result);
|
||||
}
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Users
|
||||
$content['LISTUSERS'] = "true";
|
||||
|
||||
// Read all Serverentries
|
||||
$sqlquery = "SELECT ID, " .
|
||||
" username, " .
|
||||
" is_admin " .
|
||||
" FROM " . DB_USERS .
|
||||
" ORDER BY ID ";
|
||||
$result = DB_Query($sqlquery);
|
||||
$content['USERS'] = DB_GetAllRows($result, true);
|
||||
|
||||
// --- Process Users
|
||||
for($i = 0; $i < count($content['USERS']); $i++)
|
||||
{
|
||||
// --- Set Image for IsClanMember
|
||||
if ( $content['USERS'][$i]['is_admin'] == 1 )
|
||||
{
|
||||
$content['USERS'][$i]['is_isadmin_string'] = $content['MENU_SELECTION_ENABLED'];
|
||||
$content['USERS'][$i]['set_isadmin'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['USERS'][$i]['is_isadmin_string'] = $content['MENU_SELECTION_DISABLED'];
|
||||
$content['USERS'][$i]['set_isadmin'] = 1;
|
||||
}
|
||||
// ---
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$content['USERS'][$i]['cssclass'] = "line1";
|
||||
else
|
||||
$content['USERS'][$i]['cssclass'] = "line2";
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- BEGIN CREATE TITLE
|
||||
$content['TITLE'] = InitPageTitle();
|
||||
$content['TITLE'] .= " :: " . $content['LN_ADMINMENU_USEROPT'];
|
||||
// --- END CREATE TITLE
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "admin/admin_users.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
?>
|
1152
src/admin/views.php
1152
src/admin/views.php
File diff suppressed because it is too large
Load Diff
211
src/lang/de/admin.php
Normal file
211
src/lang/de/admin.php
Normal file
@ -0,0 +1,211 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* -> www.phplogcon.org <-
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution.
|
||||
*********************************************************************
|
||||
*/
|
||||
global $content;
|
||||
|
||||
// Global Stuff
|
||||
$content['LN_ADMINMENU_HOMEPAGE'] = "Back to Show Events";
|
||||
$content['LN_ADMINMENU_GENOPT'] = "General Options";
|
||||
$content['LN_ADMINMENU_SOURCEOPT'] = "Sources Options";
|
||||
$content['LN_ADMINMENU_VIEWSOPT'] = "Views Options";
|
||||
$content['LN_ADMINMENU_SEARCHOPT'] = "Search Options";
|
||||
$content['LN_ADMINMENU_USEROPT'] = "User Options";
|
||||
$content['LN_ADMINMENU_GROUPOPT'] = "Group Options";
|
||||
$content['LN_ADMIN_CENTER'] = "Admin center";
|
||||
$content['LN_ADMIN_UNKNOWNSTATE'] = "Unknown State";
|
||||
$content['LN_ADMIN_ERROR_NOTALLOWED'] = "You are not allowed to access this page with your user level.";
|
||||
$content['LN_DELETEYES'] = "Yes";
|
||||
$content['LN_DELETENO'] = "No";
|
||||
$content['LN_GEN_ACTIONS'] = "Available Actions";
|
||||
$content['LN_ADMIN_SEND'] = "Send changes";
|
||||
$content['LN_GEN_USERONLY'] = "User only";
|
||||
$content['LN_GEN_GROUPONLY'] = "Group only";
|
||||
$content['LN_GEN_GLOBAL'] = "Global";
|
||||
$content['LN_GEN_USERONLY_LONG'] = "For me only <br>(Only available to your user)";
|
||||
$content['LN_GEN_GROUPONLY_LONG'] = "For this group <br>(Only available to the selected group)";
|
||||
$content['LN_GEN_GROUPONLYNAME'] = "Group '%1'";
|
||||
|
||||
|
||||
// General Options
|
||||
$content['LN_ADMIN_GLOBFRONTEND'] = "Global frontend options";
|
||||
$content['LN_ADMIN_USERFRONTEND'] = "User specific frontend options";
|
||||
$content['LN_ADMIN_MISC'] = "Miscellaneous Options";
|
||||
$content['LN_GEN_SHOWDEBUGMSG'] = "Show Debug messages";
|
||||
$content['LN_GEN_DEBUGGRIDCOUNTER'] = "Show Debug Gridcounter";
|
||||
$content['LN_GEN_SHOWPAGERENDERSTATS'] = "Show Pagerenderstats";
|
||||
$content['LN_GEN_ENABLEGZIP'] = "Enable GZIP Compressed Output";
|
||||
$content['LN_GEN_DEBUGUSERLOGIN'] = "Debug Userlogin";
|
||||
$content['LN_GEN_WEBSTYLE'] = "Default selected style";
|
||||
$content['LN_GEN_SELLANGUAGE'] = "Default selected language";
|
||||
$content['LN_GEN_PREPENDTITLE'] = "Prepend this string in title";
|
||||
$content['LN_GEN_USETODAY'] = "Use Today and Yesterday in timefields";
|
||||
$content['LN_GEN_DETAILPOPUPS'] = "Use Popup to display the full messagedetails";
|
||||
$content['LN_GEN_MSGCHARLIMIT'] = "Character limit of the message in main view";
|
||||
$content['LN_GEN_ENTRIESPERPAGE'] = "Number of entries per page";
|
||||
$content['LN_GEN_AUTORELOADSECONDS'] = "Enable autoreload after seconds";
|
||||
$content['LN_GEN_IPADRRESOLVE'] = "Resolve IP Addresses using DNS";
|
||||
$content['LN_GEN_CUSTBTNCAPT'] = "Custom search caption";
|
||||
$content['LN_GEN_CUSTBTNSRCH'] = "Custom search string";
|
||||
$content['LN_GEN_SUCCESSFULLYSAVED'] = "The configuration Values have been successfully saved";
|
||||
$content['LN_GEN_INTERNAL'] = "Internal";
|
||||
$content['LN_GEN_DISABLED'] = "Function disabled";
|
||||
$content['LN_GEN_CONFIGFILE'] = "Configuration File";
|
||||
$content['LN_GEN_ACCESSDENIED'] = "Access denied to this function";
|
||||
|
||||
// User Center
|
||||
$content['LN_USER_CENTER'] = "User Options";
|
||||
$content['LN_USER_ID'] = "ID";
|
||||
$content['LN_USER_NAME'] = "Username";
|
||||
$content['LN_USER_ADD'] = "Add User";
|
||||
$content['LN_USER_EDIT'] = "Edit User";
|
||||
$content['LN_USER_DELETE'] = "Delete User";
|
||||
$content['LN_USER_PASSWORD1'] = "Password";
|
||||
$content['LN_USER_PASSWORD2'] = "Confirm Password";
|
||||
$content['LN_USER_ERROR_IDNOTFOUND'] = "Error, User with ID '%1' , was not found";
|
||||
$content['LN_USER_ERROR_DONOTDELURSLF'] = "Error, you can not DELETE YOURSELF!";
|
||||
$content['LN_USER_ERROR_DELUSER'] = "Deleting of the user with id '%1' failed!";
|
||||
$content['LN_USER_ERROR_INVALIDID'] = "Error, invalid ID, User not found";
|
||||
$content['LN_USER_ERROR_HASBEENDEL'] = "The User '%1' has been successfully deleted!";
|
||||
$content['LN_USER_ERROR_USEREMPTY'] = "Error, Username was empty";
|
||||
$content['LN_USER_ERROR_USERNAMETAKEN'] = "Error, this Username is already taken!";
|
||||
$content['LN_USER_ERROR_PASSSHORT'] = "Error, Password was to short, or did not match";
|
||||
$content['LN_USER_ERROR_HASBEENADDED'] = "User '%1' has been successfully added";
|
||||
$content['LN_USER_ERROR_HASBEENEDIT'] = "User '%1' has been successfully edited";
|
||||
$content['LN_USER_ISADMIN'] = "Is Admin?";
|
||||
$content['LN_USER_ADDEDIT'] = "Add/Edit User";
|
||||
$content['LN_USER_WARNREMOVEADMIN'] = "You are about to revoke your own administrative priviledges. Are you sure to remove your admin status?";
|
||||
$content['LN_USER_WARNDELETEUSER'] = "Are you sure that you want to delete the User '%1'? All his personal settings will be deleted as well.";
|
||||
$content['LN_USER_ERROR_INVALIDSESSIONS'] = "Invalid User Session.";
|
||||
$content['LN_USER_'] = "";
|
||||
|
||||
// Group center
|
||||
$content['LN_GROUP_CENTER'] = "Group Center";
|
||||
$content['LN_GROUP_ID'] = "ID";
|
||||
$content['LN_GROUP_NAME'] = "Groupname";
|
||||
$content['LN_GROUP_DESCRIPTION'] = "Groupdescription";
|
||||
$content['LN_GROUP_TYPE'] = "Grouptype";
|
||||
$content['LN_GROUP_ADD'] = "Add Group";
|
||||
$content['LN_GROUP_EDIT'] = "Edit Group";
|
||||
$content['LN_GROUP_DELETE'] = "Delete Group";
|
||||
$content['LN_GROUP_NOGROUPS'] = "No groups have been added yet";
|
||||
$content['LN_GROUP_ADDEDIT'] = "Add/Edit Group";
|
||||
$content['LN_GROUP_ERROR_GROUPEMPTY'] = "The groupname cannot be empty.";
|
||||
$content['LN_GROUP_ERROR_GROUPNAMETAKEN'] = "The groupname has already been taken.";
|
||||
$content['LN_GROUP_HASBEENADDED'] = "The group '%1' has been successfully added.";
|
||||
$content['LN_GROUP_ERROR_IDNOTFOUND'] = "The group with ID '%1' could not be found.";
|
||||
$content['LN_GROUP_ERROR_HASBEENEDIT'] = "The group '%1' has been successfully edited.";
|
||||
$content['LN_GROUP_ERROR_INVALIDGROUP'] = "Error, invalid ID, Group not found";
|
||||
$content['LN_GROUP_WARNDELETEGROUP'] = "Are you sure that you want to delete the Group '%1'? All Groupsettings will be deleted as well.";
|
||||
$content['LN_GROUP_ERROR_DELGROUP'] = "Deleting of the group with id '%1' failed!";
|
||||
$content['LN_GROUP_ERROR_HASBEENDEL'] = "The Group '%1' has been successfully deleted!";
|
||||
$content['LN_GROUP_MEMBERS'] = "Groupmembers: ";
|
||||
$content['LN_GROUP_ADDUSER'] = "Add User to Group";
|
||||
$content['LN_GROUP_ERROR_USERIDMISSING'] = "The userid is missing.";
|
||||
$content['LN_GROUP_USERHASBEENADDEDGROUP'] = "The User '%1' has been successfully added to group '%2'";
|
||||
$content['LN_GROUP_ERRORNOMOREUSERS'] = "There are no more available users who can be added to the group '%1'";
|
||||
$content['LN_GROUP_USER_ADD'] = "Add User to the group";
|
||||
$content['LN_GROUP_USERDELETE'] = "Remove a User from the group";
|
||||
$content['LN_GROUP_ERRORNOUSERSINGROUP'] = "There are no users to remove in this the group '%1'";
|
||||
$content['LN_GROUP_ERROR_REMUSERFROMGROUP'] = "The user '%1' could not be removed from the group '%2'";
|
||||
$content['LN_GROUP_USERHASBEENREMOVED'] = "The user '%1' has been successfully removed from the group '%2'";
|
||||
$content['LN_GROUP_'] = "";
|
||||
|
||||
// Custom Searches center
|
||||
$content['LN_SEARCH_CENTER'] = "Custom Searches";
|
||||
$content['LN_SEARCH_ADD'] = "Add new Custom Search";
|
||||
$content['LN_SEARCH_ID'] = "ID";
|
||||
$content['LN_SEARCH_NAME'] = "Search Name";
|
||||
$content['LN_SEARCH_QUERY'] = "Search Query";
|
||||
$content['LN_SEARCH_TYPE'] = "Assigned to";
|
||||
$content['LN_SEARCH_EDIT'] = "Edit Custom Search";
|
||||
$content['LN_SEARCH_DELETE'] = "Delete Custom Search";
|
||||
$content['LN_SEARCH_ADDEDIT'] = "Add / Edit a Custom Search";
|
||||
$content['LN_SEARCH_SELGROUPENABLE'] = ">> Select Group to enable <<";
|
||||
$content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
||||
$content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'] = "The SearchQuery cannot be empty.";
|
||||
$content['LN_SEARCH_HASBEENADDED'] = "The Custom Search '%1' has been successfully added.";
|
||||
$content['LN_SEARCH_ERROR_IDNOTFOUND'] = "Could not find a search with ID '%1'.";
|
||||
$content['LN_SEARCH_ERROR_INVALIDID'] = "Invalid search ID.";
|
||||
$content['LN_SEARCH_HASBEENEDIT'] = "The Custom Search '%1' has been successfully edited.";
|
||||
$content['LN_SEARCH_WARNDELETESEARCH'] = "Are you sure that you want to delete the Custom Search '%1'? This cannot be undone!";
|
||||
$content['LN_SEARCH_ERROR_DELSEARCH'] = "Deleting of the Custom Search with id '%1' failed!";
|
||||
$content['LN_SEARCH_ERROR_HASBEENDEL'] = "The Custom Search '%1' has been successfully deleted!";
|
||||
$content['LN_SEARCH_'] = "";
|
||||
|
||||
// Custom Searches center
|
||||
$content['LN_VIEWS_CENTER'] = "Views Options";
|
||||
$content['LN_VIEWS_ID'] = "ID";
|
||||
$content['LN_VIEWS_NAME'] = "View Name";
|
||||
$content['LN_VIEWS_COLUMNS'] = "View Columns";
|
||||
$content['LN_VIEWS_TYPE'] = "Assigned to";
|
||||
$content['LN_VIEWS_ADD'] = "Add new View";
|
||||
$content['LN_VIEWS_EDIT'] = "Edit View";
|
||||
$content['LN_VIEWS_ERROR_IDNOTFOUND'] = "A View with ID '%1' could not be found.";
|
||||
$content['LN_VIEWS_ERROR_INVALIDID'] = "The View with ID '%1' is not a valid View.";
|
||||
$content['LN_VIEWS_WARNDELETEVIEW'] = "Are you sure that you want to delete the View '%1'? This cannot be undone!";
|
||||
$content['LN_VIEWS_ERROR_DELSEARCH'] = "Deleting of the View with id '%1' failed!";
|
||||
$content['LN_VIEWS_ERROR_HASBEENDEL'] = "The View '%1' has been successfully deleted!";
|
||||
$content['LN_VIEWS_ADDEDIT'] = "Add / Edit a View";
|
||||
$content['LN_VIEWS_COLUMNLIST'] = "Configured Columns";
|
||||
$content['LN_VIEWS_ADDCOLUMN'] = "Add Column into list";
|
||||
$content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
||||
$content['LN_VIEWS_COLUMN'] = "Column";
|
||||
$content['LN_VIEWS_COLUMN_REMOVE'] = "Remove Column";
|
||||
$content['LN_VIEWS_HASBEENADDED'] = "The Custom View '%1' has been successfully added.";
|
||||
$content['LN_VIEWS_ERROR_NOCOLUMNS'] = "You need to add at least one column in order to add a new Custom View.";
|
||||
$content['LN_VIEWS_HASBEENEDIT'] = "The Custom Search '%1' has been successfully edited.";
|
||||
$content['LN_VIEWS_'] = "";
|
||||
|
||||
$content['LN_SOURCES_CENTER'] = "Sources Options";
|
||||
$content['LN_SOURCES_EDIT'] = "Edit Source";
|
||||
$content['LN_SOURCES_DELETE'] = "Delete Source";
|
||||
$content['LN_SOURCES_ID'] = "ID";
|
||||
$content['LN_SOURCES_NAME'] = "Source Name";
|
||||
$content['LN_SOURCES_TYPE'] = "Source Type";
|
||||
$content['LN_SOURCES_ASSIGNTO'] = "Assigned To";
|
||||
$content['LN_SOURCES_DISK'] = "Diskfile";
|
||||
$content['LN_SOURCES_DB'] = "MySQL Database";
|
||||
$content['LN_SOURCES_PDO'] = "PDO Datasource";
|
||||
$content['LN_SOURCES_ADD'] = "Add new Source";
|
||||
$content['LN_SOURCES_ADDEDIT'] = "Add / Edit a Source";
|
||||
$content['LN_SOURCES_TYPE'] = "Source Type";
|
||||
$content['LN_SOURCES_DISKTYPEOPTIONS'] = "Diskfile related Options";
|
||||
$content['LN_SOURCES_ERROR_MISSINGPARAM'] = "The paramater '%1' is missing.";
|
||||
$content['LN_SOURCES_ERROR_NOTAVALIDFILE'] = "Failed to open the syslog file '%1'! Check if the file exists and phplogcon has sufficient rights to it";
|
||||
$content['LN_SOURCES_ERROR_UNKNOWNSOURCE'] = "Unknown Source '%1' detected";
|
||||
$content['LN_SOURCE_HASBEENADDED'] = "The new Source '%1' has been successfully added.";
|
||||
$content['LN_SOURCES_EDIT'] = "Edit Source";
|
||||
$content['LN_SOURCES_ERROR_INVALIDORNOTFOUNDID'] = "The Source-ID is invalid or could not be found.";
|
||||
$content['LN_SOURCES_ERROR_IDNOTFOUND'] = "The Source-ID could not be found in the database.";
|
||||
$content['LN_SOURCES_HASBEENEDIT'] = "The Source '%1' has been successfully edited.";
|
||||
$content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete the Source '%1'? This cannot be undone!";
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_'] = "";
|
||||
|
||||
|
||||
?>
|
@ -56,6 +56,7 @@ $content['LN_GEN_SOURCE_DB'] = "Datenbank";
|
||||
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
|
||||
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
|
||||
$content['LN_GEN_SELECTVIEW'] = "Select View";
|
||||
$content['LN_GEN_CRITERROR_UNKNOWNTYPE'] = "The source type '%1' is not supported by phpLogCon yet. This is a critical error, please fix your configuration.";
|
||||
|
||||
// Topmenu Entries
|
||||
$content['LN_MENU_SEARCH'] = "Suchen";
|
||||
@ -172,4 +173,77 @@ $content['LN_DETAIL_BACKTOLIST'] = "Back to Listview";
|
||||
$content['LN_LOGIN_ERRWRONGPASSWORD'] = "Wrong username or password!";
|
||||
$content['LN_LOGIN_USERPASSMISSING'] = "Username or password not given";
|
||||
|
||||
// Install Site
|
||||
$content['LN_INSTALL_TITLETOP'] = "Installing phpLogCon Version %1 - Step %2";
|
||||
$content['LN_INSTALL_TITLE'] = "Installer Step %1";
|
||||
$content['LN_INSTALL_ERRORINSTALLED'] = 'phpLogCon is already configured!<br><br> If you want to reconfigure phpLogCon, either delete the current <B>config.php</B> or replace it with an empty file.<br><br>Click <A HREF="index.php">here</A> to return to pgpLogCon start page.';
|
||||
$content['LN_INSTALL_FILEORDIRNOTWRITEABLE'] = "At least one file or directory (or more) is not writeable, please check the file permissions (chmod 666)!";
|
||||
$content['LN_INSTALL_SAMPLECONFIGMISSING'] = "The sample configuration file '%1' is missing. You have not fully uploaded phplogcon.";
|
||||
$content['LN_INSTALL_ERRORCONNECTFAILED'] = "Database connect to '%1' failed! Please check Servername, Port, User and Password!";
|
||||
$content['LN_INSTALL_ERRORACCESSDENIED'] = "Cannot use the database '%1'! If the database does not exists, create it or check user access permissions!";
|
||||
$content['LN_INSTALL_ERRORINVALIDDBFILE'] = "Error, invalid Database definition file (to short!), the file name is '%1'! Please check if the file was correctly uploaded.";
|
||||
$content['LN_INSTALL_ERRORINSQLCOMMANDS'] = "Error, invalid Database definition file (no sql statements found!), the file name is '%1'!<br> Please check if the file was not correctly uploaded, or contact the phpLogCon forums for assistance!";
|
||||
$content['LN_INSTALL_MISSINGUSERNAME'] = "Username needs to be specified";
|
||||
$content['LN_INSTALL_PASSWORDNOTMATCH'] = "Either the password does not match or is to short!";
|
||||
$content['LN_INSTALL_FAILEDTOOPENSYSLOGFILE'] = "Failed to open the syslog file '%1'! Check if the file exists and phplogcon has sufficient rights to it<br>";
|
||||
$content['LN_INSTALL_FAILEDCREATECFGFILE'] = "Coult not create the configuration file in '%1'! Please verify the file permissions!";
|
||||
$content['LN_INSTALL_FAILEDREADINGFILE'] = "Error reading the file '%1'! Please verify if the file exists!";
|
||||
$content['LN_INSTALL_ERRORREADINGDBFILE'] = "Error reading the default database definition file in '%1'! Please verify if the file exists!";
|
||||
$content['LN_INSTALL_STEP1'] = "Step 1 - Prerequisites";
|
||||
$content['LN_INSTALL_STEP2'] = "Step 2 - Verify File Permissions";
|
||||
$content['LN_INSTALL_STEP3'] = "Step 3 - Basic Configuration";
|
||||
$content['LN_INSTALL_STEP4'] = "Step 4 - Create Tables";
|
||||
$content['LN_INSTALL_STEP5'] = "Step 5 - Check SQL Results";
|
||||
$content['LN_INSTALL_STEP6'] = "Step 6 - Creating the Main Useraccount";
|
||||
$content['LN_INSTALL_STEP7'] = "Step 7 - Create the first source for syslog messages";
|
||||
$content['LN_INSTALL_STEP8'] = "Step 8 - Done";
|
||||
$content['LN_INSTALL_STEP1_TEXT'] = 'Before you start installing phpLogCon, the Installer setup has to check a few things first.<br>You may have to correct some file permissions first. <br><br>Click on <input type="submit" value="Next"> to start the Test!';
|
||||
$content['LN_INSTALL_STEP2_TEXT'] = "The following file permissions have been checked. Verify the results below! <br>You may use the <B>configure.sh</B> script from the <B>contrib</B> folder to set the permissions for you.";
|
||||
$content['LN_INSTALL_STEP3_TEXT'] = "In this step, you configure the basic configurations for phpLogCon.";
|
||||
$content['LN_INSTALL_STEP4_TEXT'] = 'If you reached this step, the database connection has been successfully verified!<br><br> The next step will be to create the necessary database tables used by the phpLogCon User System. This might take a while!<br> <b>WARNING</b>, if you have an existing phpLogCon installation in this database with the same tableprefix, all your data will be <b>OVERWRITTEN</b>! Make sure you are using a fresh database, or you want to overwrite your old phpLogCon database. <br><br><b>Click on <input type="submit" value="Next"> to start the creation of the tables</b>';
|
||||
$content['LN_INSTALL_STEP5_TEXT'] = "Tables have been created. Check the List below for possible Error's";
|
||||
$content['LN_INSTALL_STEP6_TEXT'] = "You are now about to create the initial phpLogCon User Account.<br> This will be the first administrative user, which will be needed to login into phpLogCon and access the Admin Center!";
|
||||
$content['LN_INSTALL_STEP8_TEXT'] = 'Congratulations! You have successfully installed phpLogCon :)! <br><br>Click <a href="index.php">here</a> to go to your installation.';
|
||||
$content['LN_INSTALL_PROGRESS'] = "Install Progress: ";
|
||||
$content['LN_INSTALL_FRONTEND'] = "Frontend Options";
|
||||
$content['LN_INSTALL_NUMOFSYSLOGS'] = "Number of syslog messages per page";
|
||||
$content['LN_INSTALL_MSGCHARLIMIT'] = "Message character limit for the main view";
|
||||
$content['LN_INSTALL_SHOWDETAILPOP'] = "Show message details popup";
|
||||
$content['LN_INSTALL_AUTORESOLVIP'] = "Automatically resolved IP Addresses (inline)";
|
||||
$content['LN_INSTALL_USERDBOPTIONS'] = "User Database Options";
|
||||
$content['LN_INSTALL_ENABLEUSERDB'] = "Enable User Database";
|
||||
$content['LN_INSTALL_SUCCESSSTATEMENTS'] = "Successfully executed statements:";
|
||||
$content['LN_INSTALL_FAILEDSTATEMENTS'] = "Failed statements:";
|
||||
$content['LN_INSTALL_STEP5_TEXT_NEXT'] = "You can now proceed to the <B>next</B> step adding the first phpLogCon Admin User!";
|
||||
$content['LN_INSTALL_STEP5_TEXT_FAILED'] = "At least one statement failed,see error reasons below";
|
||||
$content['LN_INSTALL_ERRORMSG'] = "Error Message";
|
||||
$content['LN_INSTALL_SQLSTATEMENT'] = "SQL Statement";
|
||||
$content['LN_INSTALL_CREATEUSER'] = "Create User Account";
|
||||
$content['LN_INSTALL_PASSWORD'] = "Password";
|
||||
$content['LN_INSTALL_PASSWORDREPEAT'] = "Repeat Password";
|
||||
$content['LN_INSTALL_SUCCESSCREATED'] = "Successfully created User";
|
||||
$content['LN_INSTALL_RECHECK'] = "ReCheck";
|
||||
$content['LN_INSTALL_FINISH'] = "Finish!";
|
||||
$content['LN_INSTALL_'] = "";
|
||||
|
||||
// Converter Site
|
||||
$content['LN_CONVERT_TITLE'] = "Configuration Converter Step %1";
|
||||
$content['LN_CONVERT_NOTALLOWED'] = "Login";
|
||||
$content['LN_CONVERT_ERRORINSTALLED'] = 'phpLogCon is not allowed to convert your settings into the user database.<br><br> If you want to convert your convert your settings, add the variable following into your config.php: <br><b>$CFG[\'UserDBConvertAllowed\'] = true;</b><br><br> Click <A HREF="index.php">here</A> to return to pgpLogCon start page.';
|
||||
$content['LN_CONVERT_STEP1'] = "Step 1 - Informations";
|
||||
$content['LN_CONVERT_STEP2'] = "Step 2 - Create Tables";
|
||||
$content['LN_CONVERT_STEP3'] = "Step 3 - Check SQL Results";
|
||||
$content['LN_CONVERT_STEP4'] = "Step 4 - Creating the Main Useraccount";
|
||||
$content['LN_CONVERT_STEP5'] = "Step 5 - Import Settings into UserDB";
|
||||
$content['LN_CONVERT_TITLETOP'] = "Converting phpLogCon configuration settings - Step ";
|
||||
$content['LN_CONVERT_STEP1_TEXT'] = 'This script allows you to import your existing configuration from the <b>config.php</b> file. This includes frontend settings, data sources, custom views and custom searches. Do only perform this conversion if you did install phpLogCon without the UserDB System, and decided to enable it now. <br><br><b>ANY EXISTING INSTANCE OF A USERDB WILL BE OVERWRITTEN!</b><br><br><input type="submit" value="Click here"> to start the first conversion step!';
|
||||
$content['LN_CONVERT_STEP2_TEXT'] = 'The database connection has been successfully verified! <br><br>The next step will be to create the necessary database tables for the phpLogCon User System. This might take a while! <br><b>WARNING</b>, if you have an existing phpLogCon installation in this database with the same tableprefix, all your data will be <b>OVERWRITTEN</b>!<br> Make sure you are using a fresh database, or you want to overwrite your old phpLogCon database.<br><br><b>Click on <input type="submit" value="Next"> to start the creation of the tables</b>';
|
||||
$content['LN_CONVERT_STEP5_TEXT'] = '<input type="submit" value="Click here"> to start the last step of the conversion. In this step, your existing configuration from the <b>config.php</b> will be imported into the database.';
|
||||
$content['LN_CONVERT_STEP6'] = "Step 8 - Done";
|
||||
$content['LN_CONVERT_STEP6_TEXT'] = 'Congratulations! You have successfully converted your existing phpLogCon installation :)!<br><br>Important! Don\'t forget to REMOVE THE VARIABLES <b>$CFG[\'UserDBConvertAllowed\'] = true;</b> from your config.php file! <br><br>You can click <a href="index.php">here</a> to get to your phpLogConinstallation.';
|
||||
$content['LN_CONVERT_PROCESS'] = "Conversion Progress:";
|
||||
$content['LN_CONVERT_ERROR_SOURCEIMPORT'] = "Critical Error while importing the sources into the database, the SourceType '%1' is not supported by this phpLogCon Version.";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
?>
|
@ -155,7 +155,6 @@ $content['LN_SEARCH_WARNDELETESEARCH'] = "Are you sure that you want to delete t
|
||||
$content['LN_SEARCH_ERROR_DELSEARCH'] = "Deleting of the Custom Search with id '%1' failed!";
|
||||
$content['LN_SEARCH_ERROR_HASBEENDEL'] = "The Custom Search '%1' has been successfully deleted!";
|
||||
$content['LN_SEARCH_'] = "";
|
||||
$content['LN_SEARCH_'] = "";
|
||||
|
||||
// Custom Searches center
|
||||
$content['LN_VIEWS_CENTER'] = "Views Options";
|
||||
@ -180,7 +179,6 @@ $content['LN_VIEWS_HASBEENADDED'] = "The Custom View '%1' has been successfully
|
||||
$content['LN_VIEWS_ERROR_NOCOLUMNS'] = "You need to add at least one column in order to add a new Custom View.";
|
||||
$content['LN_VIEWS_HASBEENEDIT'] = "The Custom Search '%1' has been successfully edited.";
|
||||
$content['LN_VIEWS_'] = "";
|
||||
$content['LN_VIEWS_'] = "";
|
||||
|
||||
$content['LN_SOURCES_CENTER'] = "Sources Options";
|
||||
$content['LN_SOURCES_EDIT'] = "Edit Source";
|
||||
@ -208,7 +206,6 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_'] = "";
|
||||
$content['LN_SOURCES_'] = "";
|
||||
|
||||
|
||||
?>
|
211
src/lang/pt_BR/admin.php
Normal file
211
src/lang/pt_BR/admin.php
Normal file
@ -0,0 +1,211 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* -> www.phplogcon.org <-
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution.
|
||||
*********************************************************************
|
||||
*/
|
||||
global $content;
|
||||
|
||||
// Global Stuff
|
||||
$content['LN_ADMINMENU_HOMEPAGE'] = "Back to Show Events";
|
||||
$content['LN_ADMINMENU_GENOPT'] = "General Options";
|
||||
$content['LN_ADMINMENU_SOURCEOPT'] = "Sources Options";
|
||||
$content['LN_ADMINMENU_VIEWSOPT'] = "Views Options";
|
||||
$content['LN_ADMINMENU_SEARCHOPT'] = "Search Options";
|
||||
$content['LN_ADMINMENU_USEROPT'] = "User Options";
|
||||
$content['LN_ADMINMENU_GROUPOPT'] = "Group Options";
|
||||
$content['LN_ADMIN_CENTER'] = "Admin center";
|
||||
$content['LN_ADMIN_UNKNOWNSTATE'] = "Unknown State";
|
||||
$content['LN_ADMIN_ERROR_NOTALLOWED'] = "You are not allowed to access this page with your user level.";
|
||||
$content['LN_DELETEYES'] = "Yes";
|
||||
$content['LN_DELETENO'] = "No";
|
||||
$content['LN_GEN_ACTIONS'] = "Available Actions";
|
||||
$content['LN_ADMIN_SEND'] = "Send changes";
|
||||
$content['LN_GEN_USERONLY'] = "User only";
|
||||
$content['LN_GEN_GROUPONLY'] = "Group only";
|
||||
$content['LN_GEN_GLOBAL'] = "Global";
|
||||
$content['LN_GEN_USERONLY_LONG'] = "For me only <br>(Only available to your user)";
|
||||
$content['LN_GEN_GROUPONLY_LONG'] = "For this group <br>(Only available to the selected group)";
|
||||
$content['LN_GEN_GROUPONLYNAME'] = "Group '%1'";
|
||||
|
||||
|
||||
// General Options
|
||||
$content['LN_ADMIN_GLOBFRONTEND'] = "Global frontend options";
|
||||
$content['LN_ADMIN_USERFRONTEND'] = "User specific frontend options";
|
||||
$content['LN_ADMIN_MISC'] = "Miscellaneous Options";
|
||||
$content['LN_GEN_SHOWDEBUGMSG'] = "Show Debug messages";
|
||||
$content['LN_GEN_DEBUGGRIDCOUNTER'] = "Show Debug Gridcounter";
|
||||
$content['LN_GEN_SHOWPAGERENDERSTATS'] = "Show Pagerenderstats";
|
||||
$content['LN_GEN_ENABLEGZIP'] = "Enable GZIP Compressed Output";
|
||||
$content['LN_GEN_DEBUGUSERLOGIN'] = "Debug Userlogin";
|
||||
$content['LN_GEN_WEBSTYLE'] = "Default selected style";
|
||||
$content['LN_GEN_SELLANGUAGE'] = "Default selected language";
|
||||
$content['LN_GEN_PREPENDTITLE'] = "Prepend this string in title";
|
||||
$content['LN_GEN_USETODAY'] = "Use Today and Yesterday in timefields";
|
||||
$content['LN_GEN_DETAILPOPUPS'] = "Use Popup to display the full messagedetails";
|
||||
$content['LN_GEN_MSGCHARLIMIT'] = "Character limit of the message in main view";
|
||||
$content['LN_GEN_ENTRIESPERPAGE'] = "Number of entries per page";
|
||||
$content['LN_GEN_AUTORELOADSECONDS'] = "Enable autoreload after seconds";
|
||||
$content['LN_GEN_IPADRRESOLVE'] = "Resolve IP Addresses using DNS";
|
||||
$content['LN_GEN_CUSTBTNCAPT'] = "Custom search caption";
|
||||
$content['LN_GEN_CUSTBTNSRCH'] = "Custom search string";
|
||||
$content['LN_GEN_SUCCESSFULLYSAVED'] = "The configuration Values have been successfully saved";
|
||||
$content['LN_GEN_INTERNAL'] = "Internal";
|
||||
$content['LN_GEN_DISABLED'] = "Function disabled";
|
||||
$content['LN_GEN_CONFIGFILE'] = "Configuration File";
|
||||
$content['LN_GEN_ACCESSDENIED'] = "Access denied to this function";
|
||||
|
||||
// User Center
|
||||
$content['LN_USER_CENTER'] = "User Options";
|
||||
$content['LN_USER_ID'] = "ID";
|
||||
$content['LN_USER_NAME'] = "Username";
|
||||
$content['LN_USER_ADD'] = "Add User";
|
||||
$content['LN_USER_EDIT'] = "Edit User";
|
||||
$content['LN_USER_DELETE'] = "Delete User";
|
||||
$content['LN_USER_PASSWORD1'] = "Password";
|
||||
$content['LN_USER_PASSWORD2'] = "Confirm Password";
|
||||
$content['LN_USER_ERROR_IDNOTFOUND'] = "Error, User with ID '%1' , was not found";
|
||||
$content['LN_USER_ERROR_DONOTDELURSLF'] = "Error, you can not DELETE YOURSELF!";
|
||||
$content['LN_USER_ERROR_DELUSER'] = "Deleting of the user with id '%1' failed!";
|
||||
$content['LN_USER_ERROR_INVALIDID'] = "Error, invalid ID, User not found";
|
||||
$content['LN_USER_ERROR_HASBEENDEL'] = "The User '%1' has been successfully deleted!";
|
||||
$content['LN_USER_ERROR_USEREMPTY'] = "Error, Username was empty";
|
||||
$content['LN_USER_ERROR_USERNAMETAKEN'] = "Error, this Username is already taken!";
|
||||
$content['LN_USER_ERROR_PASSSHORT'] = "Error, Password was to short, or did not match";
|
||||
$content['LN_USER_ERROR_HASBEENADDED'] = "User '%1' has been successfully added";
|
||||
$content['LN_USER_ERROR_HASBEENEDIT'] = "User '%1' has been successfully edited";
|
||||
$content['LN_USER_ISADMIN'] = "Is Admin?";
|
||||
$content['LN_USER_ADDEDIT'] = "Add/Edit User";
|
||||
$content['LN_USER_WARNREMOVEADMIN'] = "You are about to revoke your own administrative priviledges. Are you sure to remove your admin status?";
|
||||
$content['LN_USER_WARNDELETEUSER'] = "Are you sure that you want to delete the User '%1'? All his personal settings will be deleted as well.";
|
||||
$content['LN_USER_ERROR_INVALIDSESSIONS'] = "Invalid User Session.";
|
||||
$content['LN_USER_'] = "";
|
||||
|
||||
// Group center
|
||||
$content['LN_GROUP_CENTER'] = "Group Center";
|
||||
$content['LN_GROUP_ID'] = "ID";
|
||||
$content['LN_GROUP_NAME'] = "Groupname";
|
||||
$content['LN_GROUP_DESCRIPTION'] = "Groupdescription";
|
||||
$content['LN_GROUP_TYPE'] = "Grouptype";
|
||||
$content['LN_GROUP_ADD'] = "Add Group";
|
||||
$content['LN_GROUP_EDIT'] = "Edit Group";
|
||||
$content['LN_GROUP_DELETE'] = "Delete Group";
|
||||
$content['LN_GROUP_NOGROUPS'] = "No groups have been added yet";
|
||||
$content['LN_GROUP_ADDEDIT'] = "Add/Edit Group";
|
||||
$content['LN_GROUP_ERROR_GROUPEMPTY'] = "The groupname cannot be empty.";
|
||||
$content['LN_GROUP_ERROR_GROUPNAMETAKEN'] = "The groupname has already been taken.";
|
||||
$content['LN_GROUP_HASBEENADDED'] = "The group '%1' has been successfully added.";
|
||||
$content['LN_GROUP_ERROR_IDNOTFOUND'] = "The group with ID '%1' could not be found.";
|
||||
$content['LN_GROUP_ERROR_HASBEENEDIT'] = "The group '%1' has been successfully edited.";
|
||||
$content['LN_GROUP_ERROR_INVALIDGROUP'] = "Error, invalid ID, Group not found";
|
||||
$content['LN_GROUP_WARNDELETEGROUP'] = "Are you sure that you want to delete the Group '%1'? All Groupsettings will be deleted as well.";
|
||||
$content['LN_GROUP_ERROR_DELGROUP'] = "Deleting of the group with id '%1' failed!";
|
||||
$content['LN_GROUP_ERROR_HASBEENDEL'] = "The Group '%1' has been successfully deleted!";
|
||||
$content['LN_GROUP_MEMBERS'] = "Groupmembers: ";
|
||||
$content['LN_GROUP_ADDUSER'] = "Add User to Group";
|
||||
$content['LN_GROUP_ERROR_USERIDMISSING'] = "The userid is missing.";
|
||||
$content['LN_GROUP_USERHASBEENADDEDGROUP'] = "The User '%1' has been successfully added to group '%2'";
|
||||
$content['LN_GROUP_ERRORNOMOREUSERS'] = "There are no more available users who can be added to the group '%1'";
|
||||
$content['LN_GROUP_USER_ADD'] = "Add User to the group";
|
||||
$content['LN_GROUP_USERDELETE'] = "Remove a User from the group";
|
||||
$content['LN_GROUP_ERRORNOUSERSINGROUP'] = "There are no users to remove in this the group '%1'";
|
||||
$content['LN_GROUP_ERROR_REMUSERFROMGROUP'] = "The user '%1' could not be removed from the group '%2'";
|
||||
$content['LN_GROUP_USERHASBEENREMOVED'] = "The user '%1' has been successfully removed from the group '%2'";
|
||||
$content['LN_GROUP_'] = "";
|
||||
|
||||
// Custom Searches center
|
||||
$content['LN_SEARCH_CENTER'] = "Custom Searches";
|
||||
$content['LN_SEARCH_ADD'] = "Add new Custom Search";
|
||||
$content['LN_SEARCH_ID'] = "ID";
|
||||
$content['LN_SEARCH_NAME'] = "Search Name";
|
||||
$content['LN_SEARCH_QUERY'] = "Search Query";
|
||||
$content['LN_SEARCH_TYPE'] = "Assigned to";
|
||||
$content['LN_SEARCH_EDIT'] = "Edit Custom Search";
|
||||
$content['LN_SEARCH_DELETE'] = "Delete Custom Search";
|
||||
$content['LN_SEARCH_ADDEDIT'] = "Add / Edit a Custom Search";
|
||||
$content['LN_SEARCH_SELGROUPENABLE'] = ">> Select Group to enable <<";
|
||||
$content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
||||
$content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'] = "The SearchQuery cannot be empty.";
|
||||
$content['LN_SEARCH_HASBEENADDED'] = "The Custom Search '%1' has been successfully added.";
|
||||
$content['LN_SEARCH_ERROR_IDNOTFOUND'] = "Could not find a search with ID '%1'.";
|
||||
$content['LN_SEARCH_ERROR_INVALIDID'] = "Invalid search ID.";
|
||||
$content['LN_SEARCH_HASBEENEDIT'] = "The Custom Search '%1' has been successfully edited.";
|
||||
$content['LN_SEARCH_WARNDELETESEARCH'] = "Are you sure that you want to delete the Custom Search '%1'? This cannot be undone!";
|
||||
$content['LN_SEARCH_ERROR_DELSEARCH'] = "Deleting of the Custom Search with id '%1' failed!";
|
||||
$content['LN_SEARCH_ERROR_HASBEENDEL'] = "The Custom Search '%1' has been successfully deleted!";
|
||||
$content['LN_SEARCH_'] = "";
|
||||
|
||||
// Custom Searches center
|
||||
$content['LN_VIEWS_CENTER'] = "Views Options";
|
||||
$content['LN_VIEWS_ID'] = "ID";
|
||||
$content['LN_VIEWS_NAME'] = "View Name";
|
||||
$content['LN_VIEWS_COLUMNS'] = "View Columns";
|
||||
$content['LN_VIEWS_TYPE'] = "Assigned to";
|
||||
$content['LN_VIEWS_ADD'] = "Add new View";
|
||||
$content['LN_VIEWS_EDIT'] = "Edit View";
|
||||
$content['LN_VIEWS_ERROR_IDNOTFOUND'] = "A View with ID '%1' could not be found.";
|
||||
$content['LN_VIEWS_ERROR_INVALIDID'] = "The View with ID '%1' is not a valid View.";
|
||||
$content['LN_VIEWS_WARNDELETEVIEW'] = "Are you sure that you want to delete the View '%1'? This cannot be undone!";
|
||||
$content['LN_VIEWS_ERROR_DELSEARCH'] = "Deleting of the View with id '%1' failed!";
|
||||
$content['LN_VIEWS_ERROR_HASBEENDEL'] = "The View '%1' has been successfully deleted!";
|
||||
$content['LN_VIEWS_ADDEDIT'] = "Add / Edit a View";
|
||||
$content['LN_VIEWS_COLUMNLIST'] = "Configured Columns";
|
||||
$content['LN_VIEWS_ADDCOLUMN'] = "Add Column into list";
|
||||
$content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
||||
$content['LN_VIEWS_COLUMN'] = "Column";
|
||||
$content['LN_VIEWS_COLUMN_REMOVE'] = "Remove Column";
|
||||
$content['LN_VIEWS_HASBEENADDED'] = "The Custom View '%1' has been successfully added.";
|
||||
$content['LN_VIEWS_ERROR_NOCOLUMNS'] = "You need to add at least one column in order to add a new Custom View.";
|
||||
$content['LN_VIEWS_HASBEENEDIT'] = "The Custom Search '%1' has been successfully edited.";
|
||||
$content['LN_VIEWS_'] = "";
|
||||
|
||||
$content['LN_SOURCES_CENTER'] = "Sources Options";
|
||||
$content['LN_SOURCES_EDIT'] = "Edit Source";
|
||||
$content['LN_SOURCES_DELETE'] = "Delete Source";
|
||||
$content['LN_SOURCES_ID'] = "ID";
|
||||
$content['LN_SOURCES_NAME'] = "Source Name";
|
||||
$content['LN_SOURCES_TYPE'] = "Source Type";
|
||||
$content['LN_SOURCES_ASSIGNTO'] = "Assigned To";
|
||||
$content['LN_SOURCES_DISK'] = "Diskfile";
|
||||
$content['LN_SOURCES_DB'] = "MySQL Database";
|
||||
$content['LN_SOURCES_PDO'] = "PDO Datasource";
|
||||
$content['LN_SOURCES_ADD'] = "Add new Source";
|
||||
$content['LN_SOURCES_ADDEDIT'] = "Add / Edit a Source";
|
||||
$content['LN_SOURCES_TYPE'] = "Source Type";
|
||||
$content['LN_SOURCES_DISKTYPEOPTIONS'] = "Diskfile related Options";
|
||||
$content['LN_SOURCES_ERROR_MISSINGPARAM'] = "The paramater '%1' is missing.";
|
||||
$content['LN_SOURCES_ERROR_NOTAVALIDFILE'] = "Failed to open the syslog file '%1'! Check if the file exists and phplogcon has sufficient rights to it";
|
||||
$content['LN_SOURCES_ERROR_UNKNOWNSOURCE'] = "Unknown Source '%1' detected";
|
||||
$content['LN_SOURCE_HASBEENADDED'] = "The new Source '%1' has been successfully added.";
|
||||
$content['LN_SOURCES_EDIT'] = "Edit Source";
|
||||
$content['LN_SOURCES_ERROR_INVALIDORNOTFOUNDID'] = "The Source-ID is invalid or could not be found.";
|
||||
$content['LN_SOURCES_ERROR_IDNOTFOUND'] = "The Source-ID could not be found in the database.";
|
||||
$content['LN_SOURCES_HASBEENEDIT'] = "The Source '%1' has been successfully edited.";
|
||||
$content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete the Source '%1'? This cannot be undone!";
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_'] = "";
|
||||
|
||||
|
||||
?>
|
@ -61,6 +61,7 @@ $content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
|
||||
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
|
||||
$content['LN_GEN_SELECTVIEW'] = "Visão";
|
||||
$content['LN_GEN_CRITERROR_UNKNOWNTYPE'] = "The source type '%1' is not supported by phpLogCon yet. This is a critical error, please fix your configuration.";
|
||||
$content['LN_GEN_CRITERROR_UNKNOWNTYPE'] = "The source type '%1' is not supported by phpLogCon yet. This is a critical error, please fix your configuration.";
|
||||
|
||||
// Topmenu Entries
|
||||
$content['LN_MENU_SEARCH'] = "Search";
|
||||
@ -177,4 +178,77 @@ $content['LN_DETAIL_BACKTOLIST'] = "Voltar para a lista";
|
||||
$content['LN_LOGIN_ERRWRONGPASSWORD'] = "Wrong username or password!";
|
||||
$content['LN_LOGIN_USERPASSMISSING'] = "Username or password not given";
|
||||
|
||||
// Install Site
|
||||
$content['LN_INSTALL_TITLETOP'] = "Installing phpLogCon Version %1 - Step %2";
|
||||
$content['LN_INSTALL_TITLE'] = "Installer Step %1";
|
||||
$content['LN_INSTALL_ERRORINSTALLED'] = 'phpLogCon is already configured!<br><br> If you want to reconfigure phpLogCon, either delete the current <B>config.php</B> or replace it with an empty file.<br><br>Click <A HREF="index.php">here</A> to return to pgpLogCon start page.';
|
||||
$content['LN_INSTALL_FILEORDIRNOTWRITEABLE'] = "At least one file or directory (or more) is not writeable, please check the file permissions (chmod 666)!";
|
||||
$content['LN_INSTALL_SAMPLECONFIGMISSING'] = "The sample configuration file '%1' is missing. You have not fully uploaded phplogcon.";
|
||||
$content['LN_INSTALL_ERRORCONNECTFAILED'] = "Database connect to '%1' failed! Please check Servername, Port, User and Password!";
|
||||
$content['LN_INSTALL_ERRORACCESSDENIED'] = "Cannot use the database '%1'! If the database does not exists, create it or check user access permissions!";
|
||||
$content['LN_INSTALL_ERRORINVALIDDBFILE'] = "Error, invalid Database definition file (to short!), the file name is '%1'! Please check if the file was correctly uploaded.";
|
||||
$content['LN_INSTALL_ERRORINSQLCOMMANDS'] = "Error, invalid Database definition file (no sql statements found!), the file name is '%1'!<br> Please check if the file was not correctly uploaded, or contact the phpLogCon forums for assistance!";
|
||||
$content['LN_INSTALL_MISSINGUSERNAME'] = "Username needs to be specified";
|
||||
$content['LN_INSTALL_PASSWORDNOTMATCH'] = "Either the password does not match or is to short!";
|
||||
$content['LN_INSTALL_FAILEDTOOPENSYSLOGFILE'] = "Failed to open the syslog file '%1'! Check if the file exists and phplogcon has sufficient rights to it<br>";
|
||||
$content['LN_INSTALL_FAILEDCREATECFGFILE'] = "Coult not create the configuration file in '%1'! Please verify the file permissions!";
|
||||
$content['LN_INSTALL_FAILEDREADINGFILE'] = "Error reading the file '%1'! Please verify if the file exists!";
|
||||
$content['LN_INSTALL_ERRORREADINGDBFILE'] = "Error reading the default database definition file in '%1'! Please verify if the file exists!";
|
||||
$content['LN_INSTALL_STEP1'] = "Step 1 - Prerequisites";
|
||||
$content['LN_INSTALL_STEP2'] = "Step 2 - Verify File Permissions";
|
||||
$content['LN_INSTALL_STEP3'] = "Step 3 - Basic Configuration";
|
||||
$content['LN_INSTALL_STEP4'] = "Step 4 - Create Tables";
|
||||
$content['LN_INSTALL_STEP5'] = "Step 5 - Check SQL Results";
|
||||
$content['LN_INSTALL_STEP6'] = "Step 6 - Creating the Main Useraccount";
|
||||
$content['LN_INSTALL_STEP7'] = "Step 7 - Create the first source for syslog messages";
|
||||
$content['LN_INSTALL_STEP8'] = "Step 8 - Done";
|
||||
$content['LN_INSTALL_STEP1_TEXT'] = 'Before you start installing phpLogCon, the Installer setup has to check a few things first.<br>You may have to correct some file permissions first. <br><br>Click on <input type="submit" value="Next"> to start the Test!';
|
||||
$content['LN_INSTALL_STEP2_TEXT'] = "The following file permissions have been checked. Verify the results below! <br>You may use the <B>configure.sh</B> script from the <B>contrib</B> folder to set the permissions for you.";
|
||||
$content['LN_INSTALL_STEP3_TEXT'] = "In this step, you configure the basic configurations for phpLogCon.";
|
||||
$content['LN_INSTALL_STEP4_TEXT'] = 'If you reached this step, the database connection has been successfully verified!<br><br> The next step will be to create the necessary database tables used by the phpLogCon User System. This might take a while!<br> <b>WARNING</b>, if you have an existing phpLogCon installation in this database with the same tableprefix, all your data will be <b>OVERWRITTEN</b>! Make sure you are using a fresh database, or you want to overwrite your old phpLogCon database. <br><br><b>Click on <input type="submit" value="Next"> to start the creation of the tables</b>';
|
||||
$content['LN_INSTALL_STEP5_TEXT'] = "Tables have been created. Check the List below for possible Error's";
|
||||
$content['LN_INSTALL_STEP6_TEXT'] = "You are now about to create the initial phpLogCon User Account.<br> This will be the first administrative user, which will be needed to login into phpLogCon and access the Admin Center!";
|
||||
$content['LN_INSTALL_STEP8_TEXT'] = 'Congratulations! You have successfully installed phpLogCon :)! <br><br>Click <a href="index.php">here</a> to go to your installation.';
|
||||
$content['LN_INSTALL_PROGRESS'] = "Install Progress: ";
|
||||
$content['LN_INSTALL_FRONTEND'] = "Frontend Options";
|
||||
$content['LN_INSTALL_NUMOFSYSLOGS'] = "Number of syslog messages per page";
|
||||
$content['LN_INSTALL_MSGCHARLIMIT'] = "Message character limit for the main view";
|
||||
$content['LN_INSTALL_SHOWDETAILPOP'] = "Show message details popup";
|
||||
$content['LN_INSTALL_AUTORESOLVIP'] = "Automatically resolved IP Addresses (inline)";
|
||||
$content['LN_INSTALL_USERDBOPTIONS'] = "User Database Options";
|
||||
$content['LN_INSTALL_ENABLEUSERDB'] = "Enable User Database";
|
||||
$content['LN_INSTALL_SUCCESSSTATEMENTS'] = "Successfully executed statements:";
|
||||
$content['LN_INSTALL_FAILEDSTATEMENTS'] = "Failed statements:";
|
||||
$content['LN_INSTALL_STEP5_TEXT_NEXT'] = "You can now proceed to the <B>next</B> step adding the first phpLogCon Admin User!";
|
||||
$content['LN_INSTALL_STEP5_TEXT_FAILED'] = "At least one statement failed,see error reasons below";
|
||||
$content['LN_INSTALL_ERRORMSG'] = "Error Message";
|
||||
$content['LN_INSTALL_SQLSTATEMENT'] = "SQL Statement";
|
||||
$content['LN_INSTALL_CREATEUSER'] = "Create User Account";
|
||||
$content['LN_INSTALL_PASSWORD'] = "Password";
|
||||
$content['LN_INSTALL_PASSWORDREPEAT'] = "Repeat Password";
|
||||
$content['LN_INSTALL_SUCCESSCREATED'] = "Successfully created User";
|
||||
$content['LN_INSTALL_RECHECK'] = "ReCheck";
|
||||
$content['LN_INSTALL_FINISH'] = "Finish!";
|
||||
$content['LN_INSTALL_'] = "";
|
||||
|
||||
// Converter Site
|
||||
$content['LN_CONVERT_TITLE'] = "Configuration Converter Step %1";
|
||||
$content['LN_CONVERT_NOTALLOWED'] = "Login";
|
||||
$content['LN_CONVERT_ERRORINSTALLED'] = 'phpLogCon is not allowed to convert your settings into the user database.<br><br> If you want to convert your convert your settings, add the variable following into your config.php: <br><b>$CFG[\'UserDBConvertAllowed\'] = true;</b><br><br> Click <A HREF="index.php">here</A> to return to pgpLogCon start page.';
|
||||
$content['LN_CONVERT_STEP1'] = "Step 1 - Informations";
|
||||
$content['LN_CONVERT_STEP2'] = "Step 2 - Create Tables";
|
||||
$content['LN_CONVERT_STEP3'] = "Step 3 - Check SQL Results";
|
||||
$content['LN_CONVERT_STEP4'] = "Step 4 - Creating the Main Useraccount";
|
||||
$content['LN_CONVERT_STEP5'] = "Step 5 - Import Settings into UserDB";
|
||||
$content['LN_CONVERT_TITLETOP'] = "Converting phpLogCon configuration settings - Step ";
|
||||
$content['LN_CONVERT_STEP1_TEXT'] = 'This script allows you to import your existing configuration from the <b>config.php</b> file. This includes frontend settings, data sources, custom views and custom searches. Do only perform this conversion if you did install phpLogCon without the UserDB System, and decided to enable it now. <br><br><b>ANY EXISTING INSTANCE OF A USERDB WILL BE OVERWRITTEN!</b><br><br><input type="submit" value="Click here"> to start the first conversion step!';
|
||||
$content['LN_CONVERT_STEP2_TEXT'] = 'The database connection has been successfully verified! <br><br>The next step will be to create the necessary database tables for the phpLogCon User System. This might take a while! <br><b>WARNING</b>, if you have an existing phpLogCon installation in this database with the same tableprefix, all your data will be <b>OVERWRITTEN</b>!<br> Make sure you are using a fresh database, or you want to overwrite your old phpLogCon database.<br><br><b>Click on <input type="submit" value="Next"> to start the creation of the tables</b>';
|
||||
$content['LN_CONVERT_STEP5_TEXT'] = '<input type="submit" value="Click here"> to start the last step of the conversion. In this step, your existing configuration from the <b>config.php</b> will be imported into the database.';
|
||||
$content['LN_CONVERT_STEP6'] = "Step 8 - Done";
|
||||
$content['LN_CONVERT_STEP6_TEXT'] = 'Congratulations! You have successfully converted your existing phpLogCon installation :)!<br><br>Important! Don\'t forget to REMOVE THE VARIABLES <b>$CFG[\'UserDBConvertAllowed\'] = true;</b> from your config.php file! <br><br>You can click <a href="index.php">here</a> to get to your phpLogConinstallation.';
|
||||
$content['LN_CONVERT_PROCESS'] = "Conversion Progress:";
|
||||
$content['LN_CONVERT_ERROR_SOURCEIMPORT'] = "Critical Error while importing the sources into the database, the SourceType '%1' is not supported by this phpLogCon Version.";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
$content['LN_CONVERT_'] = "";
|
||||
?>
|
220
src/login.php
220
src/login.php
@ -1,111 +1,111 @@
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Main Index File
|
||||
*
|
||||
* -> File to login users in PhpLogCon
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
//include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// To avoid infinite redirects!
|
||||
define('IS_NOLOGINPAGE', true);
|
||||
$content['IS_NOLOGINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
// --- //
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Set Defaults
|
||||
$content['uname'] = "";
|
||||
$content['pass'] = "";
|
||||
|
||||
// Set Referer
|
||||
if ( isset($_GET['referer']) )
|
||||
$szRedir = $_GET['referer'];
|
||||
else if ( isset($_POST['referer']) )
|
||||
$szRedir = $_POST['referer'];
|
||||
else
|
||||
$szRedir = "index.php"; // Default
|
||||
|
||||
if ( isset($_POST['op']) && $_POST['op'] == "login" )
|
||||
{
|
||||
// Perform login!
|
||||
if ( $_POST['op'] == "login" )
|
||||
{
|
||||
if (
|
||||
(isset($_POST['uname']) && strlen($_POST['uname']) > 0)
|
||||
&&
|
||||
(isset($_POST['pass']) && strlen($_POST['pass']) > 0)
|
||||
)
|
||||
{
|
||||
// Set Username and password
|
||||
$content['uname'] = DB_RemoveBadChars($_POST['uname']);
|
||||
$content['pass'] = DB_RemoveBadChars($_POST['pass']);
|
||||
|
||||
if ( !CheckUserLogin( $content['uname'], $content['pass']) )
|
||||
{
|
||||
$content['ISERROR'] = "true";
|
||||
$content['ERROR_MSG'] = $content['LN_LOGIN_ERRWRONGPASSWORD'];
|
||||
}
|
||||
else
|
||||
RedirectPage( urldecode($szRedir) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = "true";
|
||||
$content['ERROR_MSG'] = $content['LN_LOGIN_USERPASSMISSING'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( isset($_GET['op']) && $_GET['op'] == "logoff" )
|
||||
{
|
||||
// logoff in this case
|
||||
DoLogOff();
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- CONTENT Vars
|
||||
$content['REDIR_LOGIN'] = $szRedir;
|
||||
$content['TITLE'] = "phpLogCon - User Login"; // Title of the Page
|
||||
// ---
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "login.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
<?php
|
||||
/*
|
||||
*********************************************************************
|
||||
* phpLogCon - http://www.phplogcon.org
|
||||
* -----------------------------------------------------------------
|
||||
* Main Index File
|
||||
*
|
||||
* -> File to login users in PhpLogCon
|
||||
*
|
||||
* All directives are explained within this file
|
||||
*
|
||||
* Copyright (C) 2008 Adiscon GmbH.
|
||||
*
|
||||
* This file is part of phpLogCon.
|
||||
*
|
||||
* PhpLogCon 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpLogCon is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
// *** Default includes and procedures *** //
|
||||
define('IN_PHPLOGCON', true);
|
||||
$gl_root_path = './';
|
||||
|
||||
// Now include necessary include files!
|
||||
include($gl_root_path . 'include/functions_common.php');
|
||||
include($gl_root_path . 'include/functions_frontendhelpers.php');
|
||||
//include($gl_root_path . 'include/functions_filters.php');
|
||||
|
||||
// To avoid infinite redirects!
|
||||
define('IS_NOLOGINPAGE', true);
|
||||
$content['IS_NOLOGINPAGE'] = true;
|
||||
InitPhpLogCon();
|
||||
// --- //
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Set Defaults
|
||||
$content['uname'] = "";
|
||||
$content['pass'] = "";
|
||||
|
||||
// Set Referer
|
||||
if ( isset($_GET['referer']) )
|
||||
$szRedir = $_GET['referer'];
|
||||
else if ( isset($_POST['referer']) )
|
||||
$szRedir = $_POST['referer'];
|
||||
else
|
||||
$szRedir = "index.php"; // Default
|
||||
|
||||
if ( isset($_POST['op']) && $_POST['op'] == "login" )
|
||||
{
|
||||
// Perform login!
|
||||
if ( $_POST['op'] == "login" )
|
||||
{
|
||||
if (
|
||||
(isset($_POST['uname']) && strlen($_POST['uname']) > 0)
|
||||
&&
|
||||
(isset($_POST['pass']) && strlen($_POST['pass']) > 0)
|
||||
)
|
||||
{
|
||||
// Set Username and password
|
||||
$content['uname'] = DB_RemoveBadChars($_POST['uname']);
|
||||
$content['pass'] = DB_RemoveBadChars($_POST['pass']);
|
||||
|
||||
if ( !CheckUserLogin( $content['uname'], $content['pass']) )
|
||||
{
|
||||
$content['ISERROR'] = "true";
|
||||
$content['ERROR_MSG'] = $content['LN_LOGIN_ERRWRONGPASSWORD'];
|
||||
}
|
||||
else
|
||||
RedirectPage( urldecode($szRedir) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = "true";
|
||||
$content['ERROR_MSG'] = $content['LN_LOGIN_USERPASSMISSING'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( isset($_GET['op']) && $_GET['op'] == "logoff" )
|
||||
{
|
||||
// logoff in this case
|
||||
DoLogOff();
|
||||
}
|
||||
// --- END Custom Code
|
||||
|
||||
// --- CONTENT Vars
|
||||
$content['REDIR_LOGIN'] = $szRedir;
|
||||
$content['TITLE'] = "phpLogCon - User Login"; // Title of the Page
|
||||
// ---
|
||||
|
||||
// --- Parsen and Output
|
||||
InitTemplateParser();
|
||||
$page -> parser($content, "login.html");
|
||||
$page -> output();
|
||||
// ---
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user