1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 10:20:45 +02:00

admin/userclass.php and admin/userinfo.php now included in admin/users.php. deprecated files and their language files removed.

This commit is contained in:
CaMer0n
2009-08-05 16:02:09 +00:00
parent 78707765b9
commit 09be59c9d8
6 changed files with 71 additions and 251 deletions

View File

@@ -1,138 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/userclass.php,v $
| $Revision: 1.4 $
| $Date: 2008-04-04 21:03:27 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
if (!e_QUERY)
{
header("location:".e_ADMIN."admin.php");
exit;
}
else
{
$qs = explode(".", e_QUERY);
$id = intval($qs[0]);
}
require_once(e_HANDLER."userclass_class.php"); // Modified class handler
$e_userclass = new user_class;
if (isset($_POST['updateclass']))
{
$remuser = TRUE;
$classcount = count($_POST['userclass']);
$spacer = '';
foreach ($_POST['userclass'] as $a)
{
$a = intval($a);
check_allowed($a);
$svar .= $spacer.$a;
$spacer = ',';
}
$sql->db_Update("user", "user_class='{$svar}' WHERE user_id={$id} ");
$message = UCSLAN_9;
if ($_POST['notifyuser'])
{
$sql->db_Select("user", "*", "user_id={$id} ");
$row = $sql->db_Fetch();
$message .= "<br />".UCSLAN_1.":</b> ".$row['user_name']."<br />";
require_once(e_HANDLER."mail.php");
$messaccess = '';
foreach (explode(',',$row['user_class']) as $a)
{
if (!isset($e_userclass->fixed_classes[$a]))
{
$messaccess .= $e_userclass->class_tree[$a]['userclass_name']." - " . $e_userclass->class_tree[$a]['userclass_description']. "\n";
}
}
if ($messaccess == '') $messaccess = UCSLAN_12."\n";
$send_to = $row['user_email'];
$subject = UCSLAN_2;
$message = UCSLAN_3." " . $row['user_name']. ",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL . " )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_10."\n".SITEADMIN."\n( ".SITENAME." )";
// $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","User class change",str_replace("\n","<br />",$message),FALSE,LOG_TO_ROLLING);
sendemail($send_to, $subject, $message);
}
$admin_log->log_event('USET_14',str_replace(array('--UID--','--CLASSES--'),array($id,$svar),UCSLAN_11),E_LOG_INFORMATIVE);
header("location: ".$_POST['adminreturn']);
echo "location redirect failed.";
exit;
}
$e_sub_cat = 'userclass';
require_once("auth.php");
$sql->db_Select("user", "*", "user_id={$id} ");
$row = $sql->db_Fetch();
$caption = UCSLAN_6." <b>".$row['user_name']."</b> (".$row['user_class'].")";
$text = " <div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr><td class='forumheader3'>";
$text .= $e_userclass->vetted_tree('userclass',array($e_userclass,'checkbox_desc'), $row['user_class'], 'classes');
$text .= '</td></tr>';
$adminreturn = e_ADMIN."users.php?cu".($qs[2] ? ".{$qs[2]}.{$qs[3]}.{$qs[4]}" : "");
$text .= " <tr><td class='forumheader' style='text-align:center'>
<input type='hidden' name='adminreturn' value='{$adminreturn}' />
<input type='checkbox' name='notifyuser' value='1' /> ".UCSLAN_8."&nbsp;&nbsp;
<input class='button' type='submit' name='updateclass' value='".UCSLAN_7."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender($caption, $text);
require_once("footer.php");
// ----------------------------------------------------------
function check_allowed($class_id)
{
global $e_userclass;
if (!isset($e_userclass->class_tree[$class_id]))
{
header("location:".SITEURL);
exit;
}
if (!getperms("0") && !check_class($e_userclass->class_tree[$class_id]['userclass_editclass']))
{
header("location:".SITEURL);
exit;
}
return TRUE;
}
?>

View File

@@ -1,71 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/userinfo.php,v $
| $Revision: 1.2 $
| $Date: 2007-12-09 16:42:22 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'users';
require_once("auth.php");
if (!e_QUERY) {
$text = "<div style=\"text-align:center\">".USFLAN_1."</div>";
$ns->tablerender(LAN_ERROR, $text);
require_once("footer.php");
exit;
} else {
$ipd = e_QUERY;
}
if (isset($ipd)) {
if(!defined("BULLET")) define("BULLET", "bullet2.gif");
$obj = new convert;
$sql->db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
$host = $e107->get_host_name($ipd);
$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
<i><a href=\"banlist.php?add-".$ipd."\">".USFLAN_5."</a></i>
<br /><br />";
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->db_Fetch()) {
$datestamp = $obj->convert_date($cb_datestamp, "short");
$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
$post_author_name = substr($cb_nick, (strpos($cb_nick, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $cb_message."
</div><br />";
}
$text .= "<hr />";
$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->db_Fetch()) {
$datestamp = $obj->convert_date($comment_datestamp, "short");
$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
$post_author_name = substr($comment_author, (strpos($comment_author, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $comment_comment."</div><br />";
}
}
$ns->tablerender(USFLAN_7, $text);
require_once("footer.php");
?>

View File

@@ -10,8 +10,8 @@
* Administration Area - Users * Administration Area - Users
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
* $Revision: 1.47 $ * $Revision: 1.48 $
* $Date: 2009-08-03 16:43:46 $ * $Date: 2009-08-05 16:02:08 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -35,11 +35,11 @@ if (varset($_POST['useraction']))
} }
} }
} }
if (isset ($_POST['useraction']) && $_POST['useraction'] == 'userinfo') /*if (isset ($_POST['useraction']) && $_POST['useraction'] == 'userinfo')
{ {
header('location:'.e_ADMIN."userinfo.php?".$e107->tp->toDB($_POST['userip'])); header('location:'.e_ADMIN."userinfo.php?".$e107->tp->toDB($_POST['userip']));
exit; exit;
} }*/
if (isset ($_POST['useraction']) && $_POST['useraction'] == 'usersettings') if (isset ($_POST['useraction']) && $_POST['useraction'] == 'usersettings')
{ {
header('location:'.$e107->url->getUrl('core:user','main','func=settings&id='.(int) $_POST['userid'])); header('location:'.$e107->url->getUrl('core:user','main','func=settings&id='.(int) $_POST['userid']));
@@ -351,6 +351,13 @@ if (isset ($_POST['useraction']) && $_POST['useraction'] == "unban")
$user->user_unban($_POST['userid']); $user->user_unban($_POST['userid']);
} }
// User Info.
if ((isset ($_POST['useraction']) && $_POST['useraction'] == "userinfo") || $_GET['userinfo'])
{
$ip = ($_POST['userip']) ? $_POST['userip'] : $_GET['userinfo'];
$user->user_info($ip);
}
// ------- Delete User -------------- // ------- Delete User --------------
if (isset ($_POST['useraction']) && $_POST['useraction'] == 'deluser') if (isset ($_POST['useraction']) && $_POST['useraction'] == 'deluser')
{ {
@@ -724,6 +731,52 @@ class users
} }
function user_info($ipd)
{
global $ns,$sql,$e107;
if (isset($ipd))
{
if(!defined("BULLET")) define("BULLET", "bullet2.gif");
// TODO - move to e_userinfo.php
$obj = new convert;
$sql->db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
$host = $e107->get_host_name($ipd);
$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
<br /><br />";
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->db_Fetch())
{
$datestamp = $obj->convert_date($cb_datestamp, "short");
$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
$post_author_name = substr($cb_nick, (strpos($cb_nick, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $cb_message."
</div><br />";
}
$text .= "<hr />";
$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->db_Fetch())
{
$datestamp = $obj->convert_date($comment_datestamp, "short");
$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
$post_author_name = substr($comment_author, (strpos($comment_author, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $comment_comment."</div><br />";
}
}
$ns->tablerender(USFLAN_7, $text);
}
function showUserStatus($row) function showUserStatus($row)
{ {
if ($row['user_perms'] == "0") if ($row['user_perms'] == "0")

View File

@@ -1,15 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_userclass.php,v $
| $Revision: 1.4 $
| $Date: 2009-08-04 14:36:55 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
?>

View File

@@ -1,20 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_userinfo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:42 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
define("USFLAN_1", "Unable to find poster's IP address - no information is available.");
// define("USFLAN_2", "Error");
define("USFLAN_3", "Messages posted from IP address");
define("USFLAN_4", "Host");
define("USFLAN_5", "Click here to transfer IP address to admin ban page");
define("USFLAN_6", "User ID");
define("USFLAN_7", "User Information");
?>

View File

@@ -9,8 +9,8 @@
* Language file - user admin * Language file - user admin
* *
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_users.php,v $ * $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_users.php,v $
* $Revision: 1.17 $ * $Revision: 1.18 $
* $Date: 2009-07-23 06:55:39 $ * $Date: 2009-08-05 16:02:08 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -233,7 +233,8 @@ define('LAN_BOUNCED','Bounced');
define('USRLAN_220', 'No Userclass'); define('USRLAN_220', 'No Userclass');
// These need review - there are duplicates above.
// These need review - there are duplicates above - they come from admin/lan_userclass.php.
define("UCSLAN_1", "Sending notification email to"); define("UCSLAN_1", "Sending notification email to");
define("UCSLAN_2", "Updated Privileges"); define("UCSLAN_2", "Updated Privileges");
define("UCSLAN_3", "Dear"); define("UCSLAN_3", "Dear");
@@ -248,4 +249,14 @@ define('UCSLAN_11', 'Class membership for user ID --UID-- changed to --CLASSES--
define('UCSLAN_12', 'Member privileges only'); define('UCSLAN_12', 'Member privileges only');
// from admin/lan_userinfo.php
define("USFLAN_1", "Unable to find poster's IP address - no information is available.");
// define("USFLAN_2", "Error");
define("USFLAN_3", "Messages posted from IP address");
define("USFLAN_4", "Host");
define("USFLAN_5", "Click here to transfer IP address to admin ban page");
define("USFLAN_6", "User ID");
define("USFLAN_7", "User Information");
?> ?>