forked from extern/egroupware
Started adding the LDAP admin section functions
This commit is contained in:
parent
e4c14ef8cc
commit
e5f5796d49
@ -19,6 +19,9 @@
|
|||||||
$phpgw_info["flags"]["disable_message_class"] = True;
|
$phpgw_info["flags"]["disable_message_class"] = True;
|
||||||
$phpgw_info["flags"]["disable_send_class"] = True;
|
$phpgw_info["flags"]["disable_send_class"] = True;
|
||||||
include("../header.inc.php");
|
include("../header.inc.php");
|
||||||
|
include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_"
|
||||||
|
. $phpgw_info["server"]["auth_type"] . ".inc.php");
|
||||||
|
|
||||||
// Make sure they are not attempting to delete there own account.
|
// Make sure they are not attempting to delete there own account.
|
||||||
// If they are, they should not reach this point anyway.
|
// If they are, they should not reach this point anyway.
|
||||||
if ($phpgw_info["user"]["account_id"] == $account_id) {
|
if ($phpgw_info["user"]["account_id"] == $account_id) {
|
||||||
@ -55,53 +58,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($confirm) {
|
if ($confirm) {
|
||||||
$phpgw->db->query("select account_lid from accounts where account_id=$account_id");
|
$cd = account_delete($account_id);
|
||||||
$phpgw->db->next_record();
|
|
||||||
$lid = $phpgw->db->f(0);
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
$phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$lid'");
|
|
||||||
while ($phpgw->db->next_record()) {
|
|
||||||
$cal_id[$i] = $phpgw->db->f("cal_id");
|
|
||||||
echo "<br>" . $phpgw->db->f("cal_id");
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$table_locks = array('preferences','todo','addressbook','accounts',
|
|
||||||
'webcal_entry','webcal_entry_user','webcal_entry_repeats',
|
|
||||||
'webcal_entry_groups');
|
|
||||||
$phpgw->db->lock($table_locks);
|
|
||||||
|
|
||||||
for ($i=0; $i<count($cal_id); $i++) {
|
|
||||||
$phpgw->db->query("delete from webcal_entry_repeats where cal_id='$cal_id[$i]'");
|
|
||||||
$phpgw->db->query("delete from webcal_entry_groups where cal_id='$cal_id[$i]'");
|
|
||||||
}
|
|
||||||
|
|
||||||
$phpgw->db->query("delete from webcal_entry where cal_create_by='$lid'");
|
|
||||||
$phpgw->db->query("delete from webcal_entry_user where cal_login='$lid'");
|
|
||||||
|
|
||||||
$phpgw->db->query("delete from todo where todo_owner='$lid'");
|
|
||||||
$phpgw->db->query("delete from addressbook where ab_owner='$lid'");
|
|
||||||
$phpgw->db->query("delete from accounts where account_lid='$lid'");
|
|
||||||
//$phpgw->db->query("delete from users_headlines where owner='$lid'");
|
|
||||||
//$phpgw->db->query("delete from profiles where owner='$lid'");
|
|
||||||
|
|
||||||
$phpgw->common->preferences_delete("all",$lid);
|
|
||||||
|
|
||||||
$phpgw->db->unlock();
|
|
||||||
|
|
||||||
$sep = $phpgw->common->filesystem_separator();
|
|
||||||
|
|
||||||
//$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "users"
|
|
||||||
// . $sep;
|
|
||||||
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep;
|
|
||||||
|
|
||||||
//echo "<h1> rmdir:".$basedir . $lid."</h1>\n";
|
|
||||||
if (! @rmdir($basedir . $lid)) {
|
|
||||||
$cd = 34;
|
|
||||||
} else {
|
|
||||||
$cd = 29;
|
|
||||||
}
|
|
||||||
|
|
||||||
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
||||||
}
|
}
|
||||||
|
32
admin/inc/accounts_ldap.inc.php
Normal file
32
admin/inc/accounts_ldap.inc.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
/**************************************************************************\
|
||||||
|
* phpGroupWare - administration *
|
||||||
|
* http://www.phpgroupware.org *
|
||||||
|
* -------------------------------------------- *
|
||||||
|
* 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$ */
|
||||||
|
|
||||||
|
function account_list($start,$sort,$order)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_add($account_info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_edit($account_id,$account_info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_delete($account_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
76
admin/inc/accounts_sql.inc.php
Executable file
76
admin/inc/accounts_sql.inc.php
Executable file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/**************************************************************************\
|
||||||
|
* phpGroupWare - administration *
|
||||||
|
* http://www.phpgroupware.org *
|
||||||
|
* -------------------------------------------- *
|
||||||
|
* 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$ */
|
||||||
|
|
||||||
|
function account_list($start,$sort,$order)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_add($account_info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_edit($account_id,$account_info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function account_delete($account_id)
|
||||||
|
{
|
||||||
|
global $phpgw;
|
||||||
|
|
||||||
|
$phpgw->db->query("select account_lid from accounts where account_id=$account_id");
|
||||||
|
$phpgw->db->next_record();
|
||||||
|
$lid = $phpgw->db->f(0);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
$phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$lid'");
|
||||||
|
while ($phpgw->db->next_record()) {
|
||||||
|
$cal_id[$i] = $phpgw->db->f("cal_id");
|
||||||
|
echo "<br>" . $phpgw->db->f("cal_id");
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_locks = array('preferences','todo','addressbook','accounts',
|
||||||
|
'webcal_entry','webcal_entry_user','webcal_entry_repeats',
|
||||||
|
'webcal_entry_groups');
|
||||||
|
$phpgw->db->lock($table_locks);
|
||||||
|
|
||||||
|
for ($i=0; $i<count($cal_id); $i++) {
|
||||||
|
$phpgw->db->query("delete from webcal_entry_repeats where cal_id='$cal_id[$i]'");
|
||||||
|
$phpgw->db->query("delete from webcal_entry_groups where cal_id='$cal_id[$i]'");
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpgw->db->query("delete from webcal_entry where cal_create_by='$lid'");
|
||||||
|
$phpgw->db->query("delete from webcal_entry_user where cal_login='$lid'");
|
||||||
|
|
||||||
|
$phpgw->db->query("delete from todo where todo_owner='$lid'");
|
||||||
|
$phpgw->db->query("delete from addressbook where ab_owner='$lid'");
|
||||||
|
$phpgw->db->query("delete from accounts where account_lid='$lid'");
|
||||||
|
|
||||||
|
$phpgw->common->preferences_delete("all",$lid);
|
||||||
|
|
||||||
|
$phpgw->db->unlock();
|
||||||
|
|
||||||
|
$sep = $phpgw->common->filesystem_separator();
|
||||||
|
|
||||||
|
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep;
|
||||||
|
|
||||||
|
if (! @rmdir($basedir . $lid)) {
|
||||||
|
$cd = 34;
|
||||||
|
} else {
|
||||||
|
$cd = 29;
|
||||||
|
}
|
||||||
|
return $cd;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user