mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
Returned cvs to how it was last night (with including the class.accounts.inc.php) file first
This commit is contained in:
parent
e4955703cf
commit
5f0c2433db
11
phpgwapi/inc/class.accounts.inc.php
Normal file
11
phpgwapi/inc/class.accounts.inc.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
if (empty($phpgw_info["server"]["account_repository"])){
|
||||||
|
if (!empty($phpgw_info["server"]["auth_type"])){
|
||||||
|
$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];
|
||||||
|
}else{
|
||||||
|
$phpgw_info["server"]["account_repository"] = "sql";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
include(PHPGW_API_INC."/class.accounts_".$phpgw_info["server"]["account_repository"].".inc.php");
|
||||||
|
include(PHPGW_API_INC."/class.accounts_shared.inc.php");
|
||||||
|
?>
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
class accounts
|
class accounts_
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $account_id;
|
var $account_id;
|
||||||
|
87
phpgwapi/inc/class.accounts_shared.inc.php
Normal file
87
phpgwapi/inc/class.accounts_shared.inc.php
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
/**************************************************************************\
|
||||||
|
* phpGroupWare API - Accounts manager shared functions *
|
||||||
|
* This file written by Joseph Engo <jengo@phpgroupware.org> *
|
||||||
|
* shared functions for other account repository managers *
|
||||||
|
* Copyright (C) 2000, 2001 Joseph Engo *
|
||||||
|
* -------------------------------------------------------------------------*
|
||||||
|
* This library is part of the phpGroupWare API *
|
||||||
|
* http://www.phpgroupware.org/api *
|
||||||
|
* ------------------------------------------------------------------------ *
|
||||||
|
* This library is free software; you can redistribute it and/or modify it *
|
||||||
|
* under the terms of the GNU Lesser General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2.1 of the License, *
|
||||||
|
* or any later version. *
|
||||||
|
* This library is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* See the GNU Lesser General Public License for more details. *
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License *
|
||||||
|
* along with this library; if not, write to the Free Software Foundation, *
|
||||||
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
||||||
|
\**************************************************************************/
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
class accounts extends accounts_
|
||||||
|
{
|
||||||
|
/**************************************************************************\
|
||||||
|
* Standard constructor for setting $this->account_id *
|
||||||
|
* This constructor sets the account id, if string is sent, converts to id *
|
||||||
|
* I might move this to the accounts_shared if it stays around *
|
||||||
|
\**************************************************************************/
|
||||||
|
function accounts($account_id = False)
|
||||||
|
{
|
||||||
|
global $phpgw, $phpgw_info;
|
||||||
|
$this->db = $phpgw->db;
|
||||||
|
if ($account_id == False){ $this->account_id = $account_id; }
|
||||||
|
}
|
||||||
|
|
||||||
|
function read()
|
||||||
|
{
|
||||||
|
if (count($this->data) == 0){ $this->read_repository(); }
|
||||||
|
reset($this->data);
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_data($data) {
|
||||||
|
reset($data);
|
||||||
|
$this->data = Array();
|
||||||
|
$this->data = $data;
|
||||||
|
reset($this->data);
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function memberships($account_id = False)
|
||||||
|
{
|
||||||
|
global $phpgw_info, $phpgw;
|
||||||
|
if ($account_id == ""){ $account_id = $phpgw_info["user"]["account_id"]; }
|
||||||
|
elseif (gettype($account_id) == "string") { $account_id = $this->name2id($account_id); }
|
||||||
|
|
||||||
|
$security_equals = Array();
|
||||||
|
$security_equals = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, intval($account_id));
|
||||||
|
if (!$security_equals) { return False; }
|
||||||
|
for ($idx=0; $idx<count($security_equals); $idx++){
|
||||||
|
$name = $this->name2id($security_equals[$idx]);
|
||||||
|
$this->memberships[] = Array("account_id" => $security_equals[$idx], "account_name" => "$name");
|
||||||
|
}
|
||||||
|
return $this->memberships;
|
||||||
|
}
|
||||||
|
|
||||||
|
function members ($account_id = False)
|
||||||
|
{
|
||||||
|
global $phpgw_info, $phpgw;
|
||||||
|
if ($account_id == ""){ $account_id = $phpgw_info["user"]["account_id"]; }
|
||||||
|
elseif (gettype($account_id) == "string") { $account_id = $this->name2id($account_id); }
|
||||||
|
|
||||||
|
$security_equals = Array();
|
||||||
|
$security_equals = $phpgw->acl->get_ids_for_location(intval($account_id), 1, "phpgw_group");
|
||||||
|
if (!$security_equals) { return False; }
|
||||||
|
for ($idx=0; $idx<count($security_equals); $idx++){
|
||||||
|
$name = $this->name2id($security_equals[$idx]);
|
||||||
|
$this->members[] = Array("account_id" => $security_equals[$idx], "account_name" => "$name");
|
||||||
|
}
|
||||||
|
return $this->members;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
class accounts
|
class accounts_
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $account_id;
|
var $account_id;
|
||||||
|
4
phpgwapi/inc/class.auth.inc.php
Normal file
4
phpgwapi/inc/class.auth.inc.php
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
if (empty($phpgw_info["server"]["auth_type"])){$phpgw_info["server"]["auth_type"] = "sql";}
|
||||||
|
include(PHPGW_API_INC."/class.auth_".$phpgw_info["server"]["auth_type"].".inc.php");
|
||||||
|
?>
|
@ -414,9 +414,9 @@
|
|||||||
. $phpgw_info["server"]["template_set"];
|
. $phpgw_info["server"]["template_set"];
|
||||||
$tpldir_default = PHPGW_SERVER_ROOT . "/".$appname . "/templates/default";
|
$tpldir_default = PHPGW_SERVER_ROOT . "/".$appname . "/templates/default";
|
||||||
|
|
||||||
if (is_dir ($tpldir)) {
|
if (is_dir($tpldir)) {
|
||||||
return $tpldir;
|
return $tpldir;
|
||||||
} elseif (is_dir ($tpldir_default)) {
|
} elseif (is_dir($tpldir_default)) {
|
||||||
return $tpldir_default;
|
return $tpldir_default;
|
||||||
} else {
|
} else {
|
||||||
return False;
|
return False;
|
||||||
|
@ -100,21 +100,9 @@
|
|||||||
$this->common = CreateObject("phpgwapi.common");
|
$this->common = CreateObject("phpgwapi.common");
|
||||||
$this->hooks = CreateObject("phpgwapi.hooks");
|
$this->hooks = CreateObject("phpgwapi.hooks");
|
||||||
|
|
||||||
if (! $phpgw_info["server"]["auth_type"]) {
|
$this->auth = createobject("phpgwapi.auth");
|
||||||
$phpgw_info["server"]["auth_type"] = "sql";
|
|
||||||
}
|
|
||||||
$this->auth = create_specialobject("phpgwapi.auth",$phpgw_info["server"]["auth_type"]);
|
|
||||||
$this->acl = CreateObject("phpgwapi.acl");
|
$this->acl = CreateObject("phpgwapi.acl");
|
||||||
|
$this->accounts = createobject("phpgwapi.accounts");
|
||||||
if (! $phpgw_info["server"]["account_repository"]) {
|
|
||||||
if ($phpgw_info["server"]["auth_type"]) {
|
|
||||||
$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];
|
|
||||||
} else {
|
|
||||||
$phpgw_info["server"]["account_repository"] = "sql";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->accounts = create_specialobject("phpgwapi.accounts",$phpgw_info["server"]["auth_type"]);
|
|
||||||
|
|
||||||
$this->session = CreateObject("phpgwapi.sessions");
|
$this->session = CreateObject("phpgwapi.sessions");
|
||||||
$this->preferences = CreateObject("phpgwapi.preferences");
|
$this->preferences = CreateObject("phpgwapi.preferences");
|
||||||
$this->applications = CreateObject("phpgwapi.applications");
|
$this->applications = CreateObject("phpgwapi.applications");
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
$this->db->lock("preferences");
|
$this->db->lock("preferences");
|
||||||
$this->db->query('delete from preferences where preference_owner=' . $this->account_id,__LINE__,__FILE__);
|
$this->db->query("delete from preferences where preference_owner='" . $this->account_id . "'",__LINE__,__FILE__);
|
||||||
|
|
||||||
if ($PHP_VERSION < "4.0.0") {
|
if ($PHP_VERSION < "4.0.0") {
|
||||||
$pref_info = addslashes(serialize($this->data));
|
$pref_info = addslashes(serialize($this->data));
|
||||||
@ -101,8 +101,8 @@
|
|||||||
$pref_info = serialize($this->data);
|
$pref_info = serialize($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->query('insert into preferences (preference_owner,preference_value) values ('
|
$this->db->query("insert into preferences (preference_owner,preference_value) values ('"
|
||||||
. $this->account_id . ",'" . $pref_info . "')",__LINE__,__FILE__);
|
. $this->account_id . "','" . $pref_info . "')",__LINE__,__FILE__);
|
||||||
|
|
||||||
$this->db->unlock();
|
$this->db->unlock();
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
@ -233,11 +233,6 @@
|
|||||||
define("PHPGW_ACL_EDIT",4);
|
define("PHPGW_ACL_EDIT",4);
|
||||||
define("PHPGW_ACL_DELETE",8);
|
define("PHPGW_ACL_DELETE",8);
|
||||||
|
|
||||||
//incase we are dealing with a fresh login
|
|
||||||
if (! isset($phpgw_info["user"]["preferences"]["common"]["template_set"])) {
|
|
||||||
$phpgw_info["user"]["preferences"]["common"]["template_set"] = "default";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Since LDAP will return system accounts, there are a few we don't want to login.
|
// Since LDAP will return system accounts, there are a few we don't want to login.
|
||||||
$phpgw_info["server"]["global_denied_users"] = array('root' => True,
|
$phpgw_info["server"]["global_denied_users"] = array('root' => True,
|
||||||
'bin' => True,
|
'bin' => True,
|
||||||
@ -268,6 +263,12 @@
|
|||||||
\****************************************************************************/
|
\****************************************************************************/
|
||||||
$phpgw = CreateObject("phpgwapi.phpgw");
|
$phpgw = CreateObject("phpgwapi.phpgw");
|
||||||
$phpgw->phpgw_();
|
$phpgw->phpgw_();
|
||||||
|
//incase we are dealing with a fresh login
|
||||||
|
if (! isset($phpgw_info["user"]["preferences"]["common"]["template_set"])) {
|
||||||
|
$phpgw_info["user"]["preferences"]["common"]["template_set"] = "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($phpgw_info["flags"]["currentapp"] != "login" && $phpgw_info["flags"]["currentapp"] != "logout") {
|
if ($phpgw_info["flags"]["currentapp"] != "login" && $phpgw_info["flags"]["currentapp"] != "logout") {
|
||||||
//if (! $phpgw->session->verify()) {
|
//if (! $phpgw->session->verify()) {
|
||||||
// Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/login.php", "cd=10"));
|
// Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/login.php", "cd=10"));
|
||||||
|
Loading…
Reference in New Issue
Block a user