query("SELECT * FROM iworks_users WHERE username like '%".$username."%' ORDER BY userid ASC");
return $result;
}
//get a file listing and stick it in the array $listing to return it...
function filelist($direc) {
$path=$direc;
$j=0;
if(is_dir($path)) {
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != "..") {
$listing[$j] = $file;
$j++;
}
}
closedir($dh);
}
}
return $listing;
}
//get a file listing and stick it in the array $listing to return it...
function setpoll($pollid) {
require("./poll.dat");
$set = '
$polldat[activepoll] = "'.$pollid.'";
$polldat[featuredimage] = "'.$polldat[featuredimage].'";
$polldat[featuredimagethumb] = "'.$polldat[featuredimagethumb].'";
$polldat[featureduser] = "'.$polldat[featureduser].'";
$polldat[entryname] = "'.$polldat[entryname].'";
?>';//
write_file("./poll.dat",$set);
}
function setpollwinner($pollid,$featuredimage,$featuredimagethumb,$featureduser,$entryname) {
require("./poll.dat");
$set = '
$polldat[activepoll] = "'.$pollid.'";
$polldat[featuredimage] = "'.$featuredimage.'";
$polldat[featuredimagethumb] = "'.$featuredimagethumb.'";
$polldat[featureduser] = "'.$featureduser.'";
$polldat[entryname] = "'.$entryname.'";
?>';//
write_file("./poll.dat",$set);
}
//make it look as tho this file doesn't exist if the user is not an administrator.
if($adminstatus != true) {
echo "
404 Not Found
Not Found
The requested URL /administration.fpd was not found on this server.
$_SERVER[SERVER_SIGNATURE]
";
exit();
}
if($session['adminverified'] != 1) {
sleep(2);
if($_REQUEST['action'] == "adminlogin") {
$tmppass = $CUSER->_encodestring($_REQUEST['userpass']);
if($tmppass == $user_info['userpassword']) {
$sql->query("UPDATE iworks_useronline SET adminverified='1' WHERE session='$session[session]'");
$output="Password accepted, session has been started...";
$link="$basepath/administration.fpd";
require ("my.query.fpd");
eval("dooutput(\"".gettemplate("redirect")."\");");
exit();
}else {
$output="Password incorrect!";
$link="$basepath/administration.fpd";
require ("my.query.fpd");
eval("dooutput(\"".gettemplate("redirect")."\");");
exit();
}
}
echo "
Authentification has failed!
Please log into your administrative account by typing in your administrative password here:
";
exit();
}
//admin links...
eval ("\$adminlinks = \"".gettemplate("adminlinks")."\";");
//
if($_REQUEST['action'] == "cleanmessages") {
$sql->query("DELETE FROM iworks_usermessages_Comments WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Comments");
$sql->query("DELETE FROM iworks_usermessages_Submissions WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Submissions");
$sql->query("DELETE FROM iworks_usermessages_Watches WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Watches");
$sql->query("DELETE FROM iworks_usermessages_Notes WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Notes");
$sql->query("DELETE FROM iworks_usermessages_Journals WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Journals");
$sql->query("DELETE FROM iworks_usermessages_Favorites WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Favorites");
$sql->query("DELETE FROM iworks_usermessages_Shouts WHERE isread='1'");
$sql->query("OPTIMIZE TABLE iworks_usermessages_Shouts");
$output="Old messages have been removed and the table has been optimized.";
$link="$basepath/administration.fpd";
require ("my.query.fpd");
eval("dooutput(\"".gettemplate("redirect")."\");");
exit();
}
//This allows you to view all mysql errors that users have had.
if($_REQUEST['action'] == "viewlogs") {
$mysql_errors = read_file("./MYSQL_ERROR_LOG");
$mysql_errors = nl2br($mysql_errors);
echo dooutput("{css}{bodytag}---BEGIN FILE---
$mysql_errors
---END OF FILE---