*
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = array("noheader" => True, "nonavbar" => True);
$phpgw_flags["currentapp"] = "preferences";
include("../header.inc.php");
if ($phpgw_info["user"]["permissions"]["anonymous"]) {
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/"));
exit;
} else if (! $submit) {
$phpgw->common->header();
$phpgw->common->navbar();
}
function display_option($text,$check,$option) {
global $phpgw, $phpgw_info;
if ($phpgw_info["user"]["permissions"][$check]) {
?>
?
>
db->query("delete from preferences where owner='" . $phpgw->session->loginid
. "' AND name != 'theme'");
// If they don't have permissions to the headlines,
// we don't need to lock the table.
if ($phpgw_info["user"]["permissions"]["headlines"]) {
$phpgw->db->lock(array("preferences","users_headlines"));
} else {
$phpgw->db->lock("preferences");
}
$phpgw->preferences->add($phpgw->session->loginid,"maxmatchs");
$phpgw->preferences->add($phpgw->session->loginid,"tz_offset");
$phpgw->preferences->add($phpgw->session->loginid,"dateformat");
$phpgw->preferences->add($phpgw->session->loginid,"timeformat");
$phpgw->preferences->add($phpgw->session->loginid,"lang");
$phpgw->preferences->add($phpgw->session->loginid,"default_sorting");
$phpgw->preferences->add($phpgw->session->loginid,"default_app");
if ($navbar_text) {
$phpgw->preferences->add($phpgw->session->loginid,"navbar_text");
}
if ($phpgw_info["user"]["permissions"]["admin"]) {
if ($show_currentusers) {
$phpgw->preferences->add($phpgw->session->loginid,"show_currentusers");
}
}
if ($phpgw_info["user"]["permissions"]["email"]) {
if ($mainscreen_showmail) {
$phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showmail");
}
$phpgw->preferences->add($phpgw->session->loginid,"email_sig");
}
if ($phpgw_info["user"]["permissions"]["addressbook"]) {
if ($mainscreen_showbirthdays) {
$phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showbirthdays");
}
}
if ($phpgw_info["user"]["permissions"]["calendar"]) {
$phpgw->preferences->add($phpgw->session->loginid,"weekdaystarts");
$phpgw->preferences->add($phpgw->session->loginid,"workdaystarts");
$phpgw->preferences->add($phpgw->session->loginid,"workdayends");
if ($mainscreen_showevents) {
$phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showevents");
}
}
if ($phpgw_info["user"]["permissions"]["headlines"]) {
include($phpgw_info["server"]["server_root"] . "/headlines/inc/functions.inc.php");
headlines_update($phpgw->session->loginid,$headlines);
}
$phpgw->db->unlock();
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]
. "/preferences/"));
}
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");