Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Recorded actions for changes into accoun
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2013-01-31 13:50:06
Always annoyed me that does not register changes made by staff in a user profile.

So I changed this thing for the more important options and so far it seems that it works properly.

In account-details.php find this code:



begin_frame(T_("STAFF_ONLY_INFO"));




And delete everything starting with this code and ending with the first:





end_frame();




So you must delete the entire frame from the beginning at the end. Instead of this frame copy the following code:





begin_frame(T_("STAFF_ONLY_INFO"));

 

   $avatar = htmlspecialchars($user["avatar"]);

   $signature = htmlspecialchars($user["signature"]);

   $uploaded = $user["uploaded"];

   $downloaded = $user["downloaded"];

   $enabled = $user["enabled"] == 'yes';

   $warned = $user["warned"] == 'yes';

   $forumbanned = $user["forumbanned"] == 'yes';

   $username = htmlspecialchars($user[username]);

   $modcomment = htmlspecialchars($user["modcomment"]);

   $info = htmlspecialchars($user["info"]);

 

   $teams = "<option value='0'>--- ".T_("NONE_SELECTED")." ---&nbsp;</option>\n";

   $sashok = SQL_Query_exec("SELECT id,name FROM teams ORDER BY name");

   while ($sasha = mysql_fetch_array($sashok))

   $teams .= "<option value='$sasha[id]'" . ($user["team"] == $sasha['id'] ? " selected='selected'" : "") . ">$sasha[name]</option>\n";

 

   print("<table width='99%' align='center' border='0' cellspacing='0' cellpadding='5'>\n");



//===| Start Recorded Changes |===//



   //change username

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='name' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td width='15%'>".T_("USERNAME").": </td><td width='84%' align='left'><input type='text' size='24' name='name' value=\"" . $username . "\">\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Name' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change email

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='email' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldemail' value=\"$user[email]\" />\n");

       print("<tr><td>".T_("EMAIL")."</td><td align='left'><input type='text' size='24' name='email' value=\"$user[email]\" />\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Email' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change upload

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='uploaded' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldupload' value='".$user["uploaded"]."' />\n");

       print("<tr><td>".T_("UPLOADED")."</td><td align='left'><input type='text' size='24' name='uploaded' value=\"".mksize($user["uploaded"], 9)."\" /></font>\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Upload' />\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change download

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='downloaded' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='olddownload' value='".$user["downloaded"]."' />\n");

       print("<tr><td>".T_("DOWNLOADED")."</td><td align='left'><input type='text' size='24' name='downloaded' value=\"".mksize($user["downloaded"], 9)."\" /></font>\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Download' />\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change team

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='teams' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>".T_("TEAM").": </td><td align='left'><select name='teams'>\n$teams\n</select>");

       print("<font style='margin-left:12px'><input type='submit' value='Change Team' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change user class

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='class' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       if ($CURUSER["class"] > $user["class"]){

           print("<tr><td width='15%'>".T_("USER")." ".T_("CLASS").": </td><td width='84%' align='left'><select name='class'>\n");

           $maxclass = $CURUSER["class"];

           for ($i = 1; $i < $maxclass; ++$i)

           print("<option value='$i' " . ($user["class"] == $i ? " selected='selected'" : "") . ">$prefix" . get_user_class_name($i) . " &nbsp; &nbsp; &nbsp;\n");

           print("</select>\n");

       }

       print("<font style='margin-left:7px'><input type='submit' value='Change Class' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }



   //change invites

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='invites' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldinvites' value='".$user["invites"]."' />\n");

       print("<tr><td>".T_("INVITES").": </td><td align='left'><input type='text' size='4' name='invites' value='".$user["invites"]."' />\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Invites&nbsp;' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //forum banned

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='forumbanned' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>".T_("FORUM_BANNED").": </td><td align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp; <input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> No\n");

       print("<font style='margin-left:7px'><input type='submit' value='Submit' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //disable/enable account

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='enabled' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>Account Enabled: </td><td align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp; <input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font>\n");

       print("<font style='margin-left:9px'><input type='submit' value='Submit' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change password

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='password' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>New Password: </td><td align='left'><input type='password' size='24' name='password' value=\"\" />\n");

       print("<font style='margin-left:9px'><input type='submit' value='".T_("CHANGE_PASS")."' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }



//====| End Recorded Changes |====//



   print("<tr><td height='7'></td></tr>\n");



   print("</table>\n");

   print("<table class='f-border comment' width='99%' align='center' cellspacing='0' cellpadding='5'>");



   print("<form method='post' action='admin-modtasks.php'>\n");

   print("<input type='hidden' name='action' value='edituser' />\n");

   print("<input type='hidden' name='userid' value='$id' />\n");

   print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

 

   print("<tr><td height='7'></td></tr>\n");

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("DONATED_US").": </td><td align='left'><input type='text' size='4' name='donated' value='$user[donated]' /></td></tr>\n");

   } else {

       print("<tr><td>".T_("DONATED_US").": </td><td align='left'><input type='text' size='4' name='donated' value='$user[donated]' readonly='readonly' /></td></tr>\n");

   }

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("IP_ADDRESS").": </td><td align='left'><input type='text' size='14' name='ip' value=\"$user[ip]\" /></td></tr>\n");

   } else {

       print("<tr><td>".T_("IP_ADDRESS").": </td><td align='left'><input type='text' size='14' name='ip' value=\"$user[ip]\" readonly='readonly' /></td></tr>\n");

   }



   print("<tr><td style='padding-top:10px' width='15%'>".T_("TITLE").": </td><td style='padding-top:10px' width='84%' align='left'><textarea cols='70' rows='2' name='title'>".htmlspecialchars($user["title"])."</textarea></td></tr>\n");

   print("<tr><td>".T_("SIGNATURE").": </td><td align='left'><textarea cols='70' rows='10' name='signature'>".htmlspecialchars($user["signature"])."</textarea></td></tr>\n");

   print("<tr><td>".T_("AVATAR_URL").":</td><td align='left'><textarea cols='70' rows='2' name='avatar'>".htmlspecialchars($user["avatar"])."</textarea></td></tr>\n");

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='70' rows='15' name='modcomment'>".$modcomment."</textarea></td></tr>\n");

   } else {

       print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='70' rows='15' name='modcomment' readonly='readonly'>".$modcomment."</textarea></tr>\n");

   }

 

   print("<tr><td>Special Notes: </td><td align='left'><textarea cols='70' rows='10' name='info'>$info</textarea><div style='margin-top:5px; margin-bottom:5px'><font size='2' color='red'>First time enter your username [<b>".$CURUSER["username"]."</b>] and then write your note!</font></div></td></tr>\n");

 

   if ($user[passkey] == '') {

       print("<tr><td>".T_("PASSKEY").": </td><td align='left'><font color='#FF0000'>This user has no passkey.</font></td></tr>\n");

   } else {

       print("<tr><td valign='top' style='padding-top:10px'>".T_("PASSKEY").": </td><td align='left'><div style='margin-top:5px; margin-bottom:5px'><b>$user[passkey]</b></div><input name='resetpasskey' value='yes' type='checkbox' /> ".T_("RESET_PASSKEY").". <font color='#FF0000'>".T_("RESET_PASSKEY_MSG").".</font></td></tr>\n");

   }

 

   print("<tr><td height='10px'></td></tr>");    // 10px space here

   print("<tr><td style='padding-bottom:10px' colspan='2' align='center'><input type='submit' value='Submit' /></td></tr>\n");

   print("</form>\n");

   print("</table>\n");



end_frame();






In admin-modtasks.php you must change the entire code with this one:





<?php

require_once("backend/functions.php");

dbconn(false);

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);



//===| Start Edit User |===//

if ($action == 'edituser'){

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $title = sqlesc($_POST["title"]);

   $signature = sqlesc($_POST["signature"]);

   $avatar = sqlesc($_POST["avatar"]);

   $ip = sqlesc($_POST["ip"]);

   $donated = (float) $_POST["donated"];

   $modcomment = sqlesc($_POST["modcomment"]);

   $info = sqlesc($_POST["info"]);



   if (!is_valid_id($userid))

       show_error_msg(T_("EDITING_FAILED"), T_("INVALID_USERID"),1);



   SQL_Query_exec("UPDATE users SET title=$title, signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, modcomment=$modcomment, info= $info, support=$support, supportfor=$supportfor WHERE id=$userid");

   write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has edited user <a href=account-details.php?id=$userid><b>$username</b></a> details");



   if ($_POST['resetpasskey']=='yes'){

       SQL_Query_exec("UPDATE users SET passkey='' WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has reseted passkey for user <a href=account-details.php?id=$userid><b>$username</b></a>");

   }



 header("Location: account-details.php?id=$userid");

 die;

}

//====| End Edit User |====//



//===| Start Forum Banned |===//

   if ($action == 'forumbanned') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $forumbanned = sqlesc($_POST["forumbanned"]);

 

   $modcomment = $row['modcomment'];

   If ($_POST["forumbanned"] != 'yes') {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum for this user \n";

   } else {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has banned on Forum this user \n";

   }

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       If ($_POST["forumbanned"] != 'yes') {

           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 {

           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>");

       }

   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"]);

 

   $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 account \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");

       }

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Disable/Enable Account |====//



//===| Start Change Invites |===//

   if ($action == 'invites') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $invites = $_POST["invites"];

   $oldinvites = $_POST["oldinvites"];

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed Invites from $oldinvites to: $invites \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET invites=$invites, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed Invites for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldinvites</b> to: <b>$invites</b>");

 

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Change Invites |====//



//===| Start Change Team |===//

   if ($action == 'teams') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $teams = (int) $_POST["teams"];

 

   $query = "SELECT * FROM teams WHERE id='$teams'";

   $result = SQL_Query_exec($query);

   $row = mysql_fetch_array($result);

       if ($teams == 0) {

           $teamname = ("None selected");

       } else {

           $teamname = $row['name'];

       }

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed Team to: $teamname \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET team=$teams, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed Team for user <a href=account-details.php?id=$userid><b>$username</b></a> to: <b>$teamname</b>");

 

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Change Team |====//



//===| Start Change User class |===//

   if ($action == 'class') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $class = (int) $_POST["class"];

   $classname = get_user_class_name($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)");

       }

   }

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed user class to: $classname \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed class for user <a href=account-details.php?id=$userid><b>$username</b></a> to <b>$classname</b>");

 

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Change User class |====//



//===| Start Change Password |===//

   if ($action == 'password') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $password = $_POST["password"];

 

   if ($password == '') {

       show_error_msg(T_("ERROR"), "You must enter something for Password!", 1);

   } else {

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed password \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

     

       $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', modcomment = CONCAT($modcom,modcomment) WHERE id=$userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed password for user: <a href=account-details.php?id=$userid><b>$username</b></a>");

       }

       header("Location: account-details.php?id=$userid");

       die;

       }

   }

//====| End Change Password |====//



//===| Start Change User name |===//

   if ($action == 'name') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $userid = $_POST["userid"];

   $newname = sqlesc($_POST["name"]);

   $oldname = sqlesc($_POST["username"]);

 

   if ($_POST["name"] == '') {

           show_error_msg(T_("ERROR"), "You must enter something for User Name!", 1);

   } else {

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed user name from $oldname to: $newname \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

 

           SQL_Query_exec("UPDATE users SET username=$newname, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed name for user <b>$oldname</b> into: <a href=account-details.php?id=$userid><b>$newname</b></a>");

 

       header("Location: account-details.php?id=$userid");

       die;

       }

   }

//====| End Change User name |====//



//===| Start Change Email |===//

   if ($action == 'email') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $email = $_POST["email"];

   $oldemail = $_POST["oldemail"];

 

   if ($_POST["email"] == '') {

           show_error_msg(T_("ERROR"), "You must enter something for Email!", 1);

   } else {

       if (!validemail($email))

           show_error_msg(T_("EDITING_FAILED"), T_("EMAIL_ADDRESS_NOT_VALID"), 1);

     

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed email from $oldemail to: $email \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

     

           SQL_Query_exec("UPDATE users SET email='$email', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed email for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldemail</b> to: <b>$email</b>");

     

       header("Location: account-details.php?id=$userid");

       die;

       }

   }

//====| End Change Email |====//



//===| Start Change Upload |===//

   if ($action == 'uploaded') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $uploaded = strtobytes($_POST["uploaded"]);

   $upload = mksize($uploaded);

   $olduploaded = $_POST["oldupload"];

   $oldupload = mksize($olduploaded);

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed upload from $oldupload to: $upload \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET uploaded='$uploaded', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed upload for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldupload</b> to: <b>$upload</b>");

 

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Change Upload |====//



//===| Start Change Download |===//

   if ($action == 'downloaded') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $username = sqlesc($_POST["username"]);

   $userid = $_POST["userid"];

   $downloaded = strtobytes($_POST["downloaded"]);

   $download = mksize($downloaded);

   $olddownloaded = $_POST["olddownload"];

   $olddownload = mksize($olddownloaded);

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed download from $olddownload to: $download \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET downloaded='$downloaded', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed download for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$olddownload</b> to: <b>$download</b>");

 

   header("Location: account-details.php?id=$userid");

   die;

   }

//====| End Change Download |====//



//===| Start Warnings |===//

if ($action == 'addwarning') {

   $userid = (int)$_POST["userid"];

   $username = sqlesc($_POST["username"]);

   $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("<b>".$CURUSER['username']."</b> has added a warning for user: <a href='account-details.php?id=$userid'><b>$username</b></a>");

   header("Location: account-details.php?id=$userid");

   die;

}

//====| End Warnings |====//



//===| Start Delete User |===//

if ($action == "deleteaccount") {

   if ($CURUSER["delete_users"] != "yes")    //only allow admins to delete users

       show_error_msg(T_("ERROR"), T_("TASK_ADMIN"),1);



   $userid = (int)$_POST["userid"];

   $username = sqlesc($_POST["username"]);

   $delreason = sqlesc($_POST["delreason"]);



   if (!is_valid_id($userid))

       show_error_msg(T_("FAILED"), T_("INVALID_USERID"),1);

     

   if ($CURUSER["id"] == $userid)

       show_error_msg("Error", "You cannot delete yourself.", 1);

 

   If ($_POST["delreason"] == '') {

       show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA"), 1);

   }

   deleteaccount($userid);

   write_log("<b>".$CURUSER['username']."</b> has deleted account: <b>$username</b>. Reason: $delreason");



   show_error_msg(T_("COMPLETED"), T_("USER_DELETE"), 1);

   die;

}

//====| End Delete User |====//

?>

Unknown User
2013-01-31 17:08:51
good idea  ;)

will try this soon
Unknown User
2013-01-31 17:55:55
nice work
Unknown User
2013-01-31 19:53:12
This looks cool, no idea why from the start it never logged stuff staff did LOL!!!.

If anyone looks at my recent addons most of them add some kind of comment someplace.
2013-01-31 23:35:23
woww! BigMax1

****Very nice work!****

Give me your paypal email, I will thank you to my way! lol
Unknown User
2013-02-01 00:57:06
I forgot to mention something, into the original function "Delete User" is a bug.

Because of his the account is deleted directly, even if you write a reason or not.

I have corrected it.
Unknown User
2013-02-07 15:52:49
Quote:
Database Error in admin-modtasks.php on line 32: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''', title='', signature='', avatar='', ip='5.000.000.000', donated=0, modcomment' at line 1. Query was: UPDATE users SET '', title='', signature='', avatar='', ip='5.000.000.000', donated=0, modcomment='', info='', support=, supportfor= for WHERE id=2.
Unknown User
2013-02-07 20:30:49
The thing i dont like about this is basically 2 querys on just db update every time:(  Been much simpler on load is used an

$updateset[] = 'key = ' . sqlesc($var);

And jessy looks like your admin-modtasks is all messed up..

[size=12px]ip='5.000.000.000' LOL[/size]

[size=12px]attach your admin-modtasks [/size]
Unknown User
2013-02-08 01:51:43
ok thank you

I handed the original 2.08
2013-02-17 13:48:05
error admin-modtasks

Database Error in admin-modtasks.php on line 31: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' supportfor= WHERE id=1' at line 1. Query was: UPDATE users SET title='Encodeur', signature='', avatar='http://zupimages.net/up/2/2048364482.png', ip='XX.XXX.XXX.XX', donated=0, modcomment='02-Feb-2013 - Has been promoted by System to Power User class rn rn rn', info= '', support=, supportfor= WHERE id=1.







Line 31:


	 SQL_Query_exec("UPDATE users SET title=$title, signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, modcomment=$modcomment, info= $info, support=$support, supportfor=$supportfor WHERE id=$userid");

write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has edited user <a href=account-details.php?id=$userid><b>$username</b></a> details");
[/code]

V-2.08
Unknown User
2013-02-17 13:59:25
remove

, support=$support, supportfor=$supportfor
he has not defined support...
2013-02-17 14:20:14
"ArcticWolf, post: 88916":
remove

, support=$support, supportfor=$supportfor
he has not defined support...

Big thanks ArcticWolf ! ;)
Unknown User
2013-02-21 18:21:38
Here is an update that completes the codes for "Forum Banned" (with ban length + reason for ban) and "Account Enabled" (with reason for disable) .
The actions are registered into modcomment, log and the user will receive a PM when will be banned or unbanned.



Run in your database:

ALTER TABLE `users` ADD `forumbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `forumbanned`;
Into account-details.php replace this code:

//forum banned
if (get_user_class() >= 5)  {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='forumbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("FORUM_BANNED").": </td><td align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp; <input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:7px'><input type='submit' value='Submit' /></font>n");
print("</td></tr>n");
print("</form>n");
}

//disable/enable account
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='enabled' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>Account Enabled: </td><td align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp; <input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font>n");
print("<font style='margin-left:9px'><input type='submit' value='Submit' /></font>n");
print("</td></tr>n");
print("</form>n");
}
with this one:

$forumbanneduntil = $user["forumbanneduntil"];
if ($forumbanneduntil != "0000-00-00 00:00:00"){
$banforumuntil = "Remains: <font color=red><b>".mkprettytime(strtotime($forumbanneduntil) - gmtime())."</b></font> to go...";
} else {
$banforumuntil = "";
}

print("<tr><td height='5'></td></tr>n"); //===| 5px space here!

//forum banned
if (get_user_class() >= 5)  {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='forumbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("FORUM_BANNED").": </td><td class='table_col2' align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp;<input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:15px; margin-right:20px'>Banned for: <input type='text' size='4' name='forumbannedlength' /> days</font>$banforumuntiln");
print("<div style='margin-top:5px'>Reason: <input type='text' size='70' name='forbanreason'>n");
print("<font style='margin-left:10px; margin-right:20px'><input type='submit' value='Submit' /></font></div>n");
print("</td></tr>n");
print("</form>n");
}

print("<tr><td height='5'></td></tr>n"); //===| 5px space here!

//disable/enable account
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='enabled' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>Account Enabled: </td><td class='table_col2' align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp;<input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font><font style='margin-left:20px' color='#0080FF'><i>Do not disable the account without a founded reason!</i></font>n");
print("<div style='margin-top:5px'>Reason: <input type='text' size='70' name='disablereason'>n");
print("<font style='margin-left:10px'><input type='submit' value='Submit' /></div>n");
print("</td></tr>n");
print("</form>n");
}
print("<tr><td height='5'></td></tr>n"); //===| 5px space here!
Into admin-modtasks.php replace this code:

//===| Start Forum Banned |===//
if ($action == 'forumbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$forumbanned = sqlesc($_POST["forumbanned"]);

$modcomment = $row['modcomment'];
If ($_POST["forumbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum for this user n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has banned on Forum this user n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);

SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
If ($_POST["forumbanned"] != 'yes') {
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 {
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>");
}
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"]);

$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 account 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");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Disable/Enable Account |====//

with this one:

//===| 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! &nbsp [<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! &nbsp [<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! &nbsp [<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 |====//
And in the bottom of backend/cleanup.php copy this code:


# Remove ban on forum
$res32 = SQL_Query_exec("SELECT id FROM users WHERE forumbanned='yes' AND forumbanneduntil < NOW() AND forumbanneduntil <> '0000-00-00 00:00:00'");
if (mysql_num_rows($res32) > 0)
{
$dt = sqlesc(get_date_time());
$msg = sqlesc("Your ban on forum has been removed.n");
while ($arr = mysql_fetch_assoc($res32))
{
SQL_Query_exec("UPDATE users SET forumbanned = 'no', forumbanneduntil = '0000-00-00 00:00:00' WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $msg, 0)");
}
}
2013-02-22 03:56:15
Again a big thank you! :D
Unknown User
2013-02-26 12:26:41
THANKS a million for this!
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728