set('purge', $_POST['purge']);
$prefs->set('manualtimeout', $_POST['manualtimeout']);
$prefs->set('autotimeout', $_POST['autotimeout']);
$prefs->set('logging', $_POST['logging']);
$prefs->save();
$message .= ' Saved admin prefs.';
if($prefs->get('logging') && !@fopen("fof.log", 'a'))
{
$message .= ' Warning: could not write to log file!';
}
}
if(isset($_POST['tagfeed']))
{
$tags = $_POST['tag'];
$feed_id = $_POST['feed_id'];
$title = $_POST['title'];
foreach(explode(" ", $tags) as $tag)
{
fof_tag_feed(fof_current_user(), $feed_id, $tag);
$message .= " Tagged '$title' as $tag.";
}
}
if(isset($_GET['untagfeed']))
{
$feed_id = $_GET['untagfeed'];
$tags = $_GET['tag'];
$title = $_GET['title'];
foreach(explode(" ", $tags) as $tag)
{
fof_untag_feed(fof_current_user(), $feed_id, $tag);
$message .= " Dropped $tag from '$title'.";
}
}
if(isset($_POST['prefs']))
{
$prefs->set('favicons', isset($_POST['favicons']));
$prefs->set('keyboard', isset($_POST['keyboard']));
$prefs->set('tzoffset', intval($_POST['tzoffset']));
$prefs->set('howmany', intval($_POST['howmany']));
$prefs->set('order', $_POST['order']);
$prefs->set('sharing', $_POST['sharing']);
$prefs->set('sharedname', $_POST['sharedname']);
$prefs->set('sharedurl', $_POST['sharedurl']);
$prefs->save(fof_current_user());
if($_POST['password'] && ($_POST['password'] == $_POST['password2']))
{
fof_db_change_password($fof_user_name, $_POST['password']);
setcookie ( "user_password_hash", md5($_POST['password'] . $fof_user_name), time()+60*60*24*365*10 );
$message = "Updated password.";
}
else if($_POST['password'] || $_POST['password2'])
{
$message = "Passwords do not match!";
}
$message .= ' Saved prefs.';
}
if(isset($_POST['plugins']))
{
foreach(fof_get_plugin_prefs() as $plugin_pref)
{
$key = $plugin_pref[1];
$prefs->set($key, $_POST[$key]);
}
$plugins = array();
$dirlist = opendir(FOF_DIR . "/plugins");
while($file=readdir($dirlist))
{
if(ereg('\.php$',$file))
{
$plugins[] = substr($file, 0, -4);
}
}
closedir();
foreach($plugins as $plugin)
{
$prefs->set("plugin_" . $plugin, $_POST[$plugin] != "on");
}
$prefs->save(fof_current_user());
$message .= ' Saved plugin prefs.';
}
if(isset($_POST['changepassword']))
{
if($_POST['password'] != $_POST['password2'])
{
$message = "Passwords do not match!";
}
else
{
$username = $_POST['username'];
$password = $_POST['password'];
fof_db_change_password($username, $password);
$message = "Changed password for $username.";
}
}
if(isset($_POST['adduser']) && $_POST['username'] && $_POST['password'])
{
$username = $_POST['username'];
$password = $_POST['password'];
fof_db_add_user($username, $password);
$message = "User '$username' added.";
}
if(isset($_POST['deleteuser']) && $_POST['username'])
{
$username = $_POST['username'];
fof_db_delete_user($username);
$message = "User '$username' deleted.";
}
include("header.php");
?>
![]() | ";
}
print "$title | "; print ""; if($tags) { foreach($tags as $tag) { $utag = urlencode($tag); $utitle = urlencode($title); print "$tag [x] "; } } else { } print " | "; $title = htmlspecialchars($title); print "