hello I have problem
Parse error: syntax error, unexpected end of file in
/var/www/admin-modtasks.php on line
230
i can edit user promoted super moderator
I have not wanted to change everything
je n'es pas voulu tout modifier
<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2012-07-02 17:34:40 +0100 (Mon, 02 Jul 2012) $
// $LastChangedBy: torrenttrader $
//
//
http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
if($CURUSER["edit_users"]!="yes")
show_error_msg(T_("ACCESS_DENIED"),T_("YOU_DONT_HAVE_EDIT_USER_PERM"),1);
$action = $_POST["action"];
if (!$action)
show_error_msg(T_("ERROR"), T_("TASK_NOT_FOUND"), 1);
if ($action == 'edituser'){
$userid = $_POST["userid"];
$title = sqlesc($_POST["title"]);
$downloaded = strtobytes($_POST["downloaded"]);
$uploaded = strtobytes($_POST["uploaded"]);
$signature = sqlesc($_POST["signature"]);
$avatar = strip_tags($_POST["avatar"]);
$ip = sqlesc($_POST["ip"]);
$class = (int) $_POST["class"];
$donated = (float) $_POST["donated"];
$password = $_POST["password"];
$warned = sqlesc($_POST["warned"]);
$forumbanned = sqlesc($_POST["forumbanned"]);
$modcomment = sqlesc($_POST["modcomment"]);
$enabled = sqlesc($_POST["enabled"]);
$invites =(int) $_POST["invites"];
$class = (int)$_POST["class"];
$email = $_POST["email"];
if (!is_valid_id($userid))
show_error_msg(T_("EDITING_FAILED"), T_("INVALID_USERID"),1);
if (!validemail($email))
show_error_msg(T_("EDITING_FAILED"), T_("EMAIL_ADDRESS_NOT_VALID"), 1);
if ( $avatar != null )
{
# Allowed Image Extenstions.
$allowed_types = &$site_config["allowed_image_types"];
# We force http://
if ( !preg_match( "#^w+://#i", $avatar ) ) $avatar = "
http://" . $avatar;
# Clean Avatar Path.
$avatar = cleanstr( $avatar );
# Validate Image.
$im = @getimagesize( $avatar );
if ( !$im[ 2 ] || !@array_key_exists( $im['mime'], $allowed_types ) )
show_error_msg("Error", "The avatar url was determined to be of a invalid nature.", 1);
}
# Save New Avatar.
$avatar = sqlesc($avatar);
//change user class
$res = SQL_Query_exec("SELECT class FROM users WHERE id=$userid");
$arr = mysql_fetch_row($res);
$uc = $arr[0];
// skip if class is same as current
if ($uc != $class && $class > 0) {
if ($userid == $CURUSER["id"]) {
show_error_msg(T_("EDITING_FAILED"), T_("YOU_CANT_DEMOTE_YOURSELF"),1);
} elseif ($uc >= get_user_class()) {
show_error_msg(T_("EDITING_FAILED"), T_("YOU_CANT_DEMOTE_SOMEONE_SAME_LVL"),1);
} else {
@SQL_Query_exec("UPDATE users SET class=$class WHERE id=$userid");
// Notify user
$prodemoted = ($class > $uc ? "promoted" : "demoted");
$msg = sqlesc("You have been $prodemoted to '" . get_user_class_name($class) . "' by " . $CURUSER["username"] . ".");
$added = sqlesc(get_date_time());
@SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
}
}
//continue updates
SQL_Query_exec("UPDATE users SET email='$email', title=$title, downloaded='$downloaded', uploaded='$uploaded', signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, forumbanned=$forumbanned, warned=$warned, modcomment=$modcomment, enabled=$enabled, invites=$invites WHERE id=$userid");
write_log($CURUSER['username']." has edited user: $userid details");
if ($_POST['resetpasskey']=='yes'){
SQL_Query_exec("UPDATE users SET passkey='' WHERE id=$userid");
//write_log($CURUSER['username']." ".T_("PASSKEY")." has been reset for: $userid");
}
$chgpasswd = $_POST['chgpasswd']=='yes' ? true : false;
if ($chgpasswd) {
$passreq = SQL_Query_exec("SELECT password FROM users WHERE id=$userid");
$passres = mysql_fetch_assoc($passreq);
if($password != $passres['password']){
$password = passhash($password);
SQL_Query_exec("UPDATE users SET password='$password' WHERE id=$userid");
write_log($CURUSER['username']." has changed password for user: $userid");
}
}
header("Location: account-details.php?id=$userid");
die;
}
if ($action == 'addwarning'){
$userid = (int)$_POST["userid"];
$reason = mysql_real_escape_string($_POST["reason"]);
$expiry = (int)$_POST["expiry"];
$type = mysql_real_escape_string($_POST["type"]);
if (!is_valid_id($userid))
show_error_msg(T_("EDITING_FAILED"), T_("INVALID_USERID"),1);
if (!$reason || !$expiry || !$type){
show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA").".", 1);
}
$timenow = get_date_time();
$expiretime = get_date_time(gmtime() + (86400 * $expiry));
$ret = SQL_Query_exec("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ('$userid','$reason','$timenow','$expiretime','".$CURUSER['id']."','$type')");
$ret = SQL_Query_exec("UPDATE users SET warned='yes' WHERE id='$userid'");
$msg = sqlesc("You have been warned by " . $CURUSER["username"] . " - Reason: ".$reason." - Expiry: ".$expiretime."");
$added = sqlesc(get_date_time());
@SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
write_log($CURUSER['username']." has added a warning for user: <a href='account-details.php?id=$userid'>$userid</a>");
header("Location: account-details.php?id=$userid");
die;
}
if ($action == "deleteaccount"){
if ($CURUSER["delete_users"] != "yes")
//only allow admins to delete users
//===| Start Forum Banned |===//
if ($action == 'forumbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$forumbanned = sqlesc($_POST["forumbanned"]);
$forumbannedlength = sqlesc($_POST["forumbannedlength"]);
$forumbanneduntil = get_date_time(gmtime() + $forumbannedlength * 86400);
$days = $forumbannedlength . " day" . ($forumbannedlength > 1 ? "s" : "");
$fbreason = $_POST["forbanreason"];
if ($_POST["forumbanned"] == 'yes' && $_POST["forumbannedlength"] == '') {
show_error_msg(T_("ERROR"), "You must specify the number of days!   [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}
if ($_POST["forumbanned"] == 'yes' && $_POST["forbanreason"] == '') {
show_error_msg(T_("ERROR"), "You must provide a Reason for this action!   [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}
$modcomment = $row['modcomment'];
if ($_POST["forumbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has added ban on Forum for $daysn- Reason: $fbreason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
if ($_POST["forumbanned"] != 'yes') {
SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, forumbanneduntil = '0000-00-00 00:00:00', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Your ban on Forum has been removed by
".$curusername."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has removed ban on Forum for user <a href=account-details.php?id=$userid><b>$username</b></a>");
} else {
SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, forumbanneduntil = '$forumbanneduntil', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("You have received a
".$days." ban on Forum from
".$curusername."nnReason: ".$fbreason."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has banned on Forum user <a href=account-details.php?id=$userid><b>$username</b></a> for $days<br />Reason: $fbreason");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Forum Banned |====//
//===| Start Disable/Enable Account |===//
if ($action == 'enabled') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$enabled = sqlesc($_POST["enabled"]);
$disablereason = $_POST["disablereason"];
if ($_POST["enabled"] != 'yes' && $_POST["disablereason"] == '') {
show_error_msg(T_("ERROR"), "You must provide a Reason for this action!   [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}
$modcomment = $row['modcomment'];
if ($_POST["enabled"] == 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has enabled this account n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has disabled this accountn- Reason: $disablereason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET enabled=$enabled, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
if ($_POST["enabled"] == 'yes') {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has enabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");
} else {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has disabled user <a href=account-details.php?id=$userid><b>$username</b></a> account<br />Reason: $disablereason");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Disable/Enable Account |====//
?>
[url="
http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6816"]admin-modtasks.php[/url]