The Arcive of vBulletin Modifications Site. |
|
hack: active cookie Details »»
|
|||||||||||||||||||||||||
hello every one
as all of you know this command and what it's do in sql Code:
update user SET cookieuser='1' it's not do it for all users we have so i make up a hack from my own but i need a help from you to finish it ( file name is cookies.php in admin folder ) PHP Code:
what do you think ? Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Quote:
Your problem is probably not the SQL command itself but what happens afterwards. Even if you run the command, your users will be able to reset it to 0 in their user cp or while registering if you don't modify relevant templates. So there is nothing wrong with the SQL command and you don't need a hack to run this command in the db. |
|
#3
|
|||
|
|||
|
so what sholud i do to make it '1' for all the users ?
|
|
#4
|
||||
|
||||
|
run the query update user SET cookieuser=1 then edit your register and usercp templates and remove relevant sections so that your users can not edit them back. (make them hidden form fields)
|
|
#5
|
|||
|
|||
|
how about this ?
Code:
<?php
error_reporting(7);
if (function_exists("set_time_limit")==1 and get_cfg_var("safe_mode")==0) {
@set_time_limit(1200);
}
//suppress gzipping
$nozip=1;
require("./global.php");
require("./config.php");
adminlog();
cpheader();
// ##################################################################
if (isset($perpage)==0 or $perpage=="") {
$perpage=1000;
}
if (isset($startat)==0 or $startat=="") {
$startat=0;
}
$finishat=$startat+$perpage;
echo "<p>User ids:</p>";
$users=$DB_site->query("SELECT userid,usertitle,usergroupid,customtitle,posts FROM user WHERE userid>=$startat AND userid<$finishat ORDER BY userid DESC");
while ($user=$DB_site->fetch_array($users)) {
unset($sql);
$userid=$user[userid];
// update user stuff
if ($user[cookieuser]==0)
$DB_site->query("UPDATE user SET cookieuser='1' WHERE userid='$user[userid]'");
echo "Processing user <b>$user[userid]</b><br>\n";
flush();
}
if ($checkmore=$DB_site->query_first("SELECT userid FROM user WHERE userid>=$finishat")) {
cpredirect("cookies.php?s=$session[sessionhash]&startat=$finishat&perpage=$perpage");
echo "<p><a href=\"cookies.php?s=$session[sessionhash]&startat=$finishat&perpage=$perpage\">Click here to continue updating users</a></p>";
} else {
echo "<p>User cookies updated!</p>";
}
cpfooter();
?>
|
![]() |
|
|