looks good. please test

This commit is contained in:
seek3r 2001-01-28 12:24:38 +00:00
parent d3ed4a59ae
commit 5544af855f
4 changed files with 12 additions and 26 deletions

View File

@ -47,11 +47,10 @@
. $db2->f("account_lastname");
$phpgw_info["user"]["groups"] = explode (",", $db2->f("account_groups"));
$apps = CreateObject('phpgwapi.applications',intval($phpgw_info["user"]["account_id"]));
$prefs = CreateObject('phpgwapi.preferences',intval($phpgw_info["user"]["account_id"]));
$phpgw_info["user"]["preferences"] = $prefs->get_saved_preferences();
$phpgw_info["user"]["app_perms"] = $apps->app_perms();
$phpgw_info["user"]["apps"] = $apps->enabled_apps();
// $apps = CreateObject('phpgwapi.applications',intval($phpgw_info["user"]["account_id"]));
// $prefs = CreateObject('phpgwapi.preferences',intval($phpgw_info["user"]["account_id"]));
// $phpgw_info["user"]["preferences"] = $prefs->get_saved_preferences();
// $phpgw_info["user"]["apps"] = $apps->enabled_apps();
$phpgw_info["user"]["lastlogin"] = $db2->f("account_lastlogin");
$phpgw_info["user"]["lastloginfrom"] = $db2->f("account_lastloginfrom");
@ -76,11 +75,10 @@
$userData["fullname"] = $db2->f("account_firstname") . " "
. $db2->f("account_lastname");
$userData["groups"] = explode(",", $db2->f("account_groups"));
$apps = CreateObject('phpgwapi.applications',intval($phpgw_info["user"]["account_id"]));
$prefs = CreateObject('phpgwapi.preferences',intval($phpgw_info["user"]["account_id"]));
$userData["preferences"] = $prefs->get_saved_preferences();
$userData["app_perms"] = $apps->app_perms();
$userData["apps"] = $apps->enabled_apps();
// $apps = CreateObject('phpgwapi.applications',intval($phpgw_info["user"]["account_id"]));
// $prefs = CreateObject('phpgwapi.preferences',intval($phpgw_info["user"]["account_id"]));
// $userData["preferences"] = $prefs->get_saved_preferences();
// $userData["apps"] = $apps->enabled_apps();
$userData["lastlogin"] = $db2->f("account_lastlogin");
$userData["lastloginfrom"] = $db2->f("account_lastloginfrom");

View File

@ -59,9 +59,8 @@
if ($check) {
$this->account_apps[$app] = array("title" => $phpgw_info["apps"][$app]["title"], "name" => $app, "enabled" => True, "status" => $phpgw_info["apps"][$app]["status"]);
}
return $this->account_apps;
}
return False;
return $this->account_apps;
}
function app_perms()

View File

@ -114,29 +114,23 @@
$this->acl = CreateObject("phpgwapi.acl");
$this->accounts = CreateObject("phpgwapi.accounts");
$this->session = CreateObject("phpgwapi.sessions");
// $this->applications = CreateObject("phpgwapi.applications");
// $this->preferences = CreateObject("phpgwapi.preferences");
//echo "check point 1<br>\n";
if ($phpgw_info["flags"]["currentapp"] == "login") {
//echo "check point 2<br>\n";
if ($login != ""){
$log = explode("@",$login);
$this->preferences = CreateObject("phpgwapi.preferences", $log[0]);
// $this->applications = CreateObject("phpgwapi.applications", $log[0]);
}
}else{
//echo "check point 3<br>\n";
if (! $this->session->verify()) {
//echo "check point 4<br>\n";
$this->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__);
$this->db->next_record();
Header("Location: " . $this->redirect($this->link($this->db->f("config_value")."/login.php","cd=10")));
exit;
}
//echo "check point 5<br>\n";
$this->preferences = CreateObject("phpgwapi.preferences", intval($phpgw_info["user"]["account_id"]));
$this->applications = CreateObject("phpgwapi.applications", intval($phpgw_info["user"]["account_id"]));
}
$phpgw_info["user"]["preferences"] = $this->preferences->get_saved_preferences();
$phpgw_info["user"]["apps"] = $this->applications->enabled_apps();
}
$this->translation = CreateObject("phpgwapi.translation");
$sep = $phpgw_info["server"]["dir_separator"];

View File

@ -32,7 +32,6 @@
function preferences($account_id = "")
{
//echo "Account_id = ".$account_id."<br>\n";
global $phpgw, $phpgw_info;
$this->db = $phpgw->db;
if ($account_id == ""){
@ -55,8 +54,6 @@
$this->preference = Array();
$this->preference = unserialize($pref_info);
$this->db->unlock();
//echo "Account ID (get_saved_pref) = ".$this->account_id."<br>\n";
//echo "Preferences = ".$this->preference."<br>\n";
return $this->preference;
}
@ -64,8 +61,6 @@
function get_preferences()
{
global $phpgw;
//echo "Account ID (get_pref) = ".$this->account_id."<br>\n";
//echo "Preferences = ".$this->preference."<br>\n";
return $this->preference;
}